6060#include "ble_log/ble_log_spi_out.h"
6161#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
6262
63+ #if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
64+ #include "ble_log/ble_log_uhci_out.h"
65+ #endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
66+
6367/* Macro definition
6468 ************************************************************************
6569 */
@@ -189,9 +193,9 @@ static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
189193static int esp_ecc_gen_dh_key (const uint8_t * peer_pub_key_x , const uint8_t * peer_pub_key_y ,
190194 const uint8_t * our_priv_key , uint8_t * out_dhkey );
191195#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
192- #if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
196+ #if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && ! CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
193197static void esp_bt_controller_log_interface (uint32_t len , const uint8_t * addr , uint32_t len_append , const uint8_t * addr_append , uint32_t flag );
194- #endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
198+ #endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
195199#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
196200static void esp_bt_ctrl_log_partition_get_and_erase_first_block (void );
197201#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
@@ -218,25 +222,35 @@ esp_err_t esp_bt_controller_log_init(void)
218222 }
219223#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
220224
225+ #if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
226+ if (ble_log_uhci_out_init () != 0 ) {
227+ goto uhci_out_init_failed ;
228+ }
229+ #endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
230+
221231#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
222232 if (r_ble_log_init_simple (ble_log_spi_out_ll_write , ble_log_spi_out_ll_log_ev_proc ) != 0 ) {
223233 goto log_init_failed ;
224234 }
225- #else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
235+ #elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
236+ if (r_ble_log_init_simple (ble_log_uhci_out_ll_write , ble_log_uhci_out_ll_log_ev_proc ) != 0 ) {
237+ goto log_init_failed ;
238+ }
239+ #else
226240 uint8_t buffers = 0 ;
227241#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
228242 buffers |= ESP_BLE_LOG_BUF_CONTROLLER ;
229243#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
230244#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
231245 buffers |= ESP_BLE_LOG_BUF_HCI ;
232- #endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
246+ #endif
233247
234248 bool task_create = true;
235249#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
236250 task_create = false;
237251#elif CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
238252 esp_bt_ctrl_log_partition_get_and_erase_first_block ();
239- #endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
253+ #endif
240254
241255 if (r_ble_log_init_async (esp_bt_controller_log_interface , task_create , buffers , (uint32_t * )log_bufs_size ) != 0 ) {
242256 goto log_init_failed ;
@@ -252,14 +266,20 @@ esp_err_t esp_bt_controller_log_init(void)
252266ctrl_level_init_failed :
253267#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
254268 r_ble_log_deinit_simple ();
255- #else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
269+ #elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
270+ r_ble_log_deinit_simple ();
271+ #else
256272 r_ble_log_deinit_async ();
257- #endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
273+ #endif
258274log_init_failed :
259275#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
260276 ble_log_spi_out_deinit ();
261277spi_out_init_failed :
262278#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
279+ #if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
280+ ble_log_uhci_out_deinit ();
281+ uhci_out_init_failed :
282+ #endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
263283 return ESP_FAIL ;
264284}
265285
@@ -269,11 +289,17 @@ void esp_bt_controller_log_deinit(void)
269289 ble_log_spi_out_deinit ();
270290#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
271291
292+ #if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
293+ ble_log_uhci_out_deinit ();
294+ #endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
295+
272296#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
273297 r_ble_log_deinit_simple ();
274- #else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
298+ #elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
299+ r_ble_log_deinit_simple ();
300+ #else
275301 r_ble_log_deinit_async ();
276- #endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
302+ #endif
277303
278304 log_is_inited = false;
279305}
@@ -1412,7 +1438,7 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
14121438}
14131439
14141440#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
1415- #if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
1441+ #if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && ! CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
14161442static void esp_bt_controller_log_interface (uint32_t len , const uint8_t * addr , uint32_t len_append , const uint8_t * addr_append , uint32_t flag )
14171443{
14181444 bool end = (flag & BIT (BLE_LOG_INTERFACE_FLAG_END ));
@@ -1434,17 +1460,21 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, u
14341460 portEXIT_CRITICAL_SAFE (& spinlock );
14351461#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
14361462}
1437- #endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
1463+ #endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
14381464
14391465void esp_ble_controller_log_dump_all (bool output )
14401466{
14411467#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
14421468 ble_log_spi_out_dump_all ();
14431469#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
14441470
1471+ #if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
1472+ ble_log_uhci_out_dump_all ();
1473+ #endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
1474+
14451475#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
14461476 esp_bt_read_ctrl_log_from_flash (output );
1447- #elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
1477+ #elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && ! CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
14481478 portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED ;
14491479 portENTER_CRITICAL_SAFE (& spinlock );
14501480 esp_panic_handler_feed_wdts ();
0 commit comments