Skip to content

Commit 116ac49

Browse files
committed
【修复】wdt 初始化失败的 bug
1 parent c12d94e commit 116ac49

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

port/modules/machine/machine_wdt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ STATIC mp_obj_t machine_wdt_make_new(const mp_obj_type_t *type_in, size_t n_args
7979
result = rt_device_control(self->wdt_device, RT_DEVICE_CTRL_WDT_SET_TIMEOUT, (void *)&timeout);
8080
error_check(result == RT_EOK, "WDT set timout error");
8181

82+
result = rt_device_control(self->wdt_device, RT_DEVICE_CTRL_WDT_START, RT_NULL);
83+
error_check(result == RT_EOK, "WDT start error");
84+
8285
// return constant object
8386
return MP_OBJ_FROM_PTR(self);
8487
}

0 commit comments

Comments
 (0)