Files
Jonathan BennettandClaude Opus 5 4da58c3c90 fix(test): tune the modelled LR2021 before the interface suite sets its SF (#12284)
test_radiolib_drivers has been red on develop since the RadioLib pin moved
to 5878f990 (#12277): the three lr20x0_interface_tests cases added by #12036
all fail at the same assertion with -12, RADIOLIB_ERR_INVALID_FREQUENCY.

Nothing in the firmware is wrong. At the new pin LR2021::setLoRaModulationParams()
ends in setDCDCworkaround() (RadioLib#1864), whose last act is
setFrequency(this->freqMHz, true). The suite builds the interface without
calling init(), so begin() never runs and freqMHz is still 0, and the range
check in setFrequency() rejects it. Every setter that reaches the modulation
params now needs a frequency first, where before the jump it did not.

lr2021_tests.h already handles this: LR2021_RADIO() calls lr2021Tune() for
exactly this reason. The interface suite builds its radio by hand and skipped
that step, so give it the same tune before it writes the SF.


Claude-Session: https://claude.ai/code/session_011C7D9biGfpxLruq7DFLzsP

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 02:47:31 +00:00
..