mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Handle case of non-present leds in preflight check
This commit is contained in:
parent
2c31961bb0
commit
4d88b56e38
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user