Skip to content

Commit

Permalink
nRF52: increased watchdog timeout value [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Apr 28, 2021
1 parent 3f76f99 commit abe5b27
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ GNSS|Model(s)|First appearance|       Status&
---|:---:|:---:|:---:|---
Generic<br>NMEA|[Standalone](https://github.com/lyusupov/SoftRF/wiki/Standalone-Edition)|Q4 2016|![](https://via.placeholder.com/140x70/00A000/000000?text=Good)|&nbsp;
[U-blox](https://en.wikipedia.org/wiki/U-blox)<br>6/7/8|1&nbsp;[**Prime Mark II**](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkII)<br>2&nbsp;[Retro](https://github.com/lyusupov/SoftRF/wiki/Retro-Edition)<br>3&nbsp;[**Uni Edition**](https://github.com/lyusupov/SoftRF/wiki/Uni-Edition)|Q2 2018|![](https://via.placeholder.com/140x70/00A000/000000?text=Good)|&nbsp;
[Hangzhou ZhongKe](http://www.icofchina.com/)<br>AT6558|[**Prime Mark II**](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkII)|Q2 2019|![](https://via.placeholder.com/140x70/00A000/000000?text=Good)|&nbsp;
[Hangzhou ZhongKe](http://www.icofchina.com/)<br>AT6558|[1&nbsp;**Prime Mark II**](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkII)<br>2&nbsp;[**Mini**](https://github.com/lyusupov/SoftRF/wiki/Mini-Edition)<br>3&nbsp;Badge|Q2 2019|![](https://via.placeholder.com/140x70/00A000/000000?text=Good)|&nbsp;
[Sony<br>CXD5603GF](https://www.sony-semicon.co.jp/e/products/lsi/gps/product.html)|[**Dongle**](https://github.com/lyusupov/SoftRF/wiki/Dongle-Edition)|Q4 2019|![](https://via.placeholder.com/140x70/00A000/000000?text=Good)|&nbsp;
[MediaTek](https://en.wikipedia.org/wiki/MediaTek)<br>MT3339|1&nbsp;[**Raspberry**](https://github.com/lyusupov/SoftRF/wiki/Raspberry-Edition)<br>2&nbsp;[**Uni**](https://github.com/lyusupov/SoftRF/wiki/Uni-Edition)|Q3 2020|![](https://via.placeholder.com/140x70/00A000/000000?text=Good)|&nbsp;
[GOKE](http://www.goke.com/en/)<br>GK9501|1&nbsp;[**Mini**](https://github.com/lyusupov/SoftRF/wiki/Mini-Edition)<br>2&nbsp;Badge|Q3 2020|![](https://via.placeholder.com/140x70/00A000/000000?text=Good)|&nbsp;
[GOKE](http://www.goke.com/en/)<br>GK9501|[**Mini**](https://github.com/lyusupov/SoftRF/wiki/Mini-Edition)|Q3 2020|![](https://via.placeholder.com/140x70/00A000/000000?text=Good)|&nbsp;

# Documentation

Expand Down
2 changes: 1 addition & 1 deletion software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ static void nRF52_UATModule_restart()

static void nRF52_WDT_setup()
{
Watchdog.enable(8000);
Watchdog.enable(12000);
}

static void nRF52_WDT_fini()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ Currently supports the following hardware:
* Adafruit Feather M4 (ATSAMD51).
* Arduino Leonardo or other 32u4-based boards (e.g. Adafruit Feather) WITH CAVEAT: USB Serial connection is clobbered on sleep; if sketch does not require Serial comms, this is not a concern. The example sketches all print to Serial and appear frozen, but the logic does otherwise continue to run. You can restore the USB serial connection after waking up using `USBDevice.attach();` and then reconnect to USB serial from the host machine.
* Partial support for Teensy 3.X and LC (watchdog, no sleep).

Adafruit Trinket and other boards using ATtiny MCUs are NOT supported.
* ATtiny 24/44/84 and 25/45/85
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=Adafruit SleepyDog Library
version=1.3.2
version=1.4.0
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino library to use the watchdog timer for system reset and low power sleep.
paragraph=Arduino library to use the watchdog timer for system reset and low power sleep.
category=Other
url=https://github.com/adafruit/Adafruit_SleepyDog
architectures=*
architectures=avr,samd,nrf52,teensy
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ int WatchdogAVR::sleep(int maxPeriodMS) {
// watchdog reset only triggers the interrupt (and wakes from deep sleep)
// and not a full device reset. This is a timing critical section of
// code that must happen in 4 cycles.
WDTCSR |= (1 << WDCE) | (1 << WDE); // Set WDCE and WDE to enable changes.
WDTCSR = wdps; // Set the prescaler bit values.
WDTCSR |= (1 << WDIE); // Enable only watchdog interrupts.
_WD_CONTROL_REG |=
(1 << WDCE) | (1 << WDE); // Set WDCE and WDE to enable changes.
_WD_CONTROL_REG = wdps; // Set the prescaler bit values.
_WD_CONTROL_REG |= (1 << WDIE); // Enable only watchdog interrupts.
// Critical section finished, re-enable interrupts.
sei();

// Disable USB if it exists
// Disable USB if it exists
#ifdef USBCON
USBCON |= _BV(FRZCLK); // freeze USB clock
PLLCSR &= ~_BV(PLLE); // turn off USB PLL
Expand Down

0 comments on commit abe5b27

Please sign in to comment.