version
This commit is contained in:
parent
4d83cf9de7
commit
c61d2b8d27
@ -27,6 +27,7 @@ static Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
|
|||||||
static int currentStage = 0;
|
static int currentStage = 0;
|
||||||
static int totalStages = 5;
|
static int totalStages = 5;
|
||||||
static bool systemReady = false;
|
static bool systemReady = false;
|
||||||
|
static bool debugMode = false;
|
||||||
|
|
||||||
// Display update tracking
|
// Display update tracking
|
||||||
static unsigned long lastDisplayUpdate = 0;
|
static unsigned long lastDisplayUpdate = 0;
|
||||||
@ -68,11 +69,17 @@ static void drawFooter() {
|
|||||||
display.setTextSize(1);
|
display.setTextSize(1);
|
||||||
|
|
||||||
if (systemReady) {
|
if (systemReady) {
|
||||||
// Кнопка Menu (правый угол)
|
// Версия (правый угол)
|
||||||
const char* menuBtn = "[MENU]";
|
int textWidth = strlen(FIRMWARE_VERSION) * 6;
|
||||||
int textWidth = strlen(menuBtn) * 6;
|
|
||||||
display.setCursor(SCREEN_WIDTH - textWidth - 2, SCREEN_HEIGHT - 10);
|
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 {
|
} else {
|
||||||
// Версия (правый угол)
|
// Версия (правый угол)
|
||||||
int textWidth = strlen(FIRMWARE_VERSION) * 6;
|
int textWidth = strlen(FIRMWARE_VERSION) * 6;
|
||||||
@ -86,8 +93,9 @@ void oledSetStage(int current, int total) {
|
|||||||
totalStages = total;
|
totalStages = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
void oledSetSystemReady(bool ready) {
|
void oledSetSystemReady(bool ready, bool debug) {
|
||||||
systemReady = ready;
|
systemReady = ready;
|
||||||
|
debugMode = debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool oledIsSystemReady() {
|
bool oledIsSystemReady() {
|
||||||
|
|||||||
@ -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 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();
|
bool oledIsSystemReady();
|
||||||
|
|
||||||
// меню
|
// меню
|
||||||
|
|||||||
@ -58,7 +58,8 @@ void runStartupChecks() {
|
|||||||
delay(DELAY_FOR_STARTUP_CHECKS);
|
delay(DELAY_FOR_STARTUP_CHECKS);
|
||||||
|
|
||||||
// Все проверки пройдены
|
// Все проверки пройдены
|
||||||
oledSetSystemReady(wifiOk); // joyOk
|
// joyOk = true означает debug mode (джойстик найден)
|
||||||
|
oledSetSystemReady(wifiOk, joyOk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user