Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DISCO-L072CZ-LRWAN1_LoRa_PingPong DISCO-L072CZ-LRWAN1_LoRa_PingPong DISCO-L072CZ-LRWAN1_LoRa_PingPong DISCO-L072CZ-LRWAN1_LoRa_USB_Rx ... more
Fork of SX1276Lib by
Revision 85:93832cc77534, committed 2017-08-12
- Comitter:
- Helmut Tschemernjak
- Date:
- Sat Aug 12 19:16:08 2017 +0200
- Parent:
- 84:3428e25c7157
- Child:
- 86:49d19df5bbce
- Commit message:
- The deepsleep does not need to disable the SysTick, it is off
already in suspend mode. It looks like out D21 MCU does not
need to keep the flash on during sleep, we got a newer chip
revision.
Changed in this revision
| Arduino-mbed-APIs/arduino-d21.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Arduino-mbed-APIs/arduino-d21.cpp Fri Aug 11 15:11:08 2017 +0200
+++ b/Arduino-mbed-APIs/arduino-d21.cpp Sat Aug 12 19:16:08 2017 +0200
@@ -375,9 +375,6 @@
if (SerialUSB_active) {
__DSB(); // ensures the completion of memory accesses
__WFI(); // wait for interrupt
- // USB->CTRLA.bit.ENABLE = 0;
- // USB->HOST.CTRLA.reg = 0;
- // USB->HOST.CTRLA.bit.ENABLE &= USB_CTRLA_ENABLE;
} else {
#if 0 // (SAMD20 || SAMD21)
/* Errata: Make sure that the Flash does not power all the way down
@@ -401,22 +398,28 @@
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; // enable SysTick
}
+/*
+ * TODO
+ * Check if we need to disable the USB GCLK->CLKCTRL.reg (see USBCore.cpp)
+ * Check what else we need to disable?
+ */
+
void deepsleep(void)
{
-#if 1 // (SAMD20 || SAMD21)
+#if 0 // (SAMD20 || SAMD21)
/* Errata: Make sure that the Flash does not power all the way down
* when in sleep mode. */
NVMCTRL->CTRLB.bit.SLEEPPRM = NVMCTRL_CTRLB_SLEEPPRM_DISABLED_Val;
#endif
- SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; // disbale SysTick
+ // SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; // disbale SysTick
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; // standby mode
__DSB(); // ensures the completion of memory accesses
__WFI(); // wait for interrupt
- SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; // enable SysTick
+ // SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; // enable SysTick
}
#endif // D21 TCC Timer, sleep, etc-

