mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-16 18:07:34 +08:00
Handle case of non-present leds in preflight check
This commit is contained in:
@@ -135,6 +135,7 @@ int preflight_check_main(int argc, char *argv[])
|
||||
|
||||
close(fd);
|
||||
fd = open(BARO_DEVICE_PATH, 0);
|
||||
close(fd);
|
||||
|
||||
/* ---- RC CALIBRATION ---- */
|
||||
|
||||
@@ -251,6 +252,11 @@ system_eval:
|
||||
int buzzer = open("/dev/tone_alarm", O_WRONLY);
|
||||
int leds = open(LED_DEVICE_PATH, 0);
|
||||
|
||||
if (leds < 0) {
|
||||
close(buzzer);
|
||||
errx(1, "failed to open leds, aborting");
|
||||
}
|
||||
|
||||
/* flip blue led into alternating amber */
|
||||
led_off(leds, LED_BLUE);
|
||||
led_off(leds, LED_AMBER);
|
||||
|
||||
Reference in New Issue
Block a user