mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-08 02:57:56 +00:00
porting: Add API to run an event instead of running an eventq
This makes more sense since now we have API which can just fire callback associated with event. Running eventq is just getting an event from queue and then running it.
This commit is contained in:
@@ -1088,6 +1088,8 @@ ble_ll_event_comp_pkts(struct ble_npl_event *ev)
|
||||
void
|
||||
ble_ll_task(void *arg)
|
||||
{
|
||||
struct ble_npl_event *ev;
|
||||
|
||||
/* Init ble phy */
|
||||
ble_phy_init();
|
||||
|
||||
@@ -1100,7 +1102,9 @@ ble_ll_task(void *arg)
|
||||
ble_ll_rand_start();
|
||||
|
||||
while (1) {
|
||||
ble_npl_eventq_run(&g_ble_ll_data.ll_evq);
|
||||
ev = ble_npl_eventq_get(&g_ble_ll_data.ll_evq, BLE_NPL_TIME_FOREVER);
|
||||
assert(ev);
|
||||
ble_npl_event_run(ev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,8 +76,6 @@ void ble_npl_eventq_put(struct ble_npl_eventq *evq, struct ble_npl_event *ev);
|
||||
void ble_npl_eventq_remove(struct ble_npl_eventq *evq,
|
||||
struct ble_npl_event *ev);
|
||||
|
||||
void ble_npl_eventq_run(struct ble_npl_eventq *evq);
|
||||
|
||||
void ble_npl_event_init(struct ble_npl_event *ev, ble_npl_event_fn *fn,
|
||||
void *arg);
|
||||
|
||||
@@ -89,6 +87,8 @@ void ble_npl_event_set_arg(struct ble_npl_event *ev, void *arg);
|
||||
|
||||
bool ble_npl_eventq_is_empty(struct ble_npl_eventq *evq);
|
||||
|
||||
void ble_npl_event_run(struct ble_npl_event *ev);
|
||||
|
||||
/*
|
||||
* Mutexes
|
||||
*/
|
||||
|
||||
@@ -62,7 +62,7 @@ ble_npl_eventq_remove(struct ble_npl_eventq *evq,
|
||||
}
|
||||
|
||||
void
|
||||
ble_npl_eventq_run(struct ble_npl_eventq *evq)
|
||||
ble_npl_event_run(struct ble_npl_event *ev)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -118,13 +118,8 @@ ble_npl_eventq_remove(struct ble_npl_eventq *evq, struct ble_npl_event *ev)
|
||||
}
|
||||
|
||||
static inline void
|
||||
ble_npl_eventq_run(struct ble_npl_eventq *evq)
|
||||
ble_npl_event_run(struct ble_npl_event *ev)
|
||||
{
|
||||
struct ble_npl_event *ev;
|
||||
|
||||
ev = ble_npl_eventq_get(evq, BLE_NPL_TIME_FOREVER);
|
||||
assert(ev->fn != NULL);
|
||||
|
||||
ev->fn(ev);
|
||||
}
|
||||
|
||||
|
||||
@@ -110,9 +110,9 @@ ble_npl_eventq_remove(struct ble_npl_eventq *evq,
|
||||
}
|
||||
|
||||
static inline void
|
||||
ble_npl_eventq_run(struct ble_npl_eventq *evq)
|
||||
ble_npl_event_run(struct ble_npl_event *ev)
|
||||
{
|
||||
os_eventq_run(&evq->evq);
|
||||
ev->ev.ev_cb(&ev->ev);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
||||
Reference in New Issue
Block a user