diff --git a/flight/targets/boards/oplinkmini/firmware/pios_board.c b/flight/targets/boards/oplinkmini/firmware/pios_board.c index 57a535025..dd93312d0 100644 --- a/flight/targets/boards/oplinkmini/firmware/pios_board.c +++ b/flight/targets/boards/oplinkmini/firmware/pios_board.c @@ -95,7 +95,7 @@ void PIOS_Board_Init(void) if (PIOS_TASK_MONITOR_Initialize(TASKINFO_RUNNING_NUMELEM)) { PIOS_Assert(0); } - + /* Initialize the delayed callback library */ CallbackSchedulerInitialize(); diff --git a/flight/uavobjects/eventdispatcher.c b/flight/uavobjects/eventdispatcher.c index 586a68cc6..9fc78a21c 100644 --- a/flight/uavobjects/eventdispatcher.c +++ b/flight/uavobjects/eventdispatcher.c @@ -288,15 +288,16 @@ static void eventTask() // Wait for queue message int limit = MAX_QUEUE_SIZE; + while (xQueueReceive(mQueue, &evInfo, 0) == pdTRUE) { // Invoke callback, if any if (evInfo.cb != 0) { evInfo.cb(&evInfo.ev); // the function is expected to copy the event information } - // limit loop to max queue size to slightly reduce the impact of recursive events - if (!--limit) { - break; - } + // limit loop to max queue size to slightly reduce the impact of recursive events + if (!--limit) { + break; + } } // Process periodic updates