mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-03 10:46:12 +00:00
refactor(bot,ui): dedupe bot token parsing, drop redundant turnOn, fix comment
Post-review cleanups, no behaviour change: - botScanCommands() parsed the command name and its two args with three near-identical read-token loops; extracted a single readToken() lambda. - Fn+Esc lock branch turned the display on twice (the unlock arm repeated what the branch head already did); dropped the redundant call. - setGpioMode()'s comment said "Cycle" (cycling lives in GpioScreen); now describes what it actually does — set a specific mode + persist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2146,7 +2146,6 @@ void UITask::pollCardKB() {
|
||||
if (_locked) {
|
||||
_lock_wake_until = millis() + 2000;
|
||||
} else {
|
||||
if (_display && !_display->isOn()) _display->turnOn();
|
||||
uint32_t aoff = autoOffMillis();
|
||||
if (aoff > 0) _auto_off = millis() + aoff;
|
||||
}
|
||||
@@ -3159,8 +3158,10 @@ static uint16_t readAnalogMv(uint32_t psel) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Cycle a user GPIO pin's mode (Off/In/Out-low/Out-high), apply it to the
|
||||
// actual pin, and persist. Called by GpioScreen on Enter.
|
||||
// Set a user GPIO pin to a specific mode (0=Off 1=In 2=Out-low 3=Out-high
|
||||
// 4=Analog), apply it to the actual pin, and persist. The Off->In->Out->...
|
||||
// cycling itself lives in GpioScreen; the bot's !gpioN on/off and boot
|
||||
// restore also route through here.
|
||||
void UITask::setGpioMode(int idx, uint8_t mode) {
|
||||
#if defined(PIN_GPIO1)
|
||||
if (!_node_prefs) return;
|
||||
|
||||
Reference in New Issue
Block a user