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:
Rahul Tank
2024-02-14 16:59:05 +05:30
committed by Abhinav Kudnar
parent e166060b6e
commit 13a8bcb7cd
2 changed files with 6 additions and 9 deletions
@@ -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;
};
+6 -6
View File
@@ -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