Commit Graph
5 Commits
Author SHA1 Message Date
Kaj Schittecat 55b874190c Merge PR #832: m9: guard 3% battery switch-off against LoRa TX sag and 20 s hold 2026-11-14 15:47:21 +01:00
Kaj SchittecatandClaude Opus 5.5 9520e2e498 m9: the USB power sense on GPIO1 is active-LOW (#842, #853)
#826 read 5V_TEST as active-HIGH, so since beta_103 every ThinkNode M9
showed charging on battery and battery on USB. The screensaver stayed up
on battery as if on power, and the 3% switch-off never fired on battery.
GPIO1 reads LOW while USB power is present, as in Meshtastic's M9
variant (EXT_PWR_DETECT 1, EXT_PWR_DETECT_VALUE LOW).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:34:25 +01:00
TinkeringDao cc6ae5900a fix(m9): prevent TX sag and 20s publish hold from triggering false 3% shutoff
- On HAS_THINKNODE_M9, only snap batteryMvSampled()'s EMA on hardware
  charger state transitions (GPIO1 5V_TEST / GPIO8 DONE#) rather than
  >70 mV voltage steps, so a transient IR drop during a +22 dBm LR1110
  transmission is smoothed by the EMA instead of snapping downward.
- Sample batteryMvSampled() directly in pagerLowBatteryTick() rather
  than batteryMvSmoothed()'s 20 s held value, since the 3-read (6 s)
  debounce plus 10 s countdown (16 s total) is shorter than the 20 s
  hold window and would otherwise repeat a single sagged reading.

Signed-off-by: TinkeringDao <203040288+TinkeringDao@users.noreply.github.com>
2026-11-12 02:14:17 +01:00
Kaj SchittecatandClaude Opus 5.5 4946f52d46 host tests: test_m9_board reads GPS Compass 1.1, where the heading fix lives
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:21:26 +01:00
TinkeringDao 63f40f27ed fix(m9): hardware init, charger sense, SD clock, IMU/compass, and LR1110 wrapper
Scope ThinkNode M9 board support and UI integration cleanly off main:
- variants/thinknode_m9: move M9LR1110Wrapper.h under variants/thinknode_m9 (matching Pager's CustomLR1121Wrapper.h pattern without shadowing core RadioLibWrappers.h) and calibrate LR1110 from STDBY_RC per Semtech SWDR001
- variants/thinknode_m9: 3-state USB VBUS + LGS4056HDA DONE# charger sense, ADC2 Wi-Fi contention filter, 20 MHz SD SPI clock, SPI CS pre-park, GPIO46 key LED mirror, deep-sleep wake/isolation, QMI8658A IMU gestures, MMC5603NJ auto-SR heading, and L76K GPS wake/ESD pin release
- src/main.cpp, DataStore.cpp, MyMesh.cpp, HardwareRtcClock.cpp, WadaNmeaLocationProvider.h, UITask.cpp: gate all M9/LR1110 paths under HAS_THINKNODE_M9 / HAS_M9_IMU / HAS_M9_KEYBOARD / USE_LR1110 so non-M9 targets retain identical RAM, flash, and SPIFFS behavior
- deploy/apps/lang/*.lang & test/test_m9_board.cpp: add .lang entries (leaving generated i18n_builtin.h untouched) and host unit tests for M9 board peripherals
2026-11-11 14:07:47 +01:00