@@ -110,6 +110,8 @@ extern int r_ble_log_deinit_async(void);
110110extern void r_ble_log_async_select_dump_buffers (uint8_t buffers );
111111extern void r_ble_log_async_output_dump_all (bool output );
112112extern void esp_panic_handler_reconfigure_wdts (uint32_t timeout_ms );
113+ extern int r_ble_log_ctrl_level_and_mod (uint8_t log_level , uint32_t mod_switch );
114+ extern int r_ble_ctrl_mod_type (uint16_t mod , uint32_t mod_type_switch );
113115#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
114116extern int r_ble_controller_deinit (void );
115117extern int r_ble_controller_enable (uint8_t mode );
@@ -249,10 +251,14 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
249251 }
250252
251253 ret = r_ble_log_init_async (bt_controller_log_interface , task_create , buffers , (uint32_t * )log_bufs_size );
254+ if (ret != ESP_OK ) {
255+ return ret ;
256+ }
257+
258+ ret = r_ble_log_ctrl_level_and_mod (CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL , CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH );
252259 if (ret == ESP_OK ) {
253260 log_is_inited = true;
254261 }
255-
256262 return ret ;
257263}
258264
@@ -383,6 +389,22 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
383389 assert (err == ESP_OK );
384390}
385391#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
392+
393+ #if CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
394+ void esp_task_wdt_isr_user_handler (void )
395+ {
396+ esp_ble_controller_log_dump_all (true);
397+ }
398+ #endif // CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
399+
400+ #if CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
401+ void __real_esp_panic_handler (void * info );
402+ void __wrap_esp_panic_handler (void * info )
403+ {
404+ esp_ble_controller_log_dump_all (true);
405+ __real_esp_panic_handler (info );
406+ }
407+ #endif // CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
386408#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
387409
388410/* This variable tells if BLE is running */
0 commit comments