inav
inav copied to clipboard
Add guard for logic conditions bitmask if max exceeds 64
User description
Summary
Adds a guard to the MSP2_INAV_LOGIC_CONDITIONS_CONFIGURED handler to use MIN(MAX_LOGIC_CONDITIONS, 64) instead of hardcoded 64. This prevents potential issues if MAX_LOGIC_CONDITIONS is increased beyond 64 in the future.
Changes
- Use
MIN(MAX_LOGIC_CONDITIONS, 64)in the loop bound
Testing
Code review only.
PR Type
Enhancement
Description
-
Add MSP2_INAV_LOGIC_CONDITIONS_CONFIGURED command for efficient condition status
-
Returns 8-byte bitmask indicating which logic conditions differ from defaults
-
Enables configurator optimization reducing MSP requests from 64 to 1+N
-
Guard loop with MIN(MAX_LOGIC_CONDITIONS, 64) for future-proofing
Diagram Walkthrough
flowchart LR
A["MSP2_INAV_LOGIC_CONDITIONS_CONFIGURED<br/>request"] --> B["Iterate logic conditions<br/>up to MIN(MAX, 64)"]
B --> C["Check if condition<br/>is configured"]
C --> D["Build 64-bit<br/>bitmask"]
D --> E["Send 8-byte response<br/>lower + upper 32-bits"]
File Walkthrough
| Relevant files | |||
|---|---|---|---|
| Enhancement |
| ||
| Configuration changes |
|
PR Compliance Guide 🔍
All compliance sections have been disabled in the configurations.