Notify: add firmware update flag and implement for OreoLED

This commit is contained in:
Randy Mackay 2015-03-05 17:17:19 +09:00
parent 61ed812fc4
commit 7675160e33
2 changed files with 7 additions and 0 deletions

View File

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

View File

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