void bsp_wdt_test(void) { spinlock_t lock; wdt_err("enter wdt test\n"); spin_lock_init(&lock); spin_lock(&lock); spin_lock(&lock); }
s32 bsp_wdt_reboot_register_hook(void *hook) { /*参数判断,如果函数指针为空返回错误*/ if(WDT_NULL == hook) { wdt_err("hook is NULL\n"); return WDT_ERROR; } /*通过全局变量注册上层MSP处理函数*/ g_wdt_rebootfunc = hook; return WDT_OK; }
int bsp_wdt_stop_test002(void) { unsigned int timeleft = 0; bsp_wdt_start(); bsp_wdt_stop(); bsp_wdt_get_timeleft(&timeleft); if (timeleft >= 30) { taskDelay(10); wdt_err("%d\n", timeleft); return BSP_OK; } else { return BSP_ERROR; } }