Eliminates: 1 function call + internal state check per gyro sample#11398
Eliminates: 1 function call + internal state check per gyro sample#11398DzikuVx wants to merge 1 commit intomaintenance-10.xfrom
Conversation
Cost reduction: ~5-10 CPU cycles per update (function call overhead + branch) At 8kHz gyro rate: Saves ~40,000-80,000 cycles/second Benefit: More CPU headroom for flight control calculations
Review Summary by QodoCache gyro calibration status for performance optimization
WalkthroughsDescription• Caches gyro calibration status to eliminate function call in hot path • Reduces CPU cycles per gyro sample by ~5-10 cycles • Saves ~40,000-80,000 CPU cycles per second at 8kHz rate • Improves flight control calculation headroom Diagramflowchart LR
A["Gyro calibration logic"] -->|Previously: Function call overhead| B["zeroCalibrationIsCompleteV"]
A -->|Now: Cached boolean check| C["gyroCalibrationComplete"]
B -->|Eliminated| D["CPU cycles saved"]
C -->|Direct access| D
File Changes1. src/main/sensors/gyro.c
|
Code Review by Qodo
1. Calibration state divergence
|
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
|
To make room on F722, we could gate any of these telemetry options: LTM |
Cost reduction: ~5-10 CPU cycles per update (function call overhead + branch)
At 8kHz gyro rate: Saves ~40,000-80,000 cycles/second
Benefit: More CPU headroom for flight control calculations