making bluefruit multiprotocol friendly
This commit is contained in:
1 parent
1046ce6db0
commit
51925d20fa
2 files changed
+22
No files matched your search
@@ -162,6 +162,7 @@ AdafruitBluefruit::AdafruitBluefruit(void)
|
||||
|
||||
_ble_event_sem = NULL;
|
||||
_soc_event_sem = NULL;
|
||||
_mprot_event_sem = NULL;
|
||||
|
||||
_led_blink_th = NULL;
|
||||
_led_conn = true;
|
||||
@@ -310,7 +311,15 @@ bool AdafruitBluefruit::begin(uint8_t prph_count, uint8_t central_count)
|
||||
#error Clock Source is not configured, define USE_LFXO or USE_LFRC according to your board in variant.h
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BLE only Softdevices have 2-args sd_softdevice_enable()
|
||||
/* BLE & ANT+ Softdevices have 3-args sd_softdevice_enable()
|
||||
/*------------------------------------------------------------------*/
|
||||
#ifdef ANT_LICENSE_KEY
|
||||
VERIFY_STATUS( sd_softdevice_enable(&clock_cfg, nrf_error_cb, ANT_LICENSE_KEY), false );
|
||||
#else //#ifdef ANT_LICENSE_KEY
|
||||
VERIFY_STATUS( sd_softdevice_enable(&clock_cfg, nrf_error_cb), false );
|
||||
#endif //#ifdef ANT_LICENSE_KEY
|
||||
|
||||
#ifdef USE_TINYUSB
|
||||
usb_softdevice_post_enable();
|
||||
@@ -676,6 +685,8 @@ void SD_EVT_IRQHandler(void)
|
||||
// Notify both BLE & SOC Task
|
||||
xSemaphoreGiveFromISR(Bluefruit._soc_event_sem, NULL);
|
||||
xSemaphoreGiveFromISR(Bluefruit._ble_event_sem, NULL);
|
||||
// Notify parallel multiprotocol Task, if any
|
||||
if (Bluefruit._mprot_event_sem!=NULL) xSemaphoreGiveFromISR(*Bluefruit._mprot_event_sem, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user