diff options
author | Damien George <damien.p.george@gmail.com> | 2016-09-04 00:12:48 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-09-04 00:12:48 +1000 |
commit | 76c366df56ad64eae3b021304954954e663bf1df (patch) | |
tree | 5bdb15118451f7eee439b5145f5075fd051baa1b /stmhal/modmachine.c | |
parent | f7c461152364650b71231387c3f80b37277c9161 (diff) | |
download | micropython-76c366df56ad64eae3b021304954954e663bf1df.tar.gz micropython-76c366df56ad64eae3b021304954954e663bf1df.zip |
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.
Diffstat (limited to 'stmhal/modmachine.c')
-rw-r--r-- | stmhal/modmachine.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/stmhal/modmachine.c b/stmhal/modmachine.c index 0b01058fa5..68c43d67ef 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 }, |