diff --git a/libraries/AP_Notify/AP_BoardLED.cpp b/libraries/AP_Notify/AP_BoardLED.cpp index 6e93724b82..df62ac500b 100644 --- a/libraries/AP_Notify/AP_BoardLED.cpp +++ b/libraries/AP_Notify/AP_BoardLED.cpp @@ -161,7 +161,7 @@ void AP_BoardLED::update(void) } break; - case 3: + default: // solid blue on gps lock hal.gpio->write(HAL_GPIO_C_LED_PIN, HAL_GPIO_LED_ON); break; diff --git a/libraries/AP_Notify/AP_Notify.h b/libraries/AP_Notify/AP_Notify.h index 890cc4da25..5c76e0425a 100644 --- a/libraries/AP_Notify/AP_Notify.h +++ b/libraries/AP_Notify/AP_Notify.h @@ -33,7 +33,7 @@ public: /// notify_type - bitmask of notification types struct notify_type { uint16_t initialising : 1; // 1 if initialising and copter should not be moved - uint16_t gps_status : 2; // 0 = no gps, 1 = no lock, 2 = 2d lock, 3 = 3d lock + uint16_t gps_status : 3; // 0 = no gps, 1 = no lock, 2 = 2d lock, 3 = 3d lock, 4 = dgps lock, 5 = rtk lock uint16_t gps_glitching : 1; // 1 if gps position is not good uint16_t armed : 1; // 0 = disarmed, 1 = armed uint16_t pre_arm_check : 1; // 0 = failing checks, 1 = passed @@ -42,7 +42,7 @@ public: uint16_t failsafe_radio : 1; // 1 if radio failsafe uint16_t failsafe_battery : 1; // 1 if battery failsafe uint16_t failsafe_gps : 1; // 1 if gps failsafe - uint16_t arming_failed : 1; // 1 if copter failed to arm after user input + uint16_t arming_failed : 1; // 1 if copter failed to arm after user input // additional flags uint16_t external_leds : 1; // 1 if external LEDs are enabled (normally only used for copter) diff --git a/libraries/AP_Notify/ToshibaLED.cpp b/libraries/AP_Notify/ToshibaLED.cpp index e945e6b464..7789ab09a7 100644 --- a/libraries/AP_Notify/ToshibaLED.cpp +++ b/libraries/AP_Notify/ToshibaLED.cpp @@ -18,6 +18,7 @@ */ #include +#include #include "ToshibaLED.h" #include "AP_Notify.h" @@ -167,7 +168,7 @@ void ToshibaLED::update_colours(void) // solid green or flashing green if armed if (AP_Notify::flags.armed) { // solid green if armed with GPS 3d lock - if (AP_Notify::flags.gps_status == 3) { + if (AP_Notify::flags.gps_status >= AP_GPS::GPS_OK_FIX_3D) { _red_des = TOSHIBA_LED_OFF; _blue_des = TOSHIBA_LED_OFF; _green_des = brightness; @@ -213,7 +214,7 @@ void ToshibaLED::update_colours(void) case 3: case 4: _red_des = TOSHIBA_LED_OFF; - if (AP_Notify::flags.gps_status == 3) { + if (AP_Notify::flags.gps_status >= AP_GPS::GPS_OK_FIX_3D) { // flashing green if disarmed with GPS 3d lock _blue_des = TOSHIBA_LED_OFF; _green_des = brightness;