Nordic BLE: Fix processing of events.

If new events are signaled during processing then they should be processed when processEvent is called again. The goal is to let other processing happen and not process sollely ble events.
pull/6932/head
Vincent Coubard 2018-05-15 09:23:11 +01:00
parent 8fbecf2e0d
commit 6810c02606
1 changed files with 6 additions and 7 deletions

View File

@ -223,19 +223,18 @@ nRF5xn::waitForEvent(void)
void nRF5xn::processEvents() {
core_util_critical_section_enter();
while (isEventsSignaled) {
if (isEventsSignaled) {
isEventsSignaled = false;
core_util_critical_section_exit();
#if NRF_SD_BLE_API_VERSION >= 5
#if NRF_SD_BLE_API_VERSION >= 5
// We use the "polling" dispatch model
// http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/group__nrf__sdh.html?cp=4_0_0_6_11_60_20#gab4d7be69304d4f5feefd1d440cc3e6c7
// This will process any pending events from the Softdevice
nrf_sdh_evts_poll();
#else
#else
intern_softdevice_events_execute();
#endif
core_util_critical_section_enter();
#endif
} else {
core_util_critical_section_exit();
}
core_util_critical_section_exit();
}