summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/modmachine.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-09-04 00:12:48 +1000
committerDamien George <damien.p.george@gmail.com>2016-09-04 00:12:48 +1000
commit76c366df56ad64eae3b021304954954e663bf1df (patch)
tree5bdb15118451f7eee439b5145f5075fd051baa1b /stmhal/modmachine.c
parentf7c461152364650b71231387c3f80b37277c9161 (diff)
downloadmicropython-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.c3
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 },