now that light-sleep kinda works, use deep-sleep far more rarely

1.2-legacy
geeksville 2020-02-21 11:32:33 -08:00
rodzic 20461807f3
commit 3df81682b3
4 zmienionych plików z 9 dodań i 5 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ Items to complete before the first alpha release.
* implement CustomRF95::canSleep
* document rules for sleep wrt lora/bluetooth/screen/gps. also: if I have text messages (only) for the phone, then give a few seconds in the hopes BLE can get it across before we have to go back to sleep.
* make gps prevent light sleep if we are waiting for data
* wake from light sleep as needed for our next scheduled periodic task (needed for gps position broadcasts etc)
* turn bluetooth off based on our sleep policy
* if the phone doesn't read fromradio mailbox within X seconds, assume the phone is gone and we can stop queing location msgs
@ -45,6 +46,7 @@ Items to complete before the first beta release.
* How do avalanche beacons work? Could this do that as well? possibly by using beacon mode feature of the RF95?
* use std::map<NodeInfo*, std::string> in node db
* make a HAM build: yep - that's a great idea. I'll add it to the TODO. should be pretty painless - just a new frequency list, a bool to say 'never do encryption' and use hte callsign as that node's unique id. -from Girts
* add frequency hopping
# Low power consumption tasks
General ideas to hit the power draws our spreadsheet predicts. Do the easy ones before beta, the last 15% can be done after 1.0.

Wyświetl plik

@ -66,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// If not defined, we will wait for lock forever
#define MINWAKE_MSECS (10 * 60 * 1000) // stay awake a long time (30 mins) for debugging
#define MINWAKE_MSECS (60 * 60 * 1000) // stay awake a long time (30 mins) for debugging - FIXME, change per the TBD sleep rules doc
// #define MINWAKE_MSECS (30 * 1000) // Wait after every boot for GPS lock (may need longer than 5s because we turned the gps off during deep sleep)
// -----------------------------------------------------------------------------

Wyświetl plik

@ -493,7 +493,7 @@ void setup()
}
setBluetoothEnable(false);
setCPUFast(true); // FIXME, switch to low speed now
setCPUFast(false); // 80MHz is fine for our slow peripherals
}
uint32_t ledBlinker()

Wyświetl plik

@ -554,6 +554,8 @@ void Screen::setup()
//ui.setActiveSymbol(activeSymbol);
//ui.setInactiveSymbol(inactiveSymbol);
ui.setTimePerTransition(300); // msecs
// You can change this to
// TOP, LEFT, BOTTOM, RIGHT
ui.setIndicatorPosition(BOTTOM);
@ -593,7 +595,7 @@ void Screen::setup()
/// Turn off the screen this many ms after last press or wake
#define SCREEN_SLEEP_MS (60 * 1000)
#define TRANSITION_FRAMERATE 60 // fps
#define TRANSITION_FRAMERATE 30 // fps
#define IDLE_FRAMERATE 10 // in fps
static uint32_t targetFramerate = IDLE_FRAMERATE;
@ -637,7 +639,7 @@ void Screen::doTask()
// Once we finish showing the bootscreen, remove it from the loop
if (showingBootScreen)
{
if (millis() > 5 * 1000) // we show the boot screen for a few seconds only
if (millis() > 3 * 1000) // we show the boot screen for a few seconds only
{
showingBootScreen = false;
screen_set_frames();
@ -665,7 +667,7 @@ void Screen::doTask()
// If we are scrolling we need to be called soon, otherwise just 1 fps (to save CPU)
// We also ask to be called twice as fast as we really need so that any rounding errors still result
// with the correct framerate
setPeriod(1000 / targetFramerate / 2);
setPeriod(1000 / targetFramerate);
}
// Show the bluetooth PIN screen