summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modmachinewdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'esp8266/modmachinewdt.c')
-rw-r--r--esp8266/modmachinewdt.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/esp8266/modmachinewdt.c b/esp8266/modmachinewdt.c
index e0b1ff5d78..6dc4c0d18c 100644
--- a/esp8266/modmachinewdt.c
+++ b/esp8266/modmachinewdt.c
@@ -31,6 +31,7 @@
#include "py/obj.h"
#include "py/runtime.h"
#include "user_interface.h"
+#include "etshal.h"
const mp_obj_type_t esp_wdt_type;
@@ -63,8 +64,16 @@ STATIC mp_obj_t machine_wdt_feed(mp_obj_t self_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_wdt_feed_obj, machine_wdt_feed);
+STATIC mp_obj_t machine_wdt_deinit(mp_obj_t self_in) {
+ (void)self_in;
+ ets_wdt_disable();
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_wdt_deinit_obj, machine_wdt_deinit);
+
STATIC const mp_map_elem_t machine_wdt_locals_dict_table[] = {
- { MP_OBJ_NEW_QSTR(MP_QSTR_feed), (mp_obj_t)&machine_wdt_feed_obj }
+ { MP_OBJ_NEW_QSTR(MP_QSTR_feed), (mp_obj_t)&machine_wdt_feed_obj },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), (mp_obj_t)&machine_wdt_deinit_obj },
};
STATIC MP_DEFINE_CONST_DICT(machine_wdt_locals_dict, machine_wdt_locals_dict_table);