Handle case of non-present leds in preflight check

This commit is contained in:
Lorenz Meier 2013-07-19 08:14:44 +02:00
parent 2c31961bb0
commit 4d88b56e38
1 changed files with 6 additions and 0 deletions

View File

@ -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);