feat(rc): CRSF/ELRS RC integration — telemetry uplink + channel fix (Issue #103) #111
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-firmware/issue-103-crsf-rc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #103 — CRSF/ELRS 2.4GHz RC receiver integration on STM32F722.
What was already done (from crsf-elrs branch)
mode_managerblends steer/speed per CH6 modeNew in this PR
include/config.hCRSF_FAILSAFE_MS300→500ms per specVBAT_SCALE_NUM,VBAT_AREF_MV,VBAT_ADC_BITS— Mamba F722 11:1 dividerCRSF_TELEMETRY_HZ = 1— telemetry TX rateinclude/battery.h+src/battery.c(new)battery_read_mv()→ Vbat in millivoltsbattery_estimate_pct()→ 0–100% SoC, auto-detects 3S vs 4Sinclude/crsf.h+src/crsf.c— CRSF telemetry TX uplinkcrsf_send_battery(voltage_mv, current_ma, remaining_pct)— type 0x08voltage in 100mV units, current in 100mA units, big-endian, CRC8-DVB-S2
crsf_send_flight_mode(armed)— type 0x21,"ARMED\0"/"DISARM\0"stringcrsf_build_frame()shared internal helpersrc/main.cbattery_init()called aftercrsf_init()crsf_send_battery(vbat_mv, 0, soc_pct)+crsf_send_flight_mode(armed)test/test_crsf_frames.py— 28 pytest testsbattery_estimate_pct: 3S/4S full/empty/mid, auto-detection boundaryTest plan
pytest test/test_crsf_frames.py -v— 28 tests pass/uwb/rangesRC channels on USB telemetry stream (ch1–ch4 µs values)🤖 Generated with Claude Code