Skip to content

Commit

Permalink
perf: move eeprom commit before going sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
DriftKingTW committed Feb 4, 2024
1 parent 2f71ede commit e52a28e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,6 @@ void initKeys() {
contentBottom = "@" + currentLayout;

EEPROM.write(EEPROM_ADDR_LAYOUT, currentLayoutIndex);
EEPROM.commit();
Serial.println("Key layout loaded: " + currentLayout);
}

Expand Down Expand Up @@ -1515,6 +1514,7 @@ bool getUSBPowerState() {
*/
void goSleeping() {
isGoingToSleep = true;
EEPROM.commit();
delay(1000);
// Column pins
rtc_gpio_pulldown_dis(GPIO_NUM_5);
Expand Down

0 comments on commit e52a28e

Please sign in to comment.