From b47c54b5b69af631fe6794c00861b4bbeda1c477 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Wed, 7 Oct 2020 17:52:44 +0800 Subject: [PATCH] keep lora radio totally unpowered when in deep-sleep --- docs/software/gps-todo.txt | 2 -- src/sleep.cpp | 11 ++++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/software/gps-todo.txt b/docs/software/gps-todo.txt index ca8a2781b..5dc8c273e 100644 --- a/docs/software/gps-todo.txt +++ b/docs/software/gps-todo.txt @@ -10,8 +10,6 @@ ublox parsing failure record power measurements and update spreadsheet -make sure we are turning off lora radio in deep sleep - have loop methods return allowable sleep time (from their perspective) increase main cpu sleep time diff --git a/src/sleep.cpp b/src/sleep.cpp index a6753d8ac..d3a550628 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -170,17 +170,18 @@ void doDeepSleep(uint64_t msecToWake) #ifdef TBEAM_V10 if (axp192_found) { + // Obsolete comment: from back when we we used to receive lora packets while CPU was in deep sleep. + // We no longer do that, because our light-sleep current draws are low enough and it provides fast start/low cost + // wake. We currently use deep sleep only for 'we want our device to actually be off - because our battery is + // critically low'. So in deep sleep we DO shut down power to LORA (and when we boot later we completely reinit it) + // // No need to turn this off if the power draw in sleep mode really is just 0.2uA and turning it off would // leave floating input for the IRQ line - // If we want to leave the radio receving in would be 11.5mA current draw, but most of the time it is just waiting // in its sequencer (true?) so the average power draw should be much lower even if we were listinging for packets // all the time. - // axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF); // LORA radio - - // now done by UBloxGPS.cpp - // setGPSPower(false); + axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF); // LORA radio } #endif