From 76c366df56ad64eae3b021304954954e663bf1df Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 4 Sep 2016 00:12:48 +1000 Subject: stmhal: Add machine.WDT class. Usage: import machine wdt = machine.WDT(0, 5000) # 5 second timeout wdt.feed() Thanks to Moritz for the initial implementation. --- stmhal/modmachine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stmhal/modmachine.c') diff --git a/stmhal/modmachine.c b/stmhal/modmachine.c index 0b01058fa..68c43d67e 100644 --- a/stmhal/modmachine.c +++ b/stmhal/modmachine.c @@ -44,6 +44,7 @@ #include "rtc.h" #include "i2c.h" #include "spi.h" +#include "wdt.h" // machine.info([dump_alloc_table]) // Print out lots of information about the board. @@ -490,10 +491,10 @@ STATIC const mp_map_elem_t machine_module_globals_table[] = { // initialize master mode on the peripheral. { MP_OBJ_NEW_QSTR(MP_QSTR_I2C), (mp_obj_t)&machine_i2c_type }, { MP_OBJ_NEW_QSTR(MP_QSTR_SPI), (mp_obj_t)&pyb_spi_type }, + { MP_OBJ_NEW_QSTR(MP_QSTR_WDT), (mp_obj_t)&pyb_wdt_type }, #if 0 { MP_OBJ_NEW_QSTR(MP_QSTR_UART), (mp_obj_t)&pyb_uart_type }, { MP_OBJ_NEW_QSTR(MP_QSTR_Timer), (mp_obj_t)&pyb_timer_type }, - { MP_OBJ_NEW_QSTR(MP_QSTR_WDT), (mp_obj_t)&pyb_wdt_type }, { MP_OBJ_NEW_QSTR(MP_QSTR_HeartBeat), (mp_obj_t)&pyb_heartbeat_type }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD), (mp_obj_t)&pyb_sd_type }, -- cgit v1.2.3