From 2a07dc0e0a7f3d87073ab19331f5d2fb5349fe1a Mon Sep 17 00:00:00 2001 From: Phil Rhinehart Date: Mon, 18 Apr 2016 17:02:07 +0800 Subject: [PATCH] This fixes an event handling issue in the cc26xx BLE driver. Currently, the rf_ble_beacon_process triggers the BLE beacon upon receiving any event, rather than verifying that the event timer has expired. This means that any PROCESS_BROADCAST (e.g. any sensor event) will fire the beacon. This commit adds logic to prevent this. --- cpu/cc26xx-cc13xx/rf-core/rf-ble.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/cc26xx-cc13xx/rf-core/rf-ble.c b/cpu/cc26xx-cc13xx/rf-core/rf-ble.c index b8af55ff8..48daba69f 100644 --- a/cpu/cc26xx-cc13xx/rf-core/rf-ble.c +++ b/cpu/cc26xx-cc13xx/rf-core/rf-ble.c @@ -256,7 +256,7 @@ PROCESS_THREAD(rf_ble_beacon_process, ev, data) while(1) { etimer_set(&ble_adv_et, beacond_config.interval); - PROCESS_WAIT_EVENT(); + PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&ble_adv_et) || ev == PROCESS_EVENT_EXIT); if(ev == PROCESS_EVENT_EXIT) { PROCESS_EXIT(); @@ -374,7 +374,7 @@ PROCESS_THREAD(rf_ble_beacon_process, ev, data) /* Wait unless this is the last burst */ if(i < BLE_ADV_MESSAGES - 1) { - PROCESS_WAIT_EVENT(); + PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&ble_adv_et)); } }