Component: ModeManager (PROVESFlightControllerReference/Components/ModeManager/, active component, module Components)
Category: command behavior vs. documentation
Description
The FPP doc comment for EXIT_SAFE_MODE says the command "only succeeds if currently in safe mode", but the handler is unconditional: when invoked in NORMAL mode it still returns CMD_RESPONSE OK, emits ExitingSafeMode, re-drives all eight load-switch turnOn ports, and re-broadcasts modeChanged(NORMAL).
Found while writing the new ModeManager component UT (test/ut/ModeManagerTester.cpp, case Nominal.ExitSafeModeWhenAlreadyNormal, landed in #510). The test currently pins the implemented behavior and carries a comment noting the mismatch — once this issue is decided, the test should be updated to pin the chosen behavior.
Expected
One of:
- (a) Handler rejects the command when not in SAFE_MODE (
VALIDATION_ERROR, or explicit event + OK-no-op), matching the doc; or
- (b) The FPP doc is updated to state the command is an unconditional "drive outputs to NORMAL" recovery action (arguably useful as a ground recovery hammer).
Notes
Related finding from the same UT work: packetRouted clears the command-loss debounce latch, so a repeated comm timeout re-runs the full safe-mode entry (sequence, switch-offs, watchdog stop, entry-count increment) even while already in SAFE_MODE. Possibly intended (re-assert safing) but worth confirming while deciding this issue.
🤖 Generated with Claude Code
https://claude.ai/code/session_0156cFUudH6gCKKQLjPbnhsK
Component: ModeManager (
PROVESFlightControllerReference/Components/ModeManager/, active component, moduleComponents)Category: command behavior vs. documentation
Description
The FPP doc comment for
EXIT_SAFE_MODEsays the command "only succeeds if currently in safe mode", but the handler is unconditional: when invoked in NORMAL mode it still returnsCMD_RESPONSE OK, emitsExitingSafeMode, re-drives all eight load-switchturnOnports, and re-broadcastsmodeChanged(NORMAL).Found while writing the new ModeManager component UT (
test/ut/ModeManagerTester.cpp, caseNominal.ExitSafeModeWhenAlreadyNormal, landed in #510). The test currently pins the implemented behavior and carries a comment noting the mismatch — once this issue is decided, the test should be updated to pin the chosen behavior.Expected
One of:
VALIDATION_ERROR, or explicit event + OK-no-op), matching the doc; orNotes
Related finding from the same UT work:
packetRoutedclears the command-loss debounce latch, so a repeated comm timeout re-runs the full safe-mode entry (sequence, switch-offs, watchdog stop, entry-count increment) even while already in SAFE_MODE. Possibly intended (re-assert safing) but worth confirming while deciding this issue.🤖 Generated with Claude Code
https://claude.ai/code/session_0156cFUudH6gCKKQLjPbnhsK