From e52a28e54aaca0de02032391e0519272b0d277d8 Mon Sep 17 00:00:00 2001 From: DriftKingTW Date: Mon, 5 Feb 2024 02:11:25 +0800 Subject: [PATCH] perf: move eeprom commit before going sleep --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a2d86bf..21552d3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1051,7 +1051,6 @@ void initKeys() { contentBottom = "@" + currentLayout; EEPROM.write(EEPROM_ADDR_LAYOUT, currentLayoutIndex); - EEPROM.commit(); Serial.println("Key layout loaded: " + currentLayout); } @@ -1515,6 +1514,7 @@ bool getUSBPowerState() { */ void goSleeping() { isGoingToSleep = true; + EEPROM.commit(); delay(1000); // Column pins rtc_gpio_pulldown_dis(GPIO_NUM_5);