Switch the name of the disallow sleep flag

This commit is contained in:
Nacho 2026-05-29 02:17:32 +02:00
parent 79d60e7201
commit 915c5cd2a7
2 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ build_flags =
-DBOARD_HAS_PSRAM
-DARDUINO_USB_CDC_ON_BOOT=0
-DDEV_UNIT
-DALLOW_SLEEP
-DDISALLOW_SLEEP
-DDEBUG
upload_port = COM8
@ -50,9 +50,8 @@ build_flags =
-DBOARD_HAS_PSRAM
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DALLOW_SLEEP
-DDISALLOW_SLEEP
-DDEV_UNIT
-DDEBUG
board_build.partitions = default.csv
lib_deps = TFT_eSPI, fbiego/ESP32Time@^2.0.6, electroniccats/MPU6050@^1.4.3

View File

@ -1,4 +1,5 @@
#include "defs/defs.h"
#include "defs/sounds.h"
#include "defs/chara_data.h"
#include "defs/screen_defs.h"
#include "buttons.h"
@ -17,7 +18,7 @@ bool k4_prev = HIGH;
void buttons_checkInactivity() {
uint64_t currentTime = esp_timer_get_time();
if (currentTime - lastPressedButtonTime > INACTIVITY_THRESHOLD_TIME_US && !screenOff && !alwaysOnEnabled) {
#ifdef ALLOW_SLEEP
#ifdef DISALLOW_SLEEP
digitalWrite(BL_PIN, LOW);
screenKey = OFF_SCREEN;
#endif
@ -42,7 +43,7 @@ uint8_t buttons_getPressedButtons() {
);
if (retV != 0) {
tone(SPK_PIN, BEEP_FREQ_HZ, BEEP_LEN_MS);
sound_playMelody(SOUND_BUTTON_BEEP, SOUND_NOTE_COUNT(SOUND_BUTTON_BEEP));
lastPressedButtonTime = esp_timer_get_time();
inactive = false;
screenOff = false;