Issue
When migrating configs between builds with different USE_GPS_RESCUE defines, an out-of-range numeric enum value can persist in failsafeConfig()->failsafe_procedure.
Current code uses compile-time guard #if defined(USE_GPS_RESCUE) to conditionally normalize the value, but this leaves stale/invalid enum values intact when that flag is not defined.
Proposed Fix
Replace compile-time guard with runtime numeric bounds check:
- Compare failsafeConfig()->failsafe_procedure against FAILSAFE_PROCEDURE_COUNT
- If value >= FAILSAFE_PROCEDURE_COUNT, set failsafeConfigMutable()->failsafe_procedure = FAILSAFE_PROCEDURE_DROP_IT
- Normalize invalid/stale values regardless of build flags
Location
src/main/fc/config.c around lines 255-259
Impact
Ensures failsafe state remains valid across build configurations.
This is an AI-generated issue for code review recommendations.