File tree Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -74,14 +74,13 @@ mp_obj_t watchdog_watchdogmode_type_to_obj(watchdog_watchdogmode_t mode) {
74
74
}
75
75
76
76
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 )},
78
77
{MP_ROM_QSTR (MP_QSTR_RAISE ), MP_ROM_PTR (& watchdog_watchdogmode_raise_obj )},
79
78
{MP_ROM_QSTR (MP_QSTR_RESET ), MP_ROM_PTR (& watchdog_watchdogmode_reset_obj )},
80
79
};
81
80
STATIC MP_DEFINE_CONST_DICT (watchdog_watchdogmode_locals_dict , watchdog_watchdogmode_locals_dict_table );
82
81
83
82
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 ;
85
84
if (MP_OBJ_TO_PTR (self_in ) == MP_ROM_PTR (& watchdog_watchdogmode_raise_obj )) {
86
85
runmode = MP_QSTR_RAISE ;
87
86
}
Original file line number Diff line number Diff line change 40
40
41
41
#include "supervisor/port.h"
42
42
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
+
43
57
//| def feed(self):
44
58
//| """Feed the watchdog timer. This must be called regularly, otherwise
45
59
//| the timer will expire."""
Original file line number Diff line number Diff line change 34
34
//|
35
35
//| The `watchdog` module provides support for a Watchdog Timer. This timer will reset the device
36
36
//| 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.
39
39
//|
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
41
41
//| up into a non recoverable state. Once started it cannot be stopped or
42
42
//| reconfigured in any way. After enabling, the application must "feed" the
43
43
//| watchdog periodically to prevent it from expiring and resetting the system.
44
44
//|
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
- //|
49
45
//| Example usage::
50
46
//|
51
47
//| from microcontroller import watchdog as w
You can’t perform that action at this time.
0 commit comments