diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-06-02 10:33:24 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-02 10:33:24 -0700 |
| commit | db04fd1725d375d7f9110c35f9346b32cb99b19e (patch) | |
| tree | 652ffb11481a29bd424de8de05a8ab42ab042b99 /shared-bindings/microcontroller | |
| parent | aae7a459f37c284445eb68b5d691238f212a12a4 (diff) | |
| parent | 7e632c9414073a36db0b74d891ee0408a2fdb565 (diff) | |
Merge pull request #2933 from simmel-project/wdt-nrf
Add Watchdog timer and add support for NRF watchdog
Diffstat (limited to 'shared-bindings/microcontroller')
| -rw-r--r-- | shared-bindings/microcontroller/__init__.c | 5 | ||||
| -rw-r--r-- | shared-bindings/microcontroller/__init__.h | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 21e1c90a9..88fe9c224 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -167,6 +167,11 @@ STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = { #else { MP_ROM_QSTR(MP_QSTR_nvm), MP_ROM_PTR(&mp_const_none_obj) }, #endif + #if CIRCUITPY_WATCHDOG + { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&common_hal_mcu_watchdogtimer_obj) }, + #else + { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&mp_const_none_obj) }, + #endif { MP_ROM_QSTR(MP_QSTR_RunMode), MP_ROM_PTR(&mcu_runmode_type) }, { MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&mcu_pin_type) }, { MP_ROM_QSTR(MP_QSTR_pin), MP_ROM_PTR(&mcu_pin_module) }, diff --git a/shared-bindings/microcontroller/__init__.h b/shared-bindings/microcontroller/__init__.h index e1487c555..8abdff763 100644 --- a/shared-bindings/microcontroller/__init__.h +++ b/shared-bindings/microcontroller/__init__.h @@ -49,10 +49,13 @@ extern const mcu_processor_obj_t common_hal_mcu_processor_obj; #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 - #include "common-hal/nvm/ByteArray.h" extern const nvm_bytearray_obj_t common_hal_mcu_nvm_obj; +#endif +#if CIRCUITPY_WATCHDOG +#include "common-hal/watchdog/WatchDogTimer.h" +extern watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj; #endif #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER___INIT___H |
