mirror of https://github.com/ARMmbed/mbed-os.git
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
parent
8fbecf2e0d
commit
6810c02606
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue