Przeglądaj źródła

Forcing sim808 to powerOff before deep sleep regardless of the current state

tags/v1.4.3^2
Bertrand Lemasle 6 lat temu
rodzic
commit
860283aff1
1 zmienionych plików z 3 dodań i 1 usunięć
  1. +3
    -1
      src/MainUnit.cpp

+ 3
- 1
src/MainUnit.cpp Wyświetl plik

@@ -13,7 +13,9 @@ namespace mainunit {
namespace details {
void prepareSleep() {
hardware::sim808::powerOff(); //forcing power off, regardless of the counts and current use
hardware::sim808::simSerial.end(); //avoid woke up by SoftwareSerial interrupt
delay(5); //ensure log messages have been printed out
}
@@ -44,8 +46,8 @@ namespace mainunit {
#define CURRENT_LOGGER_FUNCTION "deepSleep"
NOTICE_FORMAT("%ds", seconds);
interruptIn(seconds);
details::prepareSleep();
interruptIn(seconds);
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
details::wokeUp();
}


Ładowanie…
Anuluj
Zapisz