mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 17:32:18 +00:00
Fix leaving display on in deep sleep.
We shutoff screen immediately, rather than waiting for our loop call()
This commit is contained in:
parent
efc239533c
commit
ef831a0b4d
@ -100,7 +100,14 @@ class Screen : public PeriodicTask
|
|||||||
void setup();
|
void setup();
|
||||||
|
|
||||||
/// Turns the screen on/off.
|
/// Turns the screen on/off.
|
||||||
void setOn(bool on) { enqueueCmd(CmdItem{.cmd = on ? Cmd::SET_ON : Cmd::SET_OFF}); }
|
void setOn(bool on)
|
||||||
|
{
|
||||||
|
if (!on)
|
||||||
|
handleSetOn(
|
||||||
|
false); // We handle off commands immediately, because they might be called because the CPU is shutting down
|
||||||
|
else
|
||||||
|
enqueueCmd(CmdItem{.cmd = on ? Cmd::SET_ON : Cmd::SET_OFF});
|
||||||
|
}
|
||||||
|
|
||||||
/// Handles a button press.
|
/// Handles a button press.
|
||||||
void onPress() { enqueueCmd(CmdItem{.cmd = Cmd::ON_PRESS}); }
|
void onPress() { enqueueCmd(CmdItem{.cmd = Cmd::ON_PRESS}); }
|
||||||
|
Loading…
Reference in New Issue
Block a user