Skip to content

Commit 1ed4978

Browse files
committed
Remove NONE from mode enum and doc tweaks
1 parent 9380c34 commit 1ed4978

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

shared-bindings/watchdog/WatchDogMode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,13 @@ mp_obj_t watchdog_watchdogmode_type_to_obj(watchdog_watchdogmode_t mode) {
7474
}
7575

7676
STATIC const mp_rom_map_elem_t watchdog_watchdogmode_locals_dict_table[] = {
77-
{MP_ROM_QSTR(MP_QSTR_NONE), MP_ROM_PTR(&mp_const_none_obj)},
7877
{MP_ROM_QSTR(MP_QSTR_RAISE), MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)},
7978
{MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)},
8079
};
8180
STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogmode_locals_dict, watchdog_watchdogmode_locals_dict_table);
8281

8382
STATIC void watchdog_watchdogmode_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
84-
qstr runmode = MP_QSTR_NONE;
83+
qstr runmode = MP_QSTR_None;
8584
if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) {
8685
runmode = MP_QSTR_RAISE;
8786
}

shared-bindings/watchdog/WatchDogTimer.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@
4040

4141
#include "supervisor/port.h"
4242

43+
//| class WatchDogTimer:
44+
//| """Timer that is used to detect code lock ups and automatically reset the microcontroller
45+
//| when one is detected.
46+
//|
47+
//| A lock up is detected when the watchdog hasn't been fed after a given duration. So, make
48+
//| sure to call `feed` within the timeout.
49+
//| """
50+
//|
51+
52+
//| def __init__(self, ):
53+
//| """Not currently dynamically supported. Access the sole instance through `microcontroller.watchdog`."""
54+
//| ...
55+
//|
56+
4357
//| def feed(self):
4458
//| """Feed the watchdog timer. This must be called regularly, otherwise
4559
//| the timer will expire."""

shared-bindings/watchdog/__init__.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,14 @@
3434
//|
3535
//| The `watchdog` module provides support for a Watchdog Timer. This timer will reset the device
3636
//| if it hasn't been fed after a specified amount of time. This is useful to ensure the board
37-
//| has not crashed or locked up. You can enable the watchdog timer using :class:`wdt.WDT`.
38-
//| Note that on some platforms the watchdog timer cannot be disabled once it has been enabled.
37+
//| has not crashed or locked up. Note that on some platforms the watchdog timer cannot be disabled
38+
//| once it has been enabled.
3939
//|
40-
//| The WatchDogTimer is used to restart the system when the application crashes and ends
40+
//| The `WatchDogTimer` is used to restart the system when the application crashes and ends
4141
//| up into a non recoverable state. Once started it cannot be stopped or
4242
//| reconfigured in any way. After enabling, the application must "feed" the
4343
//| watchdog periodically to prevent it from expiring and resetting the system.
4444
//|
45-
//| Note that this module can't be imported and used directly. The sole
46-
//| instance of :class:`WatchDogTimer` is available at
47-
//| :attr:`microcontroller.watchdog`.
48-
//|
4945
//| Example usage::
5046
//|
5147
//| from microcontroller import watchdog as w

0 commit comments

Comments
 (0)