mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-16 15:07:53 +00:00
porting: Add common function to run default event queue
Now application can just call single function which will run default event queue instead of creating "standard" loop. Also on some OS it may be just possible to call some OS-specific API instead, so it's up to app what to do - this is just a convenience function.
This commit is contained in:
@@ -28,6 +28,8 @@ extern "C" {
|
||||
|
||||
void nimble_port_init(void);
|
||||
|
||||
void nimble_port_run(void);
|
||||
|
||||
struct ble_npl_eventq *nimble_port_get_dflt_eventq(void);
|
||||
|
||||
#if NIMBLE_CFG_CONTROLLER
|
||||
|
||||
@@ -54,6 +54,17 @@ nimble_port_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nimble_port_run(void)
|
||||
{
|
||||
struct ble_npl_event *ev;
|
||||
|
||||
while (1) {
|
||||
ev = ble_npl_eventq_get(&g_eventq_dflt, BLE_NPL_TIME_FOREVER);
|
||||
ble_npl_event_run(ev);
|
||||
}
|
||||
}
|
||||
|
||||
struct ble_npl_eventq *
|
||||
nimble_port_get_dflt_eventq(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user