mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-07-31 07:07:55 +00:00
Nimble/host: Resolved crash of esp_timer on esp32h2
Per new architecture, event structure elements need to be initialized before assigning to callout. Modified the existing sequence to fix this.
This commit is contained in:
committed by
Abhinav Kudnar
parent
e166060b6e
commit
13a8bcb7cd
@@ -61,9 +61,6 @@ struct ble_npl_event;
|
||||
typedef void ble_npl_event_fn(struct ble_npl_event *ev);
|
||||
|
||||
struct ble_npl_event {
|
||||
#if CONFIG_BT_NIMBLE_USE_ESP_TIMER
|
||||
ble_npl_event_fn *fn;
|
||||
#endif
|
||||
void *event;
|
||||
};
|
||||
|
||||
|
||||
@@ -681,10 +681,9 @@ IRAM_ATTR npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_e
|
||||
BLE_LL_ASSERT(callout);
|
||||
|
||||
memset(callout, 0, sizeof(*callout));
|
||||
ble_npl_event_init(&callout->ev, ev_cb, ev_arg);
|
||||
|
||||
#if CONFIG_BT_NIMBLE_USE_ESP_TIMER
|
||||
callout->ev.fn = ev_cb;
|
||||
callout->ev.event = ev_arg;
|
||||
callout->evq = evq;
|
||||
|
||||
esp_timer_create_args_t create_args = {
|
||||
@@ -703,6 +702,8 @@ IRAM_ATTR npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_e
|
||||
} else {
|
||||
callout = (struct ble_npl_callout_freertos *)co->co;
|
||||
BLE_LL_ASSERT(callout);
|
||||
callout->evq = evq;
|
||||
ble_npl_event_init(&callout->ev, ev_cb, ev_arg);
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -712,10 +713,9 @@ IRAM_ATTR npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_e
|
||||
BLE_LL_ASSERT(callout);
|
||||
|
||||
memset(callout, 0, sizeof(*callout));
|
||||
ble_npl_event_init(&callout->ev, ev_cb, ev_arg);
|
||||
|
||||
#if CONFIG_BT_NIMBLE_USE_ESP_TIMER
|
||||
callout->ev.fn = ev_cb;
|
||||
callout->ev.event = ev_arg;
|
||||
callout->evq = evq;
|
||||
|
||||
esp_timer_create_args_t create_args = {
|
||||
@@ -734,11 +734,11 @@ IRAM_ATTR npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_e
|
||||
else {
|
||||
callout = (struct ble_npl_callout_freertos *)co->co;
|
||||
BLE_LL_ASSERT(callout);
|
||||
callout->evq = evq;
|
||||
ble_npl_event_init(&callout->ev, ev_cb, ev_arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
callout->evq = evq;
|
||||
ble_npl_event_init(&callout->ev, ev_cb, ev_arg);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user