From 7675160e3377f5d2bc93e5f69030758cefe0c923 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Thu, 5 Mar 2015 17:17:19 +0900 Subject: [PATCH] Notify: add firmware update flag and implement for OreoLED --- libraries/AP_Notify/AP_Notify.h | 1 + libraries/AP_Notify/OreoLED_PX4.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/libraries/AP_Notify/AP_Notify.h b/libraries/AP_Notify/AP_Notify.h index 1ff96e13f9..3114740732 100644 --- a/libraries/AP_Notify/AP_Notify.h +++ b/libraries/AP_Notify/AP_Notify.h @@ -89,6 +89,7 @@ public: uint16_t autotune_next_axis : 1; // 1 when autotune has completed one axis and is moving onto the next uint16_t mission_complete : 1; // 1 when the mission has completed successfully uint16_t waypoint_complete : 1; // 1 as vehicle completes a waypoint + uint16_t firmware_update : 1; // 1 just before vehicle firmware is updated }; // the notify flags are static to allow direct class access diff --git a/libraries/AP_Notify/OreoLED_PX4.cpp b/libraries/AP_Notify/OreoLED_PX4.cpp index 8d8a66d16c..d75c1ee760 100644 --- a/libraries/AP_Notify/OreoLED_PX4.cpp +++ b/libraries/AP_Notify/OreoLED_PX4.cpp @@ -88,6 +88,12 @@ void OreoLED_PX4::update() return; } + // handle firmware update event + if (AP_Notify::events.firmware_update) { + set_macro(OREOLED_INSTANCE_ALL, OREOLED_PARAM_MACRO_COLOUR_CYCLE); + return; + } + // return immediately if custom pattern has been sent if (OreoLED_PX4::_pattern_override != 0) { // reset stage so patterns will be resent once override clears