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:
DeFiDude
2026-03-28 14:06:31 -06:00
parent b2fcfe526e
commit a77fb594a2
7 changed files with 94 additions and 28 deletions
+10 -2
View File
@@ -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();
});