Repository navigation
Raise servo mixer rules from 36 to 42 - #12279
GrumpyOldNerd wants to merge 1 commit into
Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoRaise servo mixer rules from 36 to 42
AI Description
Merge Risk
|
Code Review by Qodo
1. Configurator hides six servo rules
|
42 is the most that fits MSP2_INAV_SERVO_MIXER (two mixer profiles, 6 bytes per rule) into the 512-byte MSP reply buffers: serial on targets without a flash blackbox and MSP over telemetry. sbuf writes are not bounds-checked, so static asserts guard both. MSP2_INAV_MIXER reports MAX_SERVO_RULES as a trailing byte, so the Configurator no longer has to assume two rules per servo. MSP spec version 2.2.0 for the appended field. The mixer profile layout changes, so the PG version is bumped and the mixer profiles reset to defaults on upgrade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3add75b to
8310b95
Compare
Raises
MAX_SERVO_RULESfrom 36 to 42 per mixer profile, for all targets. Gliders with several flap segments, camber and butterfly run out of rules at 36.Why 42:
MSP2_INAV_SERVO_MIXERsends both mixer profiles in one reply (6 bytes per rule). 2 × 42 × 6 = 504 bytes is the most that fits the 512-byte reply buffers (serial on targets without a flash blackbox, MSP over telemetry), so no MSP paging is needed. Static asserts guard both buffers.Changes
MAX_SERVO_RULES42 (was2 * MAX_SUPPORTED_SERVOS)PG_MIXER_PROFILEversion bump: mixer profiles reset to defaults on upgrade, restore viadiff. Adiffwithsmix 36tosmix 41gives parse errors on older firmware.MSP2_INAV_MIXERappendsmaxServoRules(u8), MSP spec 2.2.0. Older Configurators ignore the byte but handle only 36 rules per profile; rules 37 to 42 need Mixer: take the servo rule count from the FC inav-configurator#2868.Mixer.md, MSP specCost (local build against
maintenance-11.x): flash +8 to +68 bytes, RAM +160 to +248 bytes (MATEKF411, F722SE, F405, F765, H743).This applies to all targets. F722 and F411 are included only for simplicity; if they cause any conflict, they drop out right away.
Tested in SITL: 42 rules accepted and the 43rd rejected; rule 42 drives its servo;
MSP2_INAV_SERVO_MIXER504 bytes with profile 2 at the right offset;MSP2_INAV_MIXERreports 42; rules survive save and reboot; upgrading an old EEPROM resets the mixer and keeps other settings. Unit tests 647/647, PG version check passes. Not tested on hardware yet.🤖 Generated with Claude Code