Merge branch 'refactor/remove_usage_of_logging_in_hal' into 'master'

hal: remove usages of esp_log in HAL

Closes IDF-2159

See merge request espressif/esp-idf!15017
This commit is contained in:
Li Hang Fan 2021-09-01 10:53:38 +00:00
commit b1f851b8f8
3 changed files with 13 additions and 8 deletions

View File

@ -18,7 +18,6 @@
#include "hal/adc_hal.h" #include "hal/adc_hal.h"
#include "hal/adc_types.h" #include "hal/adc_types.h"
#include "hal/adc_hal_conf.h" #include "hal/adc_hal_conf.h"
#include "esp_log.h"
/*--------------------------------------------------------------- /*---------------------------------------------------------------
Digital controller setting Digital controller setting

View File

@ -21,3 +21,9 @@
#define HAL_LOGI(...) ESP_LOGI(__VA_ARGS__) #define HAL_LOGI(...) ESP_LOGI(__VA_ARGS__)
#define HAL_LOGD(...) ESP_LOGD(__VA_ARGS__) #define HAL_LOGD(...) ESP_LOGD(__VA_ARGS__)
#define HAL_LOGV(...) ESP_LOGV(__VA_ARGS__) #define HAL_LOGV(...) ESP_LOGV(__VA_ARGS__)
#define HAL_EARLY_LOGE(...) ESP_EARLY_LOGE(__VA_ARGS__)
#define HAL_EARLY_LOGW(...) ESP_EARLY_LOGW(__VA_ARGS__)
#define HAL_EARLY_LOGI(...) ESP_EARLY_LOGI(__VA_ARGS__)
#define HAL_EARLY_LOGD(...) ESP_EARLY_LOGD(__VA_ARGS__)
#define HAL_EARLY_LOGV(...) ESP_EARLY_LOGV(__VA_ARGS__)

View File

@ -325,11 +325,11 @@ static void send_new_packet(sdio_slave_context_t *hal)
// update pkt_len register to allow host reading. // update pkt_len register to allow host reading.
sdio_slave_ll_send_write_len(hal->slc, end_desc->pkt_len); sdio_slave_ll_send_write_len(hal->slc, end_desc->pkt_len);
ESP_EARLY_LOGV(TAG, "send_length_write: %d, last_len: %08X", end_desc->pkt_len, sdio_slave_ll_send_read_len(hal->host)); HAL_EARLY_LOGV(TAG, "send_length_write: %d, last_len: %08X", end_desc->pkt_len, sdio_slave_ll_send_read_len(hal->host));
send_set_state(hal, STATE_SENDING); send_set_state(hal, STATE_SENDING);
ESP_EARLY_LOGD(TAG, "restart new send: %p->%p, pkt_len: %d", start_desc, end_desc, end_desc->pkt_len); HAL_EARLY_LOGD(TAG, "restart new send: %p->%p, pkt_len: %d", start_desc, end_desc, end_desc->pkt_len);
} }
static esp_err_t send_check_new_packet(sdio_slave_context_t *hal) static esp_err_t send_check_new_packet(sdio_slave_context_t *hal)
@ -374,7 +374,7 @@ esp_err_t sdio_slave_hal_send_reset_counter(sdio_slave_context_t* hal)
"reset counter when transmission started", ESP_ERR_INVALID_STATE); "reset counter when transmission started", ESP_ERR_INVALID_STATE);
sdio_slave_ll_send_write_len(hal->slc, 0); sdio_slave_ll_send_write_len(hal->slc, 0);
ESP_EARLY_LOGV(TAG, "last_len: %08X", sdio_slave_ll_send_read_len(hal->host)); HAL_EARLY_LOGV(TAG, "last_len: %08X", sdio_slave_ll_send_read_len(hal->host));
hal->tail_pkt_len = 0; hal->tail_pkt_len = 0;
sdio_slave_hal_send_desc_t *desc = hal->in_flight_head; sdio_slave_hal_send_desc_t *desc = hal->in_flight_head;
@ -674,20 +674,20 @@ void sdio_slave_hal_load_buf(sdio_slave_context_t *hal, lldesc_t *desc)
static inline void show_queue_item(lldesc_t *item) static inline void show_queue_item(lldesc_t *item)
{ {
ESP_EARLY_LOGI(TAG, "=> %p: size: %d(%d), eof: %d, owner: %d", item, item->size, item->length, item->eof, item->owner); HAL_EARLY_LOGI(TAG, "=> %p: size: %d(%d), eof: %d, owner: %d", item, item->size, item->length, item->eof, item->owner);
ESP_EARLY_LOGI(TAG, " buf: %p, stqe_next: %p", item->buf, item->qe.stqe_next); HAL_EARLY_LOGI(TAG, " buf: %p, stqe_next: %p", item->buf, item->qe.stqe_next);
} }
static void __attribute((unused)) dump_queue(sdio_slave_hal_recv_stailq_t *queue) static void __attribute((unused)) dump_queue(sdio_slave_hal_recv_stailq_t *queue)
{ {
int cnt = 0; int cnt = 0;
lldesc_t *item = NULL; lldesc_t *item = NULL;
ESP_EARLY_LOGI(TAG, ">>>>> first: %p, last: %p <<<<<", queue->stqh_first, queue->stqh_last); HAL_EARLY_LOGI(TAG, ">>>>> first: %p, last: %p <<<<<", queue->stqh_first, queue->stqh_last);
STAILQ_FOREACH(item, queue, qe) { STAILQ_FOREACH(item, queue, qe) {
cnt++; cnt++;
show_queue_item(item); show_queue_item(item);
} }
ESP_EARLY_LOGI(TAG, "total: %d", cnt); HAL_EARLY_LOGI(TAG, "total: %d", cnt);
} }
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------