AP_Notify: add gps glitch notification

This commit is contained in:
Randy Mackay 2017-07-25 20:41:56 +09:00
parent 52bf93dd80
commit 0d5c98ad45
2 changed files with 7 additions and 1 deletions

View File

@ -76,6 +76,7 @@ public:
uint32_t leak_detected : 1; // 1 if leak detected
float battery_voltage ; // battery voltage
uint32_t gps_fusion : 1; // 0 = GPS fix rejected by EKF, not usable for flight. 1 = GPS in use by EKF, usable for flight
uint32_t gps_glitching : 1; // 1 if gps is glitching
// additional flags
uint32_t external_leds : 1; // 1 if external LEDs are enabled (normally only used for copter)

View File

@ -180,7 +180,7 @@ void RGBLed::update_colours(void)
// gps failsafe pattern : flashing yellow and blue
// ekf_bad pattern : flashing yellow and red
if (AP_Notify::flags.failsafe_radio || AP_Notify::flags.failsafe_battery ||
AP_Notify::flags.ekf_bad || AP_Notify::flags.leak_detected) {
AP_Notify::flags.ekf_bad || AP_Notify::flags.gps_glitching || AP_Notify::flags.leak_detected) {
switch(step) {
case 0:
case 1:
@ -207,6 +207,11 @@ void RGBLed::update_colours(void)
_red_des = brightness;
_blue_des = _led_off;
_green_des = _led_off;
} else if (AP_Notify::flags.gps_glitching) {
// blue on gps glitch
_red_des = _led_off;
_blue_des = brightness;
_green_des = _led_off;
}else{
// all off for radio or battery failsafe
_red_des = _led_off;