瀏覽代碼

hal: remove usages of esp_log in HAL

SalimTerryLi 4 年之前
父節點
當前提交
6af8d2edee
共有 3 個文件被更改,包括 13 次插入8 次删除
  1. 0 1
      components/hal/esp32s2/adc_hal.c
  2. 6 0
      components/hal/platform_port/include/hal/log.h
  3. 7 7
      components/hal/sdio_slave_hal.c

+ 0 - 1
components/hal/esp32s2/adc_hal.c

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

+ 6 - 0
components/hal/platform_port/include/hal/log.h

@@ -21,3 +21,9 @@
 #define HAL_LOGI(...)    ESP_LOGI(__VA_ARGS__)
 #define HAL_LOGD(...)    ESP_LOGD(__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__)

+ 7 - 7
components/hal/sdio_slave_hal.c

@@ -325,11 +325,11 @@ static void send_new_packet(sdio_slave_context_t *hal)
 
     // update pkt_len register to allow host reading.
     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);
 
-    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)
@@ -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);
 
     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;
     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)
 {
-    ESP_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, "=> %p: size: %d(%d), eof: %d, owner: %d", item, item->size, item->length, item->eof, item->owner);
+    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)
 {
     int cnt = 0;
     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) {
         cnt++;
         show_queue_item(item);
     }
-    ESP_EARLY_LOGI(TAG, "total: %d", cnt);
+    HAL_EARLY_LOGI(TAG, "total: %d", cnt);
 }
 
 /*---------------------------------------------------------------------------