aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lorenz@px4.io>2015-05-14 00:39:56 +0200
committerLorenz Meier <lorenz@px4.io>2015-05-14 00:39:56 +0200
commitea278ea926eeb743cb8927c390ebf2cc0bf35b04 (patch)
tree1294f34072502da7883dcc04818145bfc88976c9
parent7d775eb112a002d3c7c5555f6433e80609df3b87 (diff)
parent90c3aec1fdc640ef15a610991251fa8a6ab202e8 (diff)
downloadpx4-firmware-ea278ea926eeb743cb8927c390ebf2cc0bf35b04.tar.gz
px4-firmware-ea278ea926eeb743cb8927c390ebf2cc0bf35b04.tar.bz2
px4-firmware-ea278ea926eeb743cb8927c390ebf2cc0bf35b04.zip
Merge pull request #2169 from PX4/fix_LED
make main LED show low and critical battery status
-rw-r--r--src/modules/commander/commander.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp
index 50846ff4d..f27487932 100644
--- a/src/modules/commander/commander.cpp
+++ b/src/modules/commander/commander.cpp
@@ -2157,10 +2157,12 @@ control_status_leds(vehicle_status_s *status_local, const actuator_armed_s *actu
if (set_normal_color) {
/* set color */
- if (status_local->battery_warning == vehicle_status_s::VEHICLE_BATTERY_WARNING_LOW || status_local->failsafe) {
+ if (status_local->failsafe) {
+ rgbled_set_color(RGBLED_COLOR_PURPLE);
+ } else if (status_local->battery_warning == vehicle_status_s::VEHICLE_BATTERY_WARNING_LOW) {
rgbled_set_color(RGBLED_COLOR_AMBER);
- /* vehicle_status_s::VEHICLE_BATTERY_WARNING_CRITICAL handled as vehicle_status_s::ARMING_STATE_ARMED_ERROR / vehicle_status_s::ARMING_STATE_STANDBY_ERROR */
-
+ } else if (status_local->battery_warning == vehicle_status_s::VEHICLE_BATTERY_WARNING_CRITICAL) {
+ rgbled_set_color(RGBLED_COLOR_RED);
} else {
if (status_local->condition_global_position_valid) {
rgbled_set_color(RGBLED_COLOR_GREEN);