mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 07:13:35 +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);
|
close(fd);
|
||||||
fd = open(BARO_DEVICE_PATH, 0);
|
fd = open(BARO_DEVICE_PATH, 0);
|
||||||
|
close(fd);
|
||||||
|
|
||||||
/* ---- RC CALIBRATION ---- */
|
/* ---- RC CALIBRATION ---- */
|
||||||
|
|
||||||
@@ -251,6 +252,11 @@ system_eval:
|
|||||||
int buzzer = open("/dev/tone_alarm", O_WRONLY);
|
int buzzer = open("/dev/tone_alarm", O_WRONLY);
|
||||||
int leds = open(LED_DEVICE_PATH, 0);
|
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 */
|
/* flip blue led into alternating amber */
|
||||||
led_off(leds, LED_BLUE);
|
led_off(leds, LED_BLUE);
|
||||||
led_off(leds, LED_AMBER);
|
led_off(leds, LED_AMBER);
|
||||||
|
|||||||
Reference in New Issue
Block a user