@@ -231,6 +231,7 @@ static int spi_out_init_trans(spi_out_trans_cb_t **trans_cb, uint16_t buf_size)
231231 // Initialization
232232 (* trans_cb )-> buf_size = buf_size ;
233233 (* trans_cb )-> trans .tx_buffer = buf ;
234+ (* trans_cb )-> trans .user = (void * )(* trans_cb );
234235 return 0 ;
235236}
236237
@@ -252,7 +253,7 @@ static void spi_out_deinit_trans(spi_out_trans_cb_t **trans_cb)
252253IRAM_ATTR static void spi_out_tx_done_cb (spi_transaction_t * ret_trans )
253254{
254255 last_tx_done_ts = esp_timer_get_time ();
255- spi_out_trans_cb_t * trans_cb = __containerof ( ret_trans , spi_out_trans_cb_t , trans ) ;
256+ spi_out_trans_cb_t * trans_cb = ( spi_out_trans_cb_t * ) ret_trans -> user ;
256257 trans_cb -> length = 0 ;
257258 trans_cb -> flag = TRANS_CB_FLAG_AVAILABLE ;
258259}
@@ -989,6 +990,17 @@ void ble_log_spi_out_ts_sync_stop(void)
989990IRAM_ATTR void ble_log_spi_out_ll_write (uint32_t len , const uint8_t * addr , uint32_t len_append ,
990991 const uint8_t * addr_append , uint32_t flag )
991992{
993+ // Raw logs will come in case of assert, shall be printed to console directly
994+ if (flag & BIT (LL_LOG_FLAG_RAW )) {
995+ if (len && addr ) {
996+ for (uint32_t i = 0 ; i < len ; i ++ ) { esp_rom_printf ("%02x " , addr [i ]); }
997+ }
998+ if (len_append && addr_append ) {
999+ for (uint32_t i = 0 ; i < len_append ; i ++ ) { esp_rom_printf ("%02x " , addr_append [i ]); }
1000+ }
1001+ if (flag & BIT (LL_LOG_FLAG_END )) { esp_rom_printf ("\n" ); }
1002+ }
1003+
9921004 if (!ll_log_inited ) {
9931005 return ;
9941006 }
0 commit comments