代码拉取完成,页面将自动刷新
本示例将演示如何在Niobeu4开发板上使用WATCHDOG接口进行任务看门狗开发
int32_t WatchdogOpen(int16_t wdtId, DevHandle *handle);
描述:
watchdog Open打开看门狗函数。
参数:
名字 | 描述 |
---|---|
wdtId | 看门狗ID |
handle | 设备句柄 |
void WatchdogClose(DevHandle handle);
描述:
watchdog close关闭看门狗函数。
参数:
名字 | 描述 |
---|---|
handle | 设备句柄 |
int32_t WatchdogFeed(DevHandle handle);
描述:
watchdog feed喂狗函数。
参数:
名字 | 描述 |
---|---|
handle | 设备句柄 |
int32_t WatchdogGetStatus(DevHandle handle, int32_t *status);
描述:
watchdog getStatus获取看门狗状态函数。
参数:
名字 | 描述 |
---|---|
handle | 设备句柄 |
status | 看门狗状态指针 |
int32_t WatchdogStart(DevHandle handle);
描述:
watchdog start启动看门狗函数。
参数:
名字 | 描述 |
---|---|
handle | 设备句柄 |
int32_t WatchdogStop(DevHandle handle);
描述:
watchdog stop停止看门狗函数。
参数:
名字 | 描述 |
---|---|
handle | 设备句柄 |
int32_t WatchdogSetTimeout(DevHandle handle, uint32_t seconds);
描述:
watchdog setTimeout设置看门狗超时时间函数。
参数:
名字 | 描述 |
---|---|
handle | 设备句柄 |
seconds | 超时时间 |
int32_t WatchdogGetTimeout(DevHandle handle, uint32_t *seconds);
描述:
watchdog getTimeout获取看门狗超时时间函数。
参数:
名字 | 描述 |
---|---|
handle | 设备句柄 |
seconds | 超时时间指针,单位为秒 |
(Top) → Platform → Board Selection → select board niobeu4 → use openvalley niobeu4 application → niobeu4 application choose
104_hdf_watchdog
hb build
脚本进行编译。hcs配置文件在device/board/openvalley/niobeu4/liteos_m/hdf_config/hdf.hcs目录下,需要进行如下设置:
watchdog_config {
watchdog0_config {
match_attr = "watchdog0";
id = 0; // 看门狗ID
timeout = 1; // 看门狗超时时间,单位s
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。