fix(locator): add a way to clear the active target

setTarget() always set locator_has_target=1; there was no path back to
"none" once a target was picked. Add a synthetic "(none)" entry that's
always first in the target picker/cycle set, backed by new
UITask::clearTarget().
This commit is contained in:
MarekZegare4
2026-06-24 22:52:19 +02:00
parent 15b89e2827
commit c726b2bb35
3 changed files with 23 additions and 7 deletions
@@ -2375,6 +2375,12 @@ void UITask::setTargetNow(uint8_t kind, const uint8_t* key, int32_t lat, int32_t
showAlert("Target set", 1200);
}
void UITask::clearTarget() {
if (!_node_prefs) return;
_node_prefs->locator_has_target = 0;
resetLocator();
}
// Homing beeper: while armed with a target and inside the radius, emit a short
// tick whose interval shrinks linearly with distance — slow at the edge, rapid
// near the centre. Polls distance a few times a second; silent outside the