From c61d2b8d278c298dfb94bfeadc96f3e4be7c36ec Mon Sep 17 00:00:00 2001 From: cheykrym Date: Mon, 30 Mar 2026 05:24:12 +0300 Subject: [PATCH] version --- src/core/display/body/body.cpp | 22 +++++++++++++++------- src/core/display/body/body.h | 2 +- src/main.cpp | 3 ++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/core/display/body/body.cpp b/src/core/display/body/body.cpp index c0e782b..37ef0c7 100644 --- a/src/core/display/body/body.cpp +++ b/src/core/display/body/body.cpp @@ -27,6 +27,7 @@ static Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); static int currentStage = 0; static int totalStages = 5; static bool systemReady = false; +static bool debugMode = false; // Display update tracking static unsigned long lastDisplayUpdate = 0; @@ -63,16 +64,22 @@ static void drawHeader() { static void drawFooter() { // Нижняя строка (разделитель) // display.drawLine(0, SCREEN_HEIGHT - 12, SCREEN_WIDTH, SCREEN_HEIGHT - 12, SSD1306_WHITE); - + display.setTextColor(SSD1306_WHITE); display.setTextSize(1); - + if (systemReady) { - // Кнопка Menu (правый угол) - const char* menuBtn = "[MENU]"; - int textWidth = strlen(menuBtn) * 6; + // Версия (правый угол) + int textWidth = strlen(FIRMWARE_VERSION) * 6; display.setCursor(SCREEN_WIDTH - textWidth - 2, SCREEN_HEIGHT - 10); - display.print(menuBtn); + display.print(FIRMWARE_VERSION); + + // DEBUG режим Кнопка Menu (левый угол) + if (debugMode) { + const char* menuBtn = "[MENU]"; + display.setCursor(2, SCREEN_HEIGHT - 10); + display.print(menuBtn); + } } else { // Версия (правый угол) int textWidth = strlen(FIRMWARE_VERSION) * 6; @@ -86,8 +93,9 @@ void oledSetStage(int current, int total) { totalStages = total; } -void oledSetSystemReady(bool ready) { +void oledSetSystemReady(bool ready, bool debug) { systemReady = ready; + debugMode = debug; } bool oledIsSystemReady() { diff --git a/src/core/display/body/body.h b/src/core/display/body/body.h index e4d8a37..663b02a 100644 --- a/src/core/display/body/body.h +++ b/src/core/display/body/body.h @@ -18,7 +18,7 @@ void oledSetStage(int current, int total); void oledShowMain(const char* line1, const char* line2, const char* line3, const char* line4); // состояние системы -void oledSetSystemReady(bool ready); +void oledSetSystemReady(bool ready, bool debugMode = false); bool oledIsSystemReady(); // меню diff --git a/src/main.cpp b/src/main.cpp index c9dd5fb..4d7c299 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,7 +58,8 @@ void runStartupChecks() { delay(DELAY_FOR_STARTUP_CHECKS); // Все проверки пройдены - oledSetSystemReady(wifiOk); // joyOk + // joyOk = true означает debug mode (джойстик найден) + oledSetSystemReady(wifiOk, joyOk); } void setup() {