pollHallSensor() acted on the raw pin reading immediately, unlike every other
physical-input path in this file (MomentaryButton, pollCardKB()'s own
last-raw edge check). A cheap mechanical reed switch -- one of the two
sensor types the docs explicitly recommend wiring here, alongside a
solid-state Hall IC -- can chatter for a few ms while the magnet crosses the
trigger distance, so a poll every loop() tick during that window could flip
_locked and fire _display->turnOff()/turnOn() repeatedly in that short span:
wasted work on any panel, and a real cost on e-ink where each is a slow
full-panel operation.
A raw reading now has to hold steady for HALL_DEBOUNCE_MS (25ms, same
threshold as MomentaryButton's ISR_DEBOUNCE_MS) before it replaces
_hall_magnet_present and triggers the lock/unlock actions.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Solo's `_solo_dual` env for each board lived inside variants/<board>/, mixed
in with the shared upstream board configs (repeater, room server, plain
companion) that every MeshCore fork carries. Split them out into their own
top-level solo/<board>/ folder -- each still `extends` the board base defined
in its original variants/<board>/platformio.ini, just no longer interleaved
with it file-wise.
- platformio.ini: extra_configs picks up solo/*/platformio.ini alongside
variants/*/platformio.ini.
- build-solo-firmwares.yml: env-discovery grep now scans solo/ instead of
variants/ (the release matrix is unchanged -- same 8 envs, same names).
- pr-build-check.yml: solo/** added to the trigger paths.
- GAT562 30S Mesh Kit: dropped the separate solo_ble env -- solo_dual is a
strict superset (BLE still works, plus USB), and every other board only
ever had one solo build to begin with.
- GAT562 Mesh Watch13: renamed solo_ble -> solo_dual (added DUAL_SERIAL=1) to
match. No comment anywhere recorded whether this board's USB data lines
are actually broken out to a connector -- DUAL_SERIAL compiles and works
over BLE regardless, so worst case the USB half goes unused.
- Removed a dead AUTO_SHUTDOWN_MILLIVOLTS from the three solo envs that set
it (Heltec V3/V4, T-Echo Lite+KeyShield): that macro is only ever read in
the old ui-tiny UITask, never ui-new, which every solo build (these
included) uses -- it did nothing on any of them. Left alone everywhere
else it's set (non-solo companion envs elsewhere use ui-tiny/ui-orig, or
the flag is legitimately read); out of scope here.
- Added docs/solo_features/build_flags.md: every optional -D flag a solo
build understands (GPIO, CardKB/joystick, Hall-sensor cover lock, buzzer/
vibration, GPS switch, display/battery tuning), verified against the code
rather than the existing per-board comments, with what's already baked
into every solo build kept separate from what's opt-in.
- README: doc index + Building from source section link to the new page;
path references to the moved solo files updated to solo/<board>/.
All 8 solo_dual envs rebuilt clean after the move; native test suite (40
cases) unaffected.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
No board in this repo has one built in, and no default pin is assumed
anywhere -- whoever wires a Hall-effect or reed sensor to a free GPIO sets
PIN_HALL_SENSOR (and HALL_ACTIVE_HIGH, for a sensor that pulls the pin high
rather than low on presence) as a build_flag on their own env. Entirely
opt-in and a no-op elsewhere, same pattern as PIN_GPIO1..4/ADC_MULTIPLIER/
CARDKB_ENABLE.
Level-triggered polling (like pollCardKB()) rather than an edge interrupt --
a magnet held near the sensor reads the same way every tick, so the new
pollHallSensor() only acts on the two transitions. Closing locks and blanks
the display with no wake grace (the cover is physically over the screen, so
there's nothing to show); opening unlocks and wakes it, with no key combo
either way. Both are independent of the Auto-lock setting, which is a
timeout, not a physical event.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
LEFT went to the newer message and RIGHT to the older one, which reads
backwards against the page metaphor the "<" / ">" markers set up. Swap it:
LEFT turns back to the older message, RIGHT forward to the newer one, and
the markers follow (they were keyed to the opposite flags).
PREV/NEXT are named in message order, not screen order -- MessagesScreen's
_hist_sel counts newest-first, so PREV is the older message -- so only the
key mapping and the two marker conditions change; the caller side is
untouched. Applies to both the DM and channel fullscreen views, which share
handleInput(). AdminScreen's reply view treats every non-NONE result as
"close", so it is unaffected.
Docs and release notes updated to match.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Follow-up review of f589b9b2 -- five defects in that commit's own changes.
- repeat_scope_only + repeat_extra_scopes were read/written in the MIDDLE of
the prefs stream, beside their repeat_* siblings. loadPrefsInt()'s rd() is a
plain sequential reader gated only on file.available(), with no per-field
versioning, so on any pre-existing file those 25 bytes were taken from the
fields that follow, shifting EVERY later field: repeater profile (incl. a
float freq), track_shared_loc, all of loc_share_*, trail, bot, GPIO modes.
Moved to the struct/file tail, sentinel bumped to 0xC0DE0027 with 0xC0DE0026
marked burned. sizeof stays 2752 (confirmed by build); the tripwire procedure
now spells out the append-only rule that "in struct order" left implicit.
- rebuildRepeatScopes() called getAutoKeyFor() with id 0 for every entry, but
that cache is keyed on the id alone and ignores the name on a hit -- so every
extra scope after the first silently got the first one's key, making the
comma-separated list do nothing. Distinct id per scope now.
- interference_threshold had no load clamp, so an upgrader read 0x23 (35) out
of the old file's sentinel tail instead of 0.
- CMD_SET_DEFAULT_FLOOD_SCOPE wrote default_scope_key without rebuilding the
relay filter, so setting or clearing the scope from the app left the repeater
filtering on the previous key until reboot. The on-device path already did.
- The keyboard preview derived the cursor's row a second time from byte
offsets, disagreeing with the cursor_line the scroll window already computes:
it pinned the cursor to the end of a full line (drawing '_' one character
past the display width) at every wrap boundary. Use cursor_line directly.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Settings > Radio > Scope: type a community/region name on-device (derives
the shared key the same "#name" -> SHA256 way as DEFAULT_FLOOD_SCOPE_NAME),
previously only settable from a connected app.
- Tools > Repeater > Scope only + Extra scopes: only relay flood traffic
matching the device's own scope or a comma-separated list of additional
scopes, without changing what scope the device's own messages send under.
No-op while unconfigured.
- getCADEnabled()/getInterferenceThreshold() were hardcoded off on
companion_radio; CAD now auto-enables whenever RX power-save (duty-cycle)
is active, since the noise floor isn't kept fresh during duty-cycle sleep.
- Message truncation to fit the send frame could split a multi-byte UTF-8
character in half; now stops at the last complete character.
- The default "Public" channel was unconditionally re-added at every boot
before the saved channel list was loaded, so deleting it never stuck.
Only seeded now on a genuinely fresh device (no channel file yet).
- Tools > Nodes read contacts from the wrong starting offset, landing on
internally-reserved bookkeeping slots instead of real contacts -- showed
as blank "Unknown" rows and silently dropped that many real contacts off
the end of the list.
- resetContacts() only cleared the first few reserved slots, not the whole
contact table, contrary to its own comment; only reachable today via
private-key import, fixed to match stated intent regardless.
- Keyboard's multi-line text preview could render the cursor on an empty
line below short typed text instead of right after it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Upstream's version transitively pulls Stream in via NodePrefs.h ->
ConfigSerializer.h -> Arduino.h. Our fork's companion NodePrefs.h is a
plain, manually-serialized struct (no ConfigSerializer), so that chain
doesn't exist here and Stream was undeclared. Include it directly,
matching every other file in this codebase that needs Stream.
The test body itself stays #if 0 (upstream: "cannot be set yet"), so
this only fixes the build, not test coverage.
PlatformIO's SCons flag processing mishandles a two-token "-U MACRO"
in build_flags: it drops the macro name and leaves a bare -U that
swallows the next flag (-Iinclude) as its argument, producing
"macro names must be identifiers" for every companion_radio source
file. The -U was unnecessary anyway -- this whole project builds
with -w, so a later -D silently wins with no warning to suppress.
Verified with a real pio build (not available earlier this session):
Heltec_v3/v4, Cardputer ADV, and T-Echo Lite KeyShield solo envs all
compile clean now.
Home key toggles the keyboard backlight but wasn't going through
checkDisplayOn() like every other TCA8418 key, so it couldn't wake a
sleeping display or extend the auto-off timer.
Also: removed a no-op #elif branch in ST7789Display.cpp (same values as
the #else it duplicated), and ENABLE_SCREENSHOT on the Cardputer ADV
solo env, which does nothing since ST7789Display has no getBuffer().
These views run the same live bearing/distance readout as Compass/Nearby's
navigate mode, which already held GPS awake -- these three didn't, so
duty-cycling could leave them stuck on a stale fix until the next scheduled
wake (up to the configured sleep interval).
Cut restated points, hedge phrases and over-explained asides throughout
-- same information, fewer words per sentence. Also fixed a stale gap
in README's "Building from source" env table (Cardputer ADV and
T-Echo Lite + KeyShield were missing).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Swaps which physical input plays which role on the Heltec V3/V4 wired
joystick: the stick's own fifth "press" contact now drives Enter (your
thumb's already on the stick when you'd confirm something), and the
onboard PRG button -- previously Enter -- becomes Back instead, so it
no longer needs a separate wired button of its own.
Pure pin reassignment in the solo_dual envs, no UITask.cpp changes:
PIN_USER_BTN (Enter) is undef'd and redefined from the base env's PRG
default to the joystick's press pin, and PIN_BACK_BTN takes PRG's old
GPIO0. Scoped to just these two envs -- Wio Tracker L1/GAT562/MeshTiny
share the same UI_HAS_JOYSTICK code path with PRG already correctly
wired as their one true physical button, so their behaviour is
untouched.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Follow-up to the UI casing unification -- the docs quoting these same
option values (Settings' Auto-lock/Buzzer/Full refresh/Low battery/GPS
pwr/Resend rows, Tools' Auto-pause/Mark avg/Auto-save/Auto-Advert/
Heartbeat/GPIO rows, and the clock alarm's Repeat cycle) still showed
the old lowercase/Title-case spellings the screens themselves no
longer use.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
README's Supported Devices table and Flashing section gain the
Cardputer ADV and T-Echo Lite + KeyShield rows/headings (both marked
experimental, matching release-notes.md and the Heltec V3/V4 entries).
external_keyboard.md gets a new section for their built-in TCA8418
keypads -- a separate mechanism from CardKB, not documented anywhere
before. settings_screen.md's GPS pwr row now lists !gps fix among the
things that hold GPS continuously on, matching the actual code.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The prior entries carried full root-cause narrative for each change,
matching this file's older sections -- too dense for what's meant to
be a quick skim. Cut down to what changed and where.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Same reasoning as the Cardputer ADV / T-Echo Lite KeyShield note --
new board support that hasn't had much real-world use yet.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Names the upcoming release and marks the Cardputer ADV / T-Echo Lite
KeyShield board support as experimental, since it's new enough not to
have had much real-world use yet.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The pre-v1.13 "GPS Interval" setting (hidden from Settings ever since,
but its byte kept "for backwards compatibility") used a different option
set than today's duty-cycle presets -- its old 30s choice isn't one of
them. A device that had it set to 30 would load that value straight into
the new duty-cycle scheduler while "GPS pwr" in Settings showed OFF
(gpsDutyIndex() found no matching preset), silently cycling GPS on a
setting nobody could see or change. Unrecognised values now reset to OFF
on load, same as the existing out-of-range clamp this replaces.
Also refreshes MyMesh.h's FIRMWARE_VERSION/FIRMWARE_BUILD_DATE fallback
(only ever used by a `pio run` that bypasses build.sh entirely) -- it
was still "v1.17-solo.0" from 12 tags ago.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Restructures already-shipped v1.24 content out of Unreleased into its
own version section, adds the missing v1.22 heading and a v1.21
separator, documents the M5Stack Cardputer ADV / LilyGO T-Echo Lite
KeyShield board support, and folds in the locked-screen Messages fix,
the GPS duty-cycle races, and the OFF-casing cleanup.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>
Two races between the new GPS duty-cycle scheduler and code that changes
GPS state independently of it:
- gpsDutyCycleLoop() capped every "GPS on" phase at a fixed 60s and would
stop_gps() as soon as a fix went valid, with no awareness of an
in-flight "!gps fix" bot request -- so a fix's own up-to-300s acquire
window (and its 10s averaging phase) could get cut short by the
scheduler shutting GPS off mid-request. MyMesh::isGpsFixPending() now
feeds into UITask's existing "is anything live using GPS right now"
hold, alongside trail/live-share/locator/nearby.
- setSettingValue("gps", ...) (Settings toggle, bot !gps on/off, CLI)
starts/stops GPS directly without resetting the scheduler's own phase
timer, so a manual toggle could land on a stale, already-expired
deadline left over from before -- immediately re-stopping GPS a tick
after turning it on. The phase timer now resets on every external
change, so the next duty-cycle tick re-arms fresh.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
formatDashVal(), the locked-screen counterpart to the unlocked clock's
dashboard rendering, never learned about DASH_MSGS and fell through to
an empty string for it, so Messages was the one CLOCK FIELDS choice
that showed nothing at all once the screen locked.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
SPI pins that are set to -1 cause OOB reads on NRF52. The unused Serial2 pin definitions were removed to avoid potential issues with the Uart framework.
Setting SPI pins to values that are OOB of the g_ADigitalPinMap[] array causes OOB reads. This variant.h has pin 0 as 0xFF which passes through as NRFX_SPIM_PIN_NOT_USED.