summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorSean Cross <sean@xobs.io>2020-05-21 13:47:23 +0800
committerSean Cross <sean@xobs.io>2020-05-27 11:28:49 +0800
commit595f6387c2a4f1c919cfab80b07493820ac0051b (patch)
tree40e96e0fcf52ced0cf6dc48bc3aef317af3f58a4 /py
parentc23f151b6b64011a97752b85e97d1d06b70b73d4 (diff)
watchdog: rename module from `wdt` and move to `microcontroller`
This also places it under the `microcontroller` object. Signed-off-by: Sean Cross <sean@xobs.io>
Diffstat (limited to 'py')
-rw-r--r--py/circuitpy_defns.mk8
-rw-r--r--py/circuitpy_mpconfig.h9
-rw-r--r--py/circuitpy_mpconfig.mk4
3 files changed, 9 insertions, 12 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
index be04dba48..13b913075 100644
--- a/py/circuitpy_defns.mk
+++ b/py/circuitpy_defns.mk
@@ -241,8 +241,8 @@ endif
ifeq ($(CIRCUITPY_USTACK),1)
SRC_PATTERNS += ustack/%
endif
-ifeq ($(CIRCUITPY_WDT),1)
-SRC_PATTERNS += wdt/%
+ifeq ($(CIRCUITPY_WATCHDOG),1)
+SRC_PATTERNS += watchdog/%
endif
ifeq ($(CIRCUITPY_PEW),1)
SRC_PATTERNS += _pew/%
@@ -305,8 +305,8 @@ SRC_COMMON_HAL_ALL = \
rtc/__init__.c \
supervisor/Runtime.c \
supervisor/__init__.c \
- wdt/__init__.c \
- wdt/WDT.c \
+ watchdog/__init__.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 50f1139d7..002b60e8a 100644
--- a/py/circuitpy_mpconfig.h
+++ b/py/circuitpy_mpconfig.h
@@ -630,11 +630,9 @@ extern const struct _mp_obj_module_t ustack_module;
#define RE_MODULE
#endif
-#if CIRCUITPY_WDT
-extern const struct _mp_obj_module_t wdt_module;
-#define WDT_MODULE { MP_ROM_QSTR(MP_QSTR_wdt), MP_ROM_PTR(&wdt_module) },
-#else
-#define WDT_MODULE
+// This is not a top-level module; it's microcontroller.watchdog.
+#if CIRCUITPY_WATCHDOG
+extern const struct _mp_obj_module_t watchdog_module;
#endif
// Define certain native modules with weak links so they can be replaced with Python
@@ -707,7 +705,6 @@ extern const struct _mp_obj_module_t wdt_module;
USB_HID_MODULE \
USB_MIDI_MODULE \
USTACK_MODULE \
- WDT_MODULE \
// If weak links are enabled, just include strong links in the main list of modules,
// and also include the underscore alternate names.
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk
index 1b74f45c3..865654a0d 100644
--- a/py/circuitpy_mpconfig.mk
+++ b/py/circuitpy_mpconfig.mk
@@ -229,8 +229,8 @@ CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB)
# watchdog hardware support
-CIRCUITPY_WDT ?= 0
-CFLAGS += -DCIRCUITPY_WDT=$(CIRCUITPY_WDT)
+CIRCUITPY_WATCHDOG ?= 0
+CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG)
# Enabled micropython.native decorator (experimental)
CIRCUITPY_ENABLE_MPY_NATIVE ?= 0