summaryrefslogtreecommitdiff
path: root/shared-bindings/watchdog
AgeCommit message (Collapse)Author
2020-08-21Add more "extern" declarations for gcc10 compatScott Shawcroft
gcc has tightened the restrictions on forward declarations that lack "extern". Fix them up.
2020-07-27Fix several type hintsTaku Fukada
2020-07-24Add and correct some type hintsTaku Fukada
2020-07-03Fixed init formattingdherrada
2020-07-03Made most of the requested changesdherrada
2020-07-03Added type hints to watchdogdherrada
2020-07-02Removed all 'self, )'dherrada
2020-05-27Remove NONE from mode enum and doc tweaksScott Shawcroft
2020-05-27watchdog: use common_hal_watchdog_* patternSean Cross
This pulls all common functionality into `shared-bindings` and keeps platform-specific code inside `nrf`. Additionally, this performs most validation in the `shared-bindings` site. The only validation that occurs inside platform-specific `common-hal` code is related to timeout limits that are platform-specific. Additionally, all documentation is now inside the `shared-bindings` directory. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdog: support catching the timeoutSean Cross
With this patch, the exception can now be caught: import microcontroller import watchdog import time wdt = microcontroller.watchdog wdt.timeout = 5 while True: wdt.mode = watchdog.WatchDogMode.RAISE print("Starting loop -- should exit after five seconds") try: while True: time.sleep(10) # pass # This also works for a spinloop except watchdog.WatchDogTimeout as e: print("Watchdog Expired (PASS)") except Exception as e: print("Other exception (FAIL)") print("Exited loop") This prints: Starting loop -- should exit after five seconds Watchdog Expired (PASS) Starting loop -- should exit after five seconds Watchdog Expired (PASS) Starting loop -- should exit after five seconds Watchdog Expired (PASS) Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdog: move timeout exception to shared-bindingsSean Cross
Make this exception globally available to all platforms that have enabled the watchdog timer. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdogtimer: refactor to new apiSean Cross
This refactors the WatchDogTimer API to use the format proposed in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632268227 Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdog: fix documentation build errorSean Cross
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdog: rename module from `wdt` and move to `microcontroller`Sean Cross
This also places it under the `microcontroller` object. Signed-off-by: Sean Cross <sean@xobs.io>