Save to NVS on suspend and wake-up
This commit is contained in:
parent
10a5973361
commit
a3799b02a0
|
@ -26,12 +26,14 @@ int main(void)
|
|||
if(LightSensor_RelativeBrightness == 0 && !powered_down)
|
||||
{
|
||||
LED_Suspend();
|
||||
NVS_Save();
|
||||
powered_down = true;
|
||||
}
|
||||
if(powered_down && LightSensor_RelativeBrightness > 0)
|
||||
{
|
||||
LED_WakeUp();
|
||||
powered_down = false;
|
||||
NVS_Save();
|
||||
LED_WakeUp();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue