From 27fd60d73962901d29e3f7fd9fd06b90cd934379 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+microdev1@users.noreply.github.com> Date: Sun, 24 Sep 2023 15:23:38 +0000 Subject: [PATCH] implement suggested changes - update the docs - split out common `watchdog_reset` - revert to using `None` instead of `WatchDogMode.NONE` --- locale/circuitpython.pot | 15 +++--- .../common-hal/watchdog/WatchDogTimer.c | 15 ------ .../common-hal/watchdog/WatchDogTimer.h | 6 +-- .../common-hal/watchdog/WatchDogTimer.c | 15 ------ .../common-hal/watchdog/WatchDogTimer.h | 6 +-- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 15 ------ ports/nrf/common-hal/watchdog/WatchDogTimer.h | 7 ++- .../common-hal/watchdog/WatchDogTimer.c | 15 ------ .../common-hal/watchdog/WatchDogTimer.h | 6 +-- .../common-hal/watchdog/WatchDogTimer.c | 4 -- .../common-hal/watchdog/WatchDogTimer.h | 6 +-- ports/silabs/supervisor/port.c | 4 ++ py/circuitpy_defns.mk | 1 + shared-bindings/watchdog/WatchDogMode.c | 5 -- shared-bindings/watchdog/WatchDogTimer.c | 18 +++---- shared-bindings/watchdog/WatchDogTimer.h | 4 +- shared-module/watchdog/__init__.c | 47 +++++++++++++++++++ shared-module/watchdog/__init__.h | 32 +++++++++++++ 18 files changed, 117 insertions(+), 104 deletions(-) create mode 100644 shared-module/watchdog/__init__.c create mode 100644 shared-module/watchdog/__init__.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 768d353b27..f40ef66999 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -200,6 +200,10 @@ msgstr "" msgid "%q must be <= %u" msgstr "" +#: py/argcheck.c +msgid "%q must be >= %d" +msgstr "" + #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -447,10 +451,6 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "ADC2 is being used by WiFi" -msgstr "" - #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "AP could not be started" msgstr "" @@ -4185,7 +4185,8 @@ msgstr "" msgid "unexpected keyword argument" msgstr "" -#: py/bc.c py/objnamedtuple.c shared-bindings/traceback/__init__.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: shared-bindings/traceback/__init__.c msgid "unexpected keyword argument '%q'" msgstr "" @@ -4279,10 +4280,6 @@ msgstr "" msgid "value out of range of target" msgstr "" -#: ports/espressif/common-hal/watchdog/WatchDogTimer.c -msgid "watchdog not initialized" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" diff --git a/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c b/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c index 15683a1275..435cfd6731 100644 --- a/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c +++ b/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c @@ -28,8 +28,6 @@ #include "py/runtime.h" -#include "shared/runtime/pyexec.h" - #include "shared-bindings/watchdog/__init__.h" #include "shared-bindings/watchdog/WatchDogTimer.h" #include "shared-bindings/microcontroller/__init__.h" @@ -82,19 +80,6 @@ void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { self->mode = WATCHDOGMODE_NONE; } -void watchdog_reset(void) { - watchdog_watchdogtimer_obj_t *self = &common_hal_mcu_watchdogtimer_obj; - if (self->mode == WATCHDOGMODE_RESET) { - mp_obj_t exception = pyexec_result()->exception; - if (exception != MP_OBJ_NULL && - exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) && - exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - return; - } - } - common_hal_watchdog_deinit(self); -} - mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) { return self->timeout; } diff --git a/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.h b/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.h index 579e8ce65f..ae214a95e6 100644 --- a/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.h +++ b/ports/atmel-samd/common-hal/watchdog/WatchDogTimer.h @@ -28,6 +28,9 @@ #define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H #include "py/obj.h" + +#include "shared-module/watchdog/__init__.h" + #include "shared-bindings/watchdog/WatchDogMode.h" #include "shared-bindings/watchdog/WatchDogTimer.h" @@ -37,7 +40,4 @@ struct _watchdog_watchdogtimer_obj_t { watchdog_watchdogmode_t mode; }; -// This needs to be called in order to disable the watchdog -void watchdog_reset(void); - #endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/espressif/common-hal/watchdog/WatchDogTimer.c b/ports/espressif/common-hal/watchdog/WatchDogTimer.c index 6410f5e61a..68437958e5 100644 --- a/ports/espressif/common-hal/watchdog/WatchDogTimer.c +++ b/ports/espressif/common-hal/watchdog/WatchDogTimer.c @@ -26,8 +26,6 @@ #include "py/runtime.h" -#include "shared/runtime/pyexec.h" - #include "shared-bindings/watchdog/__init__.h" #include "shared-bindings/microcontroller/__init__.h" @@ -68,19 +66,6 @@ void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { } } -void watchdog_reset(void) { - watchdog_watchdogtimer_obj_t *self = &common_hal_mcu_watchdogtimer_obj; - if (self->mode == WATCHDOGMODE_RESET) { - mp_obj_t exception = pyexec_result()->exception; - if (exception != MP_OBJ_NULL && - exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) && - exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - return; - } - } - common_hal_watchdog_deinit(self); -} - static void wdt_config(uint32_t timeout, watchdog_watchdogmode_t mode) { // enable panic hanler in WATCHDOGMODE_RESET mode // initialize Task Watchdog Timer (TWDT) diff --git a/ports/espressif/common-hal/watchdog/WatchDogTimer.h b/ports/espressif/common-hal/watchdog/WatchDogTimer.h index 8d95bfa4cc..461d11f18c 100644 --- a/ports/espressif/common-hal/watchdog/WatchDogTimer.h +++ b/ports/espressif/common-hal/watchdog/WatchDogTimer.h @@ -28,6 +28,9 @@ #define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H #include "py/obj.h" + +#include "shared-module/watchdog/__init__.h" + #include "shared-bindings/watchdog/WatchDogMode.h" #include "shared-bindings/watchdog/WatchDogTimer.h" @@ -37,7 +40,4 @@ struct _watchdog_watchdogtimer_obj_t { watchdog_watchdogmode_t mode; }; -// This needs to be called in order to disable the watchdog -void watchdog_reset(void); - #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 872c4642db..1ac0ee1076 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -33,8 +33,6 @@ #include "py/objproperty.h" #include "py/runtime.h" -#include "shared/runtime/pyexec.h" - #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/watchdog/__init__.h" #include "shared-bindings/watchdog/WatchDogTimer.h" @@ -109,19 +107,6 @@ void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { self->mode = WATCHDOGMODE_NONE; } -void watchdog_reset(void) { - watchdog_watchdogtimer_obj_t *self = &common_hal_mcu_watchdogtimer_obj; - if (self->mode == WATCHDOGMODE_RESET) { - mp_obj_t exception = pyexec_result()->exception; - if (exception != MP_OBJ_NULL && - exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) && - exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - return; - } - } - common_hal_watchdog_deinit(self); -} - mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) { return self->timeout; } diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h index 1ff654c321..e298a71ba7 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -28,6 +28,9 @@ #define MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H #include "py/obj.h" + +#include "shared-module/watchdog/__init__.h" + #include "shared-bindings/watchdog/WatchDogMode.h" #include "shared-bindings/watchdog/WatchDogTimer.h" @@ -37,8 +40,4 @@ struct _watchdog_watchdogtimer_obj_t { watchdog_watchdogmode_t mode; }; -// This needs to be called in order to disable the watchdog if it's set to -// "RAISE". If set to "RESET", then the watchdog cannot be reset. -void watchdog_reset(void); - #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c b/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c index 29234b46b0..61c71ccd62 100644 --- a/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c +++ b/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c @@ -26,8 +26,6 @@ #include "py/runtime.h" -#include "shared/runtime/pyexec.h" - #include "shared-bindings/watchdog/__init__.h" #include "shared-bindings/microcontroller/__init__.h" @@ -49,19 +47,6 @@ void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { self->mode = WATCHDOGMODE_NONE; } -void watchdog_reset(void) { - watchdog_watchdogtimer_obj_t *self = &common_hal_mcu_watchdogtimer_obj; - if (self->mode == WATCHDOGMODE_RESET) { - mp_obj_t exception = pyexec_result()->exception; - if (exception != MP_OBJ_NULL && - exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) && - exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - return; - } - } - common_hal_watchdog_deinit(self); -} - mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) { return self->timeout; } diff --git a/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.h b/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.h index 579e8ce65f..ae214a95e6 100644 --- a/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.h +++ b/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.h @@ -28,6 +28,9 @@ #define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H #include "py/obj.h" + +#include "shared-module/watchdog/__init__.h" + #include "shared-bindings/watchdog/WatchDogMode.h" #include "shared-bindings/watchdog/WatchDogTimer.h" @@ -37,7 +40,4 @@ struct _watchdog_watchdogtimer_obj_t { watchdog_watchdogmode_t mode; }; -// This needs to be called in order to disable the watchdog -void watchdog_reset(void); - #endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/silabs/common-hal/watchdog/WatchDogTimer.c b/ports/silabs/common-hal/watchdog/WatchDogTimer.c index b6158e1cc6..d65c794833 100644 --- a/ports/silabs/common-hal/watchdog/WatchDogTimer.c +++ b/ports/silabs/common-hal/watchdog/WatchDogTimer.c @@ -41,10 +41,6 @@ void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { WDOG_Enable(false); } -void watchdog_reset(void) { - common_hal_watchdog_deinit(&common_hal_mcu_watchdogtimer_obj); -} - mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) { return self->timeout; } diff --git a/ports/silabs/common-hal/watchdog/WatchDogTimer.h b/ports/silabs/common-hal/watchdog/WatchDogTimer.h index d1538bd491..9aad655e73 100644 --- a/ports/silabs/common-hal/watchdog/WatchDogTimer.h +++ b/ports/silabs/common-hal/watchdog/WatchDogTimer.h @@ -28,6 +28,9 @@ #define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H #include "py/obj.h" + +#include "shared-module/watchdog/__init__.h" + #include "shared-bindings/watchdog/WatchDogMode.h" #include "shared-bindings/watchdog/WatchDogTimer.h" @@ -37,7 +40,4 @@ struct _watchdog_watchdogtimer_obj_t { watchdog_watchdogmode_t mode; }; -// This needs to be called in order to disable the watchdog -void watchdog_reset(void); - #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/silabs/supervisor/port.c b/ports/silabs/supervisor/port.c index 8247c813a7..fba90882df 100644 --- a/ports/silabs/supervisor/port.c +++ b/ports/silabs/supervisor/port.c @@ -192,6 +192,10 @@ void reset_port(void) { #if CIRCUITPY_RTC rtc_reset(); #endif + + #if CIRCUITPY_WATCHDOG + watchdog_reset(); + #endif } void reset_to_bootloader(void) { diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index c819d46db8..3974e27df4 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -666,6 +666,7 @@ SRC_SHARED_MODULE_ALL = \ usb/core/__init__.c \ usb/core/Device.c \ ustack/__init__.c \ + watchdog/__init__.c \ zlib/__init__.c \ vectorio/Circle.c \ vectorio/Polygon.c \ diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index 343702e4b1..944ab451fa 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -28,16 +28,12 @@ #include "shared-bindings/watchdog/WatchDogMode.h" -MAKE_ENUM_VALUE(watchdog_watchdogmode_type, watchdogmode, NONE, WATCHDOGMODE_NONE); MAKE_ENUM_VALUE(watchdog_watchdogmode_type, watchdogmode, RAISE, WATCHDOGMODE_RAISE); MAKE_ENUM_VALUE(watchdog_watchdogmode_type, watchdogmode, RESET, WATCHDOGMODE_RESET); //| class WatchDogMode: //| """Run state of the watchdog timer.""" //| -//| NONE: WatchDogMode -//| """The `WatchDogTimer` is disabled.""" -//| //| RAISE: WatchDogMode //| """Raise an exception when the `WatchDogTimer` expires.""" //| @@ -45,7 +41,6 @@ MAKE_ENUM_VALUE(watchdog_watchdogmode_type, watchdogmode, RESET, WATCHDOGMODE_RE //| """Reset the system when the `WatchDogTimer` expires.""" //| MAKE_ENUM_MAP(watchdog_watchdogmode) { - MAKE_ENUM_MAP_ENTRY(watchdogmode, NONE), MAKE_ENUM_MAP_ENTRY(watchdogmode, RAISE), MAKE_ENUM_MAP_ENTRY(watchdogmode, RESET), }; diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index cc91a09ef2..49cfdaecb4 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -71,8 +71,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watch //| //| :raises RuntimeError: if the watchdog timer cannot be disabled on this platform. //| -//| .. note:: This is deprecated in ``8.1.0`` and will be removed in ``9.0.0``. -//| Set watchdog `mode` to `WatchDogMode.NONE` instead. +//| .. note:: This is deprecated in ``9.0.0`` and will be removed in ``10.0.0``. +//| Set watchdog `mode` to `None` instead. //| //| """ //| ... @@ -107,16 +107,17 @@ MP_PROPERTY_GETSET(watchdog_watchdogtimer_timeout_obj, (mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, (mp_obj_t)&watchdog_watchdogtimer_set_timeout_obj); -//| mode: WatchDogMode -//| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. +//| mode: Optional[WatchDogMode] +//| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode` or `None` when +//| the timer is disabled. //| //| Setting a `WatchDogMode` activates the WatchDog:: //| -//| from microcontroller import watchdog as w +//| from microcontroller import watchdog //| from watchdog import WatchDogMode //| -//| w.timeout = 5 -//| w.mode = WatchDogMode.RESET +//| watchdog.timeout = 5 +//| watchdog.mode = WatchDogMode.RESET //| //| //| Once set, the `WatchDogTimer` will perform the specified action if the timer expires.""" @@ -129,7 +130,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_mode_obj, watchdog_watchdog STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t obj) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_watchdog_set_mode(self, cp_enum_value(&watchdog_watchdogmode_type, obj, MP_QSTR_mode)); + watchdog_watchdogmode_t mode = (obj == mp_const_none) ? WATCHDOGMODE_NONE : cp_enum_value(&watchdog_watchdogmode_type, obj, MP_QSTR_mode); + common_hal_watchdog_set_mode(self, mode); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_mode_obj, watchdog_watchdogtimer_obj_set_mode); diff --git a/shared-bindings/watchdog/WatchDogTimer.h b/shared-bindings/watchdog/WatchDogTimer.h index 48044748a9..a566b267d6 100644 --- a/shared-bindings/watchdog/WatchDogTimer.h +++ b/shared-bindings/watchdog/WatchDogTimer.h @@ -27,14 +27,14 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H #define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H -#include +#include "py/obj.h" #include "shared-bindings/watchdog/WatchDogMode.h" typedef struct _watchdog_watchdogtimer_obj_t watchdog_watchdogtimer_obj_t; extern void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self); -extern void common_hal_watchdog_set_mode(watchdog_watchdogtimer_obj_t *self, watchdog_watchdogmode_t); +extern void common_hal_watchdog_set_mode(watchdog_watchdogtimer_obj_t *self, watchdog_watchdogmode_t mode); extern watchdog_watchdogmode_t common_hal_watchdog_get_mode(watchdog_watchdogtimer_obj_t *self); extern void common_hal_watchdog_set_timeout(watchdog_watchdogtimer_obj_t *self, mp_float_t timeout); diff --git a/shared-module/watchdog/__init__.c b/shared-module/watchdog/__init__.c new file mode 100644 index 0000000000..b348647c06 --- /dev/null +++ b/shared-module/watchdog/__init__.c @@ -0,0 +1,47 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 MicroDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" + +#include "shared/runtime/pyexec.h" + +#include "shared-module/watchdog/__init__.h" + +#include "shared-bindings/watchdog/WatchDogTimer.h" +#include "shared-bindings/microcontroller/__init__.h" + +void watchdog_reset(void) { + watchdog_watchdogtimer_obj_t *self = &common_hal_mcu_watchdogtimer_obj; + if (self->mode == WATCHDOGMODE_RESET) { + mp_obj_t exception = pyexec_result()->exception; + if (exception != MP_OBJ_NULL && + exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) && + exception != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + return; + } + } + common_hal_watchdog_deinit(self); +} diff --git a/shared-module/watchdog/__init__.h b/shared-module/watchdog/__init__.h new file mode 100644 index 0000000000..219ccfc7b4 --- /dev/null +++ b/shared-module/watchdog/__init__.h @@ -0,0 +1,32 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 MicroDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_WATCHDOG___INIT___H +#define MICROPY_INCLUDED_SHARED_MODULE_WATCHDOG___INIT___H + +extern void watchdog_reset(void); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_WATCHDOG___INIT___H