summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorSean Cross <sean@xobs.io>2020-05-22 12:35:29 +0800
committerSean Cross <sean@xobs.io>2020-05-27 11:28:49 +0800
commit08362c9cabce24ffdc2bd6018ab7fc3e9e6e4801 (patch)
tree8f74514dccbfd989b0abbe5b43898c371b85e834 /py
parentec99dae95384fa08e4b1bc72273f1d34c6d646bb (diff)
watchdogtimer: refactor to new api
This refactors the WatchDogTimer API to use the format proposed in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632268227 Signed-off-by: Sean Cross <sean@xobs.io>
Diffstat (limited to 'py')
-rw-r--r--py/circuitpy_defns.mk1
-rw-r--r--py/circuitpy_mpconfig.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
index 13b913075..d77559912 100644
--- a/py/circuitpy_defns.mk
+++ b/py/circuitpy_defns.mk
@@ -306,6 +306,7 @@ SRC_COMMON_HAL_ALL = \
supervisor/Runtime.c \
supervisor/__init__.c \
watchdog/__init__.c \
+ watchdog/WatchDogMode.c \
watchdog/WatchDogTimer.c \
SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL))
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h
index 002b60e8a..0b5547058 100644
--- a/py/circuitpy_mpconfig.h
+++ b/py/circuitpy_mpconfig.h
@@ -633,6 +633,9 @@ extern const struct _mp_obj_module_t ustack_module;
// This is not a top-level module; it's microcontroller.watchdog.
#if CIRCUITPY_WATCHDOG
extern const struct _mp_obj_module_t watchdog_module;
+#define WATCHDOG_MODULE { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&watchdog_module) },
+#else
+#define WATCHDOG_MODULE
#endif
// Define certain native modules with weak links so they can be replaced with Python
@@ -705,6 +708,7 @@ extern const struct _mp_obj_module_t watchdog_module;
USB_HID_MODULE \
USB_MIDI_MODULE \
USTACK_MODULE \
+ WATCHDOG_MODULE \
// If weak links are enabled, just include strong links in the main list of modules,
// and also include the underscore alternate names.