Commit Graph
24 Commits
Author SHA1 Message Date
tthandClaude Opus 5.5 5f63ba303c Merge upstream/dev (13 commits) [upstream-sync]
pub-release / release (push) Successful in 23m45s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 00:28:06 +01:00
agessaman 09ee2e1223 kiss_modem: answer FEM requests strictly in arrival order
A second SetFemState sent while the first was held for a TX got an
immediate TxBusy, which reached the host before the first request's
reply. With no request IDs, the host could not tell which Set failed.

FEM requests now go through a small ordered queue (Set, Get and their
error replies). Sets still wait for TxDone to be queued and apply
once. Each reply is kept until it can be queued. Capability checks
happen in order at processing time. Only an overflow (more than 4
waiting) replies TxBusy immediately.
2026-09-23 17:41:14 -07:00
agessaman 7652ec5c26 kiss_modem: reach FEM gain through the board's radio.fem CLI commands
Boards own their FEM control through handleCommand() ("get/set
radio.fem.rxgain|txgain"). Use that instead of a parallel set of FEM
virtuals on MainBoard, so any board that implements the commands works
in KISS with no extra code.

- Remove the six FEM virtuals from MainBoard and the board overrides.
- KissModem talks to the board in one adapter. A gain counts as
  controllable only if "get" replies exactly "> on" or "> off". "set"
  is checked by reading the state back, never by its reply wording.
- SetFemState always replies with the read-back state once the
  requested bits pass the capability check.
- Guard the boards' prefs writes against a NULL store. KISS attaches
  no prefs, so "set radio.fem.*" would dereference NULL.
- Wio Tracker L1 1W TX gain is exposed again, matching its CLI.
2026-09-23 17:31:20 -07:00
agessaman 8cefda9612 kiss_modem: add radio chip boosted RX gain control
Add SetRxBoostedGain (0x20) / GetRxBoostedGain (0x21, reply 0xA1) and
capability bit 3, the KISS equivalent of the radio.rxgain CLI setting.
It is separate from FEM RX gain; a board may support either or both.

- Support is declared by the driver via a new
  RadioLibWrapper::supportsRxBoostedGain() (SX1262, SX1268, LLCC68,
  LR1110, LR1121, LR2021), so nothing is written to the radio at boot.
- The set is refused with TxBusy during TX or while host output is
  backed up. Otherwise any completed RX packet is delivered first,
  because some drivers (LR2021) drop to standby to apply the gain.
- The reply always carries the state read back from the radio.

Driver fixes found along the way, which also affect the radio.rxgain
CLI in regular firmware:
- CustomLR2021 never updated its cached gain state, so the getter
  always reported off. It now tracks the applied level per RX path
  and rolls RadioLib's cached level back if a write fails.
- CustomLR1110/LR1121 cached the requested state even when the write
  failed.
- lr11x0ResetAGC only reapplied the gain when RX_BOOSTED_GAIN was
  defined, so a runtime setting was lost on the next AGC reset.
2026-09-23 16:59:39 -07:00
agessaman 0d648e4a18 kiss_modem: keep FEM replies ordered and deliverable; drop Wio FEM control
- Wio Tracker L1 1W no longer advertises TX gain control: its setter
  drives LORA_PWR_EN, the shared LDO for the SX1262 and the PA, so
  "gain off" would power down the radio.
- A SetFemState that arrives mid-TX is now applied after TxDone is
  queued, so its reply follows TxDone.
- SetFemState replies (immediate or deferred) are retained until they
  fit in the host output queue instead of being dropped, so a change
  that took effect is always acknowledged.
- GetFemState replies queue behind an outstanding SetFemState reply;
  a further SetFemState returns TxBusy until it clears.
2026-09-23 16:11:29 -07:00
agessaman fa18757f2c kiss_modem: add AGC reset interval and FEM gain control (protocol v2)
Add SetHardware sub-commands so a host can probe and configure
per-board RF front-end settings:

- GetCapabilities (0x1B): uint32 feature bits (AGC, FEM RX, FEM TX)
- Set/GetAgcResetInterval (0x1C/0x1D): 0-1020 s, 4 s resolution,
  0 disables; default stays 30 s
- Set/GetFemState (0x1E/0x1F): apply/value masks for FEM RX (LNA)
  and TX (PA) gain; all-or-nothing, Unsupported (0x08) if any
  requested bit is not controllable on this board

The AGC scheduler moves from main.cpp into KissModem so it is
configurable and unit-tested. FEM changes that arrive mid-TX are
deferred until the packet ends, since board setters drive FEM pins
directly.

MainBoard gains virtual FEM hooks (canControl/set/is for LNA and PA
gain). Boards that already implemented these methods privately now
expose them as overrides: Heltec V4, V4 R8, T096, Tracker V2,
Station G3 and Wio Tracker L1 1W.

KISS_FIRMWARE_VERSION bumped to 2.
2026-09-23 15:43:01 -07:00
tthandClaude Opus 5 5fe3367aaa fix(kiss): off-by-one v clampu delky jmena zarizeni
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 18:19:40 +02:00
tthandClaude Opus 5 26ab83a4b7 fix(kiss): host testy se od 1. 9. neprekladaly, nikdo si toho nevsiml
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 02:22:05 +02:00
tthandClaude Opus 5 7ca13ed404 fix(tools): flash přes serial DFU teď dokáže, že šel tam, kam měl
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-01 22:52:51 +02:00
Scott Powell 49319023e5 Merge branch 'dev'
# Conflicts:
#	docs/payloads.md
2026-08-09 14:36:53 -04:00
ViezeVingertjes 2679fa8ebc fix: prevent ESP32 KISS modem stalls under USB backpressure
Switch ESP32-S3 KISS modem environments to HWCDC and move outbound KISS writes to a non-blocking queued frame path so loop() and TX completion keep progressing when the host reads slowly. Add native backpressure regression tests and correct the native_kiss_modem test filter so this suite runs directly with pio test.
2026-07-18 22:43:55 +02:00
tuzzmaniandevil 6865daea8f Address two comments from PR 2026-05-08 11:14:22 +12:00
tuzzmaniandevil cba90a82f2 Enhance KissModem frame processing and timeout handling 2026-05-07 00:03:09 +00:00
ViezeVingertjes 484ef3b302 Remove redundant locals in handleSetRadio 2026-02-07 14:32:11 +01:00
ViezeVingertjes 2c6d625921 Remove individual HW_RESP_* defines, use HW_RESP() macro directly 2026-02-07 14:24:34 +01:00
ViezeVingertjes 85410e85e3 Remove redundant send/complete/finished callbacks, use Radio interface directly 2026-02-07 14:22:21 +01:00
ViezeVingertjes f95d348c7a Add toggleable per-packet signal reporting 2026-02-07 10:21:36 +01:00
agessaman 82ca66a6a8 fix(kiss_modem): improve RX delivery and noise floor sampling 2026-02-07 08:51:52 +01:00
ViezeVingertjes cdc25aeff4 Reorganise KISS protocol to close gaps. 2026-02-07 08:51:52 +01:00
ViezeVingertjes 48e60ed57f Rewrite KISS modem to be fully spec-compliant 2026-02-07 08:51:52 +01:00
ViezeVingertjes d0e6cea382 Remove sync word handling from KissModem. 2026-02-02 18:05:26 +01:00
ViezeVingertjes 3171696de5 Refactor KissModem to integrate radio and sensor management directly, removing callback dependencies. 2026-01-31 15:15:19 +01:00
ViezeVingertjes b04f33bd34 Add new commands and responses for RSSI, channel status, airtime, noise floor, statistics, battery, and sensors. 2026-01-31 15:05:25 +01:00
ViezeVingertjes a5ad202218 Add KISS Modem firmware 2026-01-31 10:22:32 +01:00