mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-08-28 05:24:32 +00:00
Fix screen wake on idle, add regional frequency presets and Hz input
Screen idle: - Remove powerMgr.activity() from radio yield callback — screen no longer wakes on LoRa RX, auto-announce, or RSSI polls - Add [POWER] state transition logging for on-device diagnostics Radio regions: - Add 4-region system: Americas (915), Europe (868), Australia (915), Asia (923) with timezone-to-region mapping - Region picker in Radio settings (always visible) - Presets now apply region-appropriate frequency + modulation params - Timezone change warns if it suggests a different radio region Frequency input (developer mode): - Hz-precision input (9 digits) displayed as MHz with trimmed decimals - Left/right arrows step by 125 kHz, digit keys for direct entry - Inspired by @strijar in https://github.com/ratspeak/ratdeck/pull/12
This commit is contained in:
+10
-2
@@ -683,13 +683,12 @@ void setup() {
|
||||
ui.statusBar().setTransportMode("RatDeck");
|
||||
ui.lvStatusBar().setTransportMode("RatDeck");
|
||||
|
||||
// Keep UI alive during blocking radio TX (endPacket wait loop)
|
||||
// Keep LVGL responsive during blocking radio operations (if screen is on)
|
||||
// Re-entrancy guard prevents nested lv_timer_handler() calls
|
||||
radio.setYieldCallback([]() {
|
||||
static bool inYield = false;
|
||||
if (inYield) return;
|
||||
inYield = true;
|
||||
powerMgr.activity(); // Keep screen alive during TX
|
||||
if (powerMgr.isScreenOn()) {
|
||||
lv_timer_handler();
|
||||
}
|
||||
@@ -847,6 +846,15 @@ void setup() {
|
||||
gps.setPosixTZ(tz);
|
||||
}
|
||||
#endif
|
||||
// Warn if timezone suggests a different radio region
|
||||
uint8_t tzRegion = TIMEZONE_TABLE[tzIdx].radioRegion;
|
||||
if (tzRegion != userConfig.settings().radioRegion) {
|
||||
char msg[64];
|
||||
snprintf(msg, sizeof(msg), "TZ suggests %s region", REGION_LABELS[tzRegion]);
|
||||
ui.lvStatusBar().showToast(msg, 3000);
|
||||
Serial.printf("[REGION] Timezone suggests %s, current is %s\n",
|
||||
REGION_LABELS[tzRegion], REGION_LABELS[userConfig.settings().radioRegion]);
|
||||
}
|
||||
goHome();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user