1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-1379 - Prevent loosing any update to background notification and notifications with priority higher than current

This commit is contained in:
Alessio Morale 2014-09-21 23:32:52 +02:00
parent 46ef59f186
commit 3c6a8e0395

View File

@ -58,6 +58,13 @@ pios_notify_notification PIOS_NOTIFY_GetActiveNotification(bool clear)
*/
void PIOS_NOTIFICATION_Default_Ext_Led_Play(const LedSequence_t *sequence, pios_notify_priority priority)
{
// alert and alarms are repeated if condition persists. bacground notification instead are set once, so try to prevent loosing any update
if (newNotification && priority != NOTIFY_PRIORITY_BACKGROUND) {
// prevent overwriting higher priority or background notifications
if (extLedNotification.priority == NOTIFY_PRIORITY_BACKGROUND || extLedNotification.priority > priority) {
return;
}
}
extLedNotification.priority = priority;
extLedNotification.sequence = *sequence;
newNotification = true;