FlightData: add mass storage reboot action - #3756
Conversation
552d16c to
cfc80d2
Compare
|
Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting. Reviewed at head One thing worth a line in the commit message: the Non-blocking notes:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new FlightData “action” in MissionPlanner to reboot an ArduPilot flight controller into USB mass-storage mode (to support ArduPilot/ardupilot#34087), enabling faster access to the vehicle’s SD card via USB.
Changes:
- Added a new
actions.Reboot_Mass_Storageenum entry so it appears in the FlightData action list. - Implemented handling in
BUTactiondo_Clickto sendMAV_CMD.PREFLIGHT_REBOOT_SHUTDOWNwith the mass-storage reboot action parameter. - Refactored custom action lookup to use
CustomActions.TryGetValue(...)instead of direct indexing.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (CustomActions.TryGetValue(CMB_action.Text, out var customAction)) | ||
| { | ||
| var customAction = CustomActions[CMB_action.Text]; | ||
| if(customAction!=null) | ||
| try | ||
| { | ||
| try | ||
| { | ||
| customAction.Invoke(CMB_action.Text); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| CustomMessageBox.Show(Strings.CommandFailed + "\n" + ex.ToString(), Strings.ERROR); | ||
| } | ||
| return; | ||
| customAction.Invoke(CMB_action.Text); |
There was a problem hiding this comment.
@copilot Fix the code for this review comment.
When a review comment includes a suggested change, apply the suggestion exactly.
Do not make changes beyond what is described in the linked review comment.
| } | ||
| if (CMB_action.Text == actions.Reboot_Mass_Storage.ToString()) | ||
| { | ||
| const float rebootToMassStorage = 5; |
There was a problem hiding this comment.
@copilot Fix the code for this review comment.
When a review comment includes a suggested change, apply the suggestion exactly.
Do not make changes beyond what is described in the linked review comment.
to support this PR:

ArduPilot/ardupilot#34087