mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
fix(ui): unify "off" casing to OFF across all screens
Every genuine on/off toggle already agreed on ON/OFF, but the disabled point of several value pickers didn't: Settings' LowBat/GPS pwr/e-ink full-refresh options and the auto-advert interval showed lowercase "off", GPIO's mode row showed "Off" right above its own State row's "OFF", and the GPS-averaging/trail-autopause pickers showed "Off" where the alarm-repeat picker already said "OFF". All display-only label arrays, no behaviour change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
c045df1da5
commit
721f892307
@@ -471,7 +471,7 @@ struct NodePrefs { // persisted to file
|
||||
return S[idx < GPS_AVG_COUNT ? idx : 0];
|
||||
}
|
||||
static const char* gpsAvgLabel(uint8_t idx) {
|
||||
static const char* L[GPS_AVG_COUNT] = { "Off", "5s", "10s", "30s" };
|
||||
static const char* L[GPS_AVG_COUNT] = { "OFF", "5s", "10s", "30s" };
|
||||
return L[idx < GPS_AVG_COUNT ? idx : 0];
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ struct NodePrefs { // persisted to file
|
||||
return S[idx < TRAIL_AUTOPAUSE_COUNT ? idx : 0];
|
||||
}
|
||||
static const char* trailAutoPauseLabel(uint8_t idx) {
|
||||
static const char* L[TRAIL_AUTOPAUSE_COUNT] = { "Off", "1m", "2m", "5m" };
|
||||
static const char* L[TRAIL_AUTOPAUSE_COUNT] = { "OFF", "1m", "2m", "5m" };
|
||||
return L[idx < TRAIL_AUTOPAUSE_COUNT ? idx : 0];
|
||||
}
|
||||
// Movement under this many metres counts as "stationary" for auto-pause.
|
||||
|
||||
@@ -69,4 +69,4 @@ public:
|
||||
};
|
||||
|
||||
const uint32_t AutoAdvertScreen::OPTS[AutoAdvertScreen::OPT_COUNT] = { 0, 30, 60, 120, 300, 600, 1800, 3600 };
|
||||
const char* AutoAdvertScreen::OPT_LABELS[AutoAdvertScreen::OPT_COUNT] = { "off", "30s", "1min", "2min", "5min", "10min", "30min", "1h" };
|
||||
const char* AutoAdvertScreen::OPT_LABELS[AutoAdvertScreen::OPT_COUNT] = { "OFF", "30s", "1min", "2min", "5min", "10min", "30min", "1h" };
|
||||
|
||||
@@ -69,12 +69,12 @@ class GpioScreen : public UIScreen {
|
||||
else strncpy(buf, "Analog", n);
|
||||
break;
|
||||
}
|
||||
default: strncpy(buf, "Off", n); break;
|
||||
default: strncpy(buf, "OFF", n); break;
|
||||
}
|
||||
buf[n - 1] = '\0';
|
||||
}
|
||||
|
||||
// Off -> Input -> Output (starts OFF) -> [Analog, GPIO1/GPIO2 only] -> Off
|
||||
// OFF -> Input -> Output (starts OFF) -> [Analog, GPIO1/GPIO2 only] -> OFF
|
||||
// ... one press per step. Output's ON/OFF split lives on the State row
|
||||
// below, not in this cycle; Analog is read-only so it has no State row.
|
||||
void cycleMode(int pin) {
|
||||
@@ -84,9 +84,9 @@ class GpioScreen : public UIScreen {
|
||||
if (mode == 0) next = 1;
|
||||
else if (mode == 1) next = 2;
|
||||
else if (mode == 2 || mode == 3) next = analog_ok ? 4 : 0;
|
||||
else next = 0; // was Analog -> back to Off
|
||||
else next = 0; // was Analog -> back to OFF
|
||||
_task->setGpioMode(pin + 1, next);
|
||||
const char* name = (next == 0) ? "Off" : (next == 1) ? "Input" : (next == 2) ? "Output" : "Analog";
|
||||
const char* name = (next == 0) ? "OFF" : (next == 1) ? "Input" : (next == 2) ? "Output" : "Analog";
|
||||
char msg[24];
|
||||
snprintf(msg, sizeof(msg), "GPIO%d: %s", pin + 1, name);
|
||||
_task->showAlert(msg, 800);
|
||||
|
||||
@@ -114,7 +114,7 @@ class SettingsScreen : public UIScreen {
|
||||
static const int LOW_BAT_COUNT = 7;
|
||||
#if ENV_INCLUDE_GPS == 1
|
||||
// GPS duty-cycle sleep window: how long GPS naps between fix acquisitions.
|
||||
// "off" (0) keeps it continuously on, today's behaviour. Backed by
|
||||
// "OFF" (0) keeps it continuously on, today's behaviour. Backed by
|
||||
// NodePrefs::gps_interval, seconds.
|
||||
static const uint32_t GPS_DUTY_OPTS[6];
|
||||
static const char* GPS_DUTY_LABELS[6];
|
||||
@@ -1084,14 +1084,14 @@ const uint16_t SettingsScreen::AUTO_OFF_OPTS[5] = { 5, 15, 30, 60, 0 };
|
||||
const char* SettingsScreen::AUTO_OFF_LABELS[5] = { "5s", "15s", "30s", "60s", "never" };
|
||||
#endif
|
||||
const uint16_t SettingsScreen::LOW_BAT_OPTS[7] = { 0, 3000, 3100, 3200, 3300, 3400, 3500 };
|
||||
const char* SettingsScreen::LOW_BAT_LABELS[7] = { "off", "3.0V", "3.1V", "3.2V", "3.3V", "3.4V", "3.5V" };
|
||||
const char* SettingsScreen::LOW_BAT_LABELS[7] = { "OFF", "3.0V", "3.1V", "3.2V", "3.3V", "3.4V", "3.5V" };
|
||||
#if ENV_INCLUDE_GPS == 1
|
||||
const uint32_t SettingsScreen::GPS_DUTY_OPTS[6] = { 0, 60, 300, 900, 1800, 3600 };
|
||||
const char* SettingsScreen::GPS_DUTY_LABELS[6] = { "off", "1 min", "5 min", "15 min", "30 min", "1 h" };
|
||||
const char* SettingsScreen::GPS_DUTY_LABELS[6] = { "OFF", "1 min", "5 min", "15 min", "30 min", "1 h" };
|
||||
#endif
|
||||
const char* SettingsScreen::BATT_DISPLAY_LABELS[3] = { "icon", "%", "V" };
|
||||
const char* SettingsScreen::SOUND_LABELS[4] = { "built-in", "M1", "M2", "None" };
|
||||
const char* SettingsScreen::AD_SCOPE_LABELS[2] = { "All", "Zero-hop" };
|
||||
#if FEAT_FULL_REFRESH_SETTING
|
||||
const char* SettingsScreen::EINK_FULL_REFRESH_LABELS[5] = { "off", "5", "10", "20", "30" };
|
||||
const char* SettingsScreen::EINK_FULL_REFRESH_LABELS[5] = { "OFF", "5", "10", "20", "30" };
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user