Skip to content

Commit 13150fb

Browse files
committed
Replace deprecated defines with the new ones
- Replace xTimerHandle with TimerHandle_t - Replace portTickType with TickType_t - Replace portTICK_RATE_MS with portTICK_PERIOD_MS
1 parent e3573c8 commit 13150fb

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

components/button/button/button.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct button_dev{
6565
#define BUTTON_GLITCH_FILTER_TIME_MS CONFIG_IO_GLITCH_FILTER_TIME_MS
6666
static const char* TAG = "button";
6767

68-
static void button_press_cb(xTimerHandle tmr)
68+
static void button_press_cb(TimerHandle_t tmr)
6969
{
7070
button_cb_t* btn_cb = (button_cb_t*) pvTimerGetTimerID(tmr);
7171
button_dev_t* btn = btn_cb->pbtn;
@@ -82,7 +82,7 @@ static void button_press_cb(xTimerHandle tmr)
8282
}
8383
}
8484

85-
static void button_tap_psh_cb(xTimerHandle tmr)
85+
static void button_tap_psh_cb(TimerHandle_t tmr)
8686
{
8787
button_cb_t* btn_cb = (button_cb_t*) pvTimerGetTimerID(tmr);
8888
button_dev_t* btn = btn_cb->pbtn;
@@ -108,7 +108,7 @@ static void button_tap_psh_cb(xTimerHandle tmr)
108108
}
109109
}
110110

111-
static void button_tap_rls_cb(xTimerHandle tmr)
111+
static void button_tap_rls_cb(TimerHandle_t tmr)
112112
{
113113
button_cb_t* btn_cb = (button_cb_t*) pvTimerGetTimerID(tmr);
114114
button_dev_t* btn = btn_cb->pbtn;
@@ -144,7 +144,7 @@ static void button_tap_rls_cb(xTimerHandle tmr)
144144
}
145145
}
146146

147-
static void button_press_serial_cb(xTimerHandle tmr)
147+
static void button_press_serial_cb(TimerHandle_t tmr)
148148
{
149149
button_dev_t* btn = (button_dev_t*) pvTimerGetTimerID(tmr);
150150
if (btn->press_serial_cb.cb) {
@@ -185,7 +185,7 @@ static void button_gpio_isr_handler(void* arg)
185185
}
186186
}
187187

188-
static void button_free_tmr(xTimerHandle* tmr)
188+
static void button_free_tmr(TimerHandle_t* tmr)
189189
{
190190
if (tmr && *tmr) {
191191
xTimerStop(*tmr, portMAX_DELAY);
@@ -295,22 +295,22 @@ esp_err_t iot_button_set_evt_cb(button_handle_t btn_handle, button_cb_type_t typ
295295
if (type == BUTTON_CB_PUSH) {
296296
btn->tap_psh_cb.arg = arg;
297297
btn->tap_psh_cb.cb = cb;
298-
btn->tap_psh_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_RATE_MS;
298+
btn->tap_psh_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_PERIOD_MS;
299299
btn->tap_psh_cb.pbtn = btn;
300300
xTimerChangePeriod(btn->tap_psh_cb.tmr, btn->tap_psh_cb.interval, portMAX_DELAY);
301301
} else if (type == BUTTON_CB_RELEASE) {
302302
btn->tap_rls_cb.arg = arg;
303303
btn->tap_rls_cb.cb = cb;
304-
btn->tap_rls_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_RATE_MS;
304+
btn->tap_rls_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_PERIOD_MS;
305305
btn->tap_rls_cb.pbtn = btn;
306306
xTimerChangePeriod(btn->tap_rls_cb.tmr, btn->tap_psh_cb.interval, portMAX_DELAY);
307307
} else if (type == BUTTON_CB_TAP) {
308308
btn->tap_short_cb.arg = arg;
309309
btn->tap_short_cb.cb = cb;
310-
btn->tap_short_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_RATE_MS;
310+
btn->tap_short_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_PERIOD_MS;
311311
btn->tap_short_cb.pbtn = btn;
312312
} else if (type == BUTTON_CB_SERIAL) {
313-
iot_button_set_serial_cb(btn_handle, 1, 1000 / portTICK_RATE_MS, cb, arg);
313+
iot_button_set_serial_cb(btn_handle, 1, 1000 / portTICK_PERIOD_MS, cb, arg);
314314
}
315315
return ESP_OK;
316316
}

components/esp_rainmaker/src/console/esp_rmaker_console.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static void scli_task(void *arg)
5757
memset(linebuf, 0, sizeof(linebuf));
5858
i = 0;
5959
do {
60-
ret = xQueueReceive(uart_queue, (void * )&event, (portTickType)portMAX_DELAY);
60+
ret = xQueueReceive(uart_queue, (void * )&event, (TickType_t)portMAX_DELAY);
6161
if (ret != pdPASS) {
6262
if(stop == 1) {
6363
break;

components/esp_rainmaker/src/core/esp_rmaker_local_ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static esp_err_t __esp_rmaker_start_local_ctrl_service(const char *serv_name)
327327

328328
/* update the global status */
329329
g_local_ctrl_is_started = true;
330-
esp_rmaker_post_event(RMAKER_EVENT_LOCAL_CTRL_STARTED, serv_name, strlen(serv_name) + 1);
330+
esp_rmaker_post_event(RMAKER_EVENT_LOCAL_CTRL_STARTED, (void *)serv_name, strlen(serv_name) + 1);
331331
return ESP_OK;
332332
}
333333

0 commit comments

Comments
 (0)