PreFlightCheck: Check if SD card is present only once and store the result

statfs accesses the file-system and can be blocking for an extended period. Since the SD card check is part of the preflight checks in the main thread of commander, it could block its execution and cause various issues. The SD card is only mounted in rcS during boot so the state will not change after the first check.
This commit is contained in:
Michael Schaeuble
2021-03-29 13:20:06 +02:00
committed by Beat Küng
parent c2350c06c1
commit f9af1bbe2d
4 changed files with 8 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ bool rc_input_blocked # set if RC input should be
bool rc_calibration_valid # set if RC calibration is valid
bool vtol_transition_failure # Set to true if vtol transition failed
bool usb_connected # status of the USB power supply
bool sd_card_detected_once # set to true if the SD card was detected
bool avoidance_system_required # Set to true if avoidance system is enabled via COM_OBS_AVOID parameter
bool avoidance_system_valid # Status of the obstacle avoidance system