@@ -117,6 +117,8 @@ extern int r_ble_log_deinit_async(void);
117117extern void r_ble_log_async_select_dump_buffers (uint8_t buffers );
118118extern void r_ble_log_async_output_dump_all (bool output );
119119extern void esp_panic_handler_reconfigure_wdts (uint32_t timeout_ms );
120+ extern int r_ble_log_ctrl_level_and_mod (uint8_t log_level , uint32_t mod_switch );
121+ extern int r_ble_ctrl_mod_type (uint16_t mod , uint32_t mod_type_switch );
120122#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
121123extern int r_ble_controller_deinit (void );
122124extern int r_ble_controller_enable (uint8_t mode );
@@ -266,10 +268,14 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
266268 }
267269
268270 ret = r_ble_log_init_async (bt_controller_log_interface , task_create , buffers , (uint32_t * )log_bufs_size );
271+ if (ret != ESP_OK ) {
272+ return ret ;
273+ }
274+
275+ ret = r_ble_log_ctrl_level_and_mod (CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL , CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH );
269276 if (ret == ESP_OK ) {
270277 log_is_inited = true;
271278 }
272-
273279 return ret ;
274280}
275281
@@ -403,6 +409,22 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
403409 assert (err == ESP_OK );
404410}
405411#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
412+
413+ #if CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
414+ void esp_task_wdt_isr_user_handler (void )
415+ {
416+ esp_ble_controller_log_dump_all (true);
417+ }
418+ #endif // CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
419+
420+ #if CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
421+ void __real_esp_panic_handler (void * info );
422+ void __wrap_esp_panic_handler (void * info )
423+ {
424+ esp_ble_controller_log_dump_all (true);
425+ __real_esp_panic_handler (info );
426+ }
427+ #endif // CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
406428#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
407429
408430/* This variable tells if BLE is running */
0 commit comments