11
11
12
12
#include "esp_bit_defs.h"
13
13
#include "esp_check.h"
14
- #include "log_ .h"
14
+ #include "esp_log .h"
15
15
16
16
#include "esp_io_expander.h"
17
17
@@ -36,7 +36,7 @@ esp_err_t esp_io_expander_set_dir(esp_io_expander_handle_t handle, uint32_t pin_
36
36
{
37
37
ESP_RETURN_ON_FALSE (handle , ESP_ERR_INVALID_ARG , TAG , "Invalid handle" );
38
38
if (pin_num_mask >= BIT64 (VALID_IO_COUNT (handle ))) {
39
- log_w (TAG , "Pin num mask out of range, bit higher than %d won't work" , VALID_IO_COUNT (handle ) - 1 );
39
+ ESP_LOGW (TAG , "Pin num mask out of range, bit higher than %d won't work" , VALID_IO_COUNT (handle ) - 1 );
40
40
}
41
41
42
42
bool is_output = (direction == IO_EXPANDER_OUTPUT ) ? true : false;
@@ -64,7 +64,7 @@ esp_err_t esp_io_expander_set_level(esp_io_expander_handle_t handle, uint32_t pi
64
64
{
65
65
ESP_RETURN_ON_FALSE (handle , ESP_ERR_INVALID_ARG , TAG , "Invalid handle" );
66
66
if (pin_num_mask >= BIT64 (VALID_IO_COUNT (handle ))) {
67
- log_w (TAG , "Pin num mask out of range, bit higher than %d won't work" , VALID_IO_COUNT (handle ) - 1 );
67
+ ESP_LOGW (TAG , "Pin num mask out of range, bit higher than %d won't work" , VALID_IO_COUNT (handle ) - 1 );
68
68
}
69
69
70
70
uint32_t dir_reg , dir_bit ;
@@ -79,7 +79,7 @@ esp_err_t esp_io_expander_set_level(esp_io_expander_handle_t handle, uint32_t pi
79
79
if ((dir_bit && handle -> config .flags .dir_out_bit_zero ) || (!dir_bit && !handle -> config .flags .dir_out_bit_zero )) {
80
80
/* 1. 1 && Set 1 to input */
81
81
/* 2. 0 && Set 0 to input */
82
- log_e (TAG , "Pin[%d] can't set level in input mode" , i );
82
+ ESP_LOGE (TAG , "Pin[%d] can't set level in input mode" , i );
83
83
return ESP_ERR_INVALID_STATE ;
84
84
}
85
85
}
@@ -112,7 +112,7 @@ esp_err_t esp_io_expander_get_level(esp_io_expander_handle_t handle, uint32_t pi
112
112
ESP_RETURN_ON_FALSE (handle , ESP_ERR_INVALID_ARG , TAG , "Invalid handle" );
113
113
ESP_RETURN_ON_FALSE (level_mask , ESP_ERR_INVALID_ARG , TAG , "Invalid level" );
114
114
if (pin_num_mask >= BIT64 (VALID_IO_COUNT (handle ))) {
115
- log_w (TAG , "Pin num mask out of range, bit higher than %d won't work" , VALID_IO_COUNT (handle ) - 1 );
115
+ ESP_LOGW (TAG , "Pin num mask out of range, bit higher than %d won't work" , VALID_IO_COUNT (handle ) - 1 );
116
116
}
117
117
118
118
uint32_t input_reg ;
@@ -151,7 +151,7 @@ esp_err_t esp_io_expander_print_state(esp_io_expander_handle_t handle)
151
151
}
152
152
153
153
for (int i = 0 ; i < io_count ; i ++ ) {
154
- log_i (TAG , "Index[%d] | Dir[%s] | In[%d] | Out[%d]" , i , (dir_reg & BIT (i )) ? "Out" : "In" ,
154
+ ESP_LOGI (TAG , "Index[%d] | Dir[%s] | In[%d] | Out[%d]" , i , (dir_reg & BIT (i )) ? "Out" : "In" ,
155
155
(input_reg & BIT (i )) ? 1 : 0 , (output_reg & BIT (i )) ? 1 : 0 );
156
156
}
157
157
0 commit comments