Helmut Tschemernjak / SX1276GenericLib

SX1276GenericLib to support sx1276 bassed LoRa modules, including HopeRF RFM95, Murata CMWX1ZZABZ and Semtech SX1276MB1MAS/SX1276MB1LAS modules

Dependents:   STM32L0_LoRa DISCO-L072CZ-LRWAN1_LoRa_PingPong

Fork of SX1276Lib by Semtech

Files at this revision

API Documentation at this revision

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-