freertos: Remove legacy data types
This commit removes the usage of all legacy FreeRTOS data types that are exposed via configENABLE_BACKWARD_COMPATIBILITY. Legacy types can still be used by enabling CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -104,12 +104,12 @@ static int notify_value_count = 0;
|
||||
static uint16_t count = SPP_IDX_NB;
|
||||
static esp_gattc_db_elem_t *db = NULL;
|
||||
static esp_ble_gap_cb_param_t scan_rst;
|
||||
static xQueueHandle cmd_reg_queue = NULL;
|
||||
static QueueHandle_t cmd_reg_queue = NULL;
|
||||
QueueHandle_t spp_uart_queue = NULL;
|
||||
|
||||
#ifdef SUPPORT_HEARTBEAT
|
||||
static uint8_t heartbeat_s[9] = {'E','s','p','r','e','s','s','i','f'};
|
||||
static xQueueHandle cmd_heartbeat_queue = NULL;
|
||||
static QueueHandle_t cmd_heartbeat_queue = NULL;
|
||||
#endif
|
||||
|
||||
static esp_bt_uuid_t spp_service_uuid = {
|
||||
@@ -551,7 +551,7 @@ void uart_task(void *pvParameters)
|
||||
uart_event_t event;
|
||||
for (;;) {
|
||||
//Waiting for UART event.
|
||||
if (xQueueReceive(spp_uart_queue, (void * )&event, (portTickType)portMAX_DELAY)) {
|
||||
if (xQueueReceive(spp_uart_queue, (void * )&event, (TickType_t)portMAX_DELAY)) {
|
||||
switch (event.type) {
|
||||
//Event of UART receving data
|
||||
case UART_DATA:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -54,10 +54,10 @@ static uint16_t spp_mtu_size = 23;
|
||||
static uint16_t spp_conn_id = 0xffff;
|
||||
static esp_gatt_if_t spp_gatts_if = 0xff;
|
||||
QueueHandle_t spp_uart_queue = NULL;
|
||||
static xQueueHandle cmd_cmd_queue = NULL;
|
||||
static QueueHandle_t cmd_cmd_queue = NULL;
|
||||
|
||||
#ifdef SUPPORT_HEARTBEAT
|
||||
static xQueueHandle cmd_heartbeat_queue = NULL;
|
||||
static QueueHandle_t cmd_heartbeat_queue = NULL;
|
||||
static uint8_t heartbeat_s[9] = {'E','s','p','r','e','s','s','i','f'};
|
||||
static bool enable_heart_ntf = false;
|
||||
static uint8_t heartbeat_count_num = 0;
|
||||
@@ -316,7 +316,7 @@ void uart_task(void *pvParameters)
|
||||
|
||||
for (;;) {
|
||||
//Waiting for UART event.
|
||||
if (xQueueReceive(spp_uart_queue, (void * )&event, (portTickType)portMAX_DELAY)) {
|
||||
if (xQueueReceive(spp_uart_queue, (void * )&event, (TickType_t)portMAX_DELAY)) {
|
||||
switch (event.type) {
|
||||
//Event of UART receving data
|
||||
case UART_DATA:
|
||||
|
||||
@@ -72,7 +72,7 @@ static const char *s_a2d_audio_state_str[] = {"Suspended", "Stopped", "Started"}
|
||||
static esp_avrc_rn_evt_cap_mask_t s_avrc_peer_rn_cap;
|
||||
/* AVRC target notification capability bit mask */
|
||||
static _lock_t s_volume_lock;
|
||||
static xTaskHandle s_vcs_task_hdl = NULL; /* handle for volume change simulation task */
|
||||
static TaskHandle_t s_vcs_task_hdl = NULL; /* handle for volume change simulation task */
|
||||
static uint8_t s_volume = 0; /* local volume value */
|
||||
static bool s_volume_notify; /* notify volume change or not */
|
||||
|
||||
@@ -183,7 +183,7 @@ static void volume_change_simulation(void *arg)
|
||||
|
||||
for (;;) {
|
||||
/* volume up locally every 10 seconds */
|
||||
vTaskDelay(10000 / portTICK_RATE_MS);
|
||||
vTaskDelay(10000 / portTICK_PERIOD_MS);
|
||||
uint8_t volume = (s_volume + 5) & 0x7f;
|
||||
volume_set_by_local_host(volume);
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ static void bt_app_work_dispatched(bt_app_msg_t *msg);
|
||||
* STATIC VARIABLE DEFINITIONS
|
||||
******************************/
|
||||
|
||||
static xQueueHandle s_bt_app_task_queue = NULL; /* handle of work queue */
|
||||
static xTaskHandle s_bt_app_task_handle = NULL; /* handle of application task */
|
||||
static xTaskHandle s_bt_i2s_task_handle = NULL; /* handle of I2S task */
|
||||
static QueueHandle_t s_bt_app_task_queue = NULL; /* handle of work queue */
|
||||
static TaskHandle_t s_bt_app_task_handle = NULL; /* handle of application task */
|
||||
static TaskHandle_t s_bt_i2s_task_handle = NULL; /* handle of I2S task */
|
||||
static RingbufHandle_t s_ringbuf_i2s = NULL; /* handle of ringbuffer for I2S */
|
||||
|
||||
/*******************************
|
||||
@@ -50,7 +50,7 @@ static bool bt_app_send_msg(bt_app_msg_t *msg)
|
||||
}
|
||||
|
||||
/* send the message to work queue */
|
||||
if (xQueueSend(s_bt_app_task_queue, msg, 10 / portTICK_RATE_MS) != pdTRUE) {
|
||||
if (xQueueSend(s_bt_app_task_queue, msg, 10 / portTICK_PERIOD_MS) != pdTRUE) {
|
||||
ESP_LOGE(BT_APP_CORE_TAG, "%s xQueue send failed", __func__);
|
||||
return false;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ static void bt_app_task_handler(void *arg)
|
||||
|
||||
for (;;) {
|
||||
/* receive message from work queue and handle it */
|
||||
if (pdTRUE == xQueueReceive(s_bt_app_task_queue, &msg, (portTickType)portMAX_DELAY)) {
|
||||
if (pdTRUE == xQueueReceive(s_bt_app_task_queue, &msg, (TickType_t)portMAX_DELAY)) {
|
||||
ESP_LOGD(BT_APP_CORE_TAG, "%s, signal: 0x%x, event: 0x%x", __func__, msg.sig, msg.event);
|
||||
|
||||
switch (msg.sig) {
|
||||
@@ -97,7 +97,7 @@ static void bt_i2s_task_handler(void *arg)
|
||||
|
||||
for (;;) {
|
||||
/* receive data from ringbuffer and write it to I2S DMA transmit buffer */
|
||||
data = (uint8_t *)xRingbufferReceive(s_ringbuf_i2s, &item_size, (portTickType)portMAX_DELAY);
|
||||
data = (uint8_t *)xRingbufferReceive(s_ringbuf_i2s, &item_size, (TickType_t)portMAX_DELAY);
|
||||
if (item_size != 0){
|
||||
i2s_write(0, data, item_size, &bytes_written, portMAX_DELAY);
|
||||
vRingbufferReturnItem(s_ringbuf_i2s, (void *)data);
|
||||
@@ -176,7 +176,7 @@ void bt_i2s_task_shut_down(void)
|
||||
|
||||
size_t write_ringbuf(const uint8_t *data, size_t size)
|
||||
{
|
||||
BaseType_t done = xRingbufferSend(s_ringbuf_i2s, (void *)data, size, (portTickType)portMAX_DELAY);
|
||||
BaseType_t done = xRingbufferSend(s_ringbuf_i2s, (void *)data, size, (TickType_t)portMAX_DELAY);
|
||||
|
||||
return done ? size : 0;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ static void bt_app_work_dispatched(bt_app_msg_t *msg);
|
||||
/*********************************
|
||||
* STATIC VARIABLE DEFINITIONS
|
||||
********************************/
|
||||
static xQueueHandle s_bt_app_task_queue = NULL;
|
||||
static xTaskHandle s_bt_app_task_handle = NULL;
|
||||
static QueueHandle_t s_bt_app_task_queue = NULL;
|
||||
static TaskHandle_t s_bt_app_task_handle = NULL;
|
||||
|
||||
/*********************************
|
||||
* STATIC FUNCTION DEFINITIONS
|
||||
@@ -41,7 +41,7 @@ static bool bt_app_send_msg(bt_app_msg_t *msg)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pdTRUE != xQueueSend(s_bt_app_task_queue, msg, 10 / portTICK_RATE_MS)) {
|
||||
if (pdTRUE != xQueueSend(s_bt_app_task_queue, msg, 10 / portTICK_PERIOD_MS)) {
|
||||
ESP_LOGE(BT_APP_CORE_TAG, "%s xQueue send failed", __func__);
|
||||
return false;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ static void bt_app_task_handler(void *arg)
|
||||
|
||||
for (;;) {
|
||||
/* receive message from work queue and handle it */
|
||||
if (pdTRUE == xQueueReceive(s_bt_app_task_queue, &msg, (portTickType)portMAX_DELAY)) {
|
||||
if (pdTRUE == xQueueReceive(s_bt_app_task_queue, &msg, (TickType_t)portMAX_DELAY)) {
|
||||
ESP_LOGD(BT_APP_CORE_TAG, "%s, signal: 0x%x, event: 0x%x", __func__, msg.sig, msg.event);
|
||||
|
||||
switch (msg.sig) {
|
||||
|
||||
@@ -325,7 +325,7 @@ static void bt_av_hdl_stack_evt(uint16_t event, void *p_param)
|
||||
/* create and start heart beat timer */
|
||||
do {
|
||||
int tmr_id = 0;
|
||||
s_tmr = xTimerCreate("connTmr", (10000 / portTICK_RATE_MS),
|
||||
s_tmr = xTimerCreate("connTmr", (10000 / portTICK_PERIOD_MS),
|
||||
pdTRUE, (void *) &tmr_id, bt_app_a2d_heart_beat);
|
||||
xTimerStart(s_tmr, portMAX_DELAY);
|
||||
} while (0);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -26,7 +26,7 @@ typedef struct
|
||||
esp_hidd_qos_param_t both_qos;
|
||||
uint8_t protocol_mode;
|
||||
SemaphoreHandle_t mouse_mutex;
|
||||
xTaskHandle mouse_task_hdl;
|
||||
TaskHandle_t mouse_task_hdl;
|
||||
uint8_t buffer[4];
|
||||
int8_t x_dir;
|
||||
} local_param_t;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ static void console_uart_task(void *pvParameters)
|
||||
|
||||
for (;;) {
|
||||
//Waiting for UART event.
|
||||
if (xQueueReceive(uart_queue, (void * )&event, (portTickType)portMAX_DELAY)) {
|
||||
if (xQueueReceive(uart_queue, (void * )&event, (TickType_t)portMAX_DELAY)) {
|
||||
switch (event.type) {
|
||||
//Event of UART receving data
|
||||
case UART_DATA:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -19,8 +19,8 @@ static void spp_task_task_handler(void *arg);
|
||||
static bool spp_task_send_msg(spp_task_msg_t *msg);
|
||||
static void spp_task_work_dispatched(spp_task_msg_t *msg);
|
||||
|
||||
static xQueueHandle spp_task_task_queue = NULL;
|
||||
static xTaskHandle spp_task_task_handle = NULL;
|
||||
static QueueHandle_t spp_task_task_queue = NULL;
|
||||
static TaskHandle_t spp_task_task_handle = NULL;
|
||||
|
||||
bool spp_task_work_dispatch(spp_task_cb_t p_cback, uint16_t event, void *p_params, int param_len, spp_task_copy_cb_t p_copy_cback)
|
||||
{
|
||||
@@ -55,7 +55,7 @@ static bool spp_task_send_msg(spp_task_msg_t *msg)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xQueueSend(spp_task_task_queue, msg, 10 / portTICK_RATE_MS) != pdTRUE) {
|
||||
if (xQueueSend(spp_task_task_queue, msg, 10 / portTICK_PERIOD_MS) != pdTRUE) {
|
||||
ESP_LOGE(SPP_TASK_TAG, "%s xQueue send failed", __func__);
|
||||
return false;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ static void spp_task_task_handler(void *arg)
|
||||
{
|
||||
spp_task_msg_t msg;
|
||||
for (;;) {
|
||||
if (pdTRUE == xQueueReceive(spp_task_task_queue, &msg, (portTickType)portMAX_DELAY)) {
|
||||
if (pdTRUE == xQueueReceive(spp_task_task_queue, &msg, (TickType_t)portMAX_DELAY)) {
|
||||
ESP_LOGD(SPP_TASK_TAG, "%s, sig 0x%x, 0x%x", __func__, msg.sig, msg.event);
|
||||
switch (msg.sig) {
|
||||
case SPP_TASK_SIG_WORK_DISPATCH:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -19,8 +19,8 @@ static void spp_task_task_handler(void *arg);
|
||||
static bool spp_task_send_msg(spp_task_msg_t *msg);
|
||||
static void spp_task_work_dispatched(spp_task_msg_t *msg);
|
||||
|
||||
static xQueueHandle spp_task_task_queue = NULL;
|
||||
static xTaskHandle spp_task_task_handle = NULL;
|
||||
static QueueHandle_t spp_task_task_queue = NULL;
|
||||
static TaskHandle_t spp_task_task_handle = NULL;
|
||||
|
||||
bool spp_task_work_dispatch(spp_task_cb_t p_cback, uint16_t event, void *p_params, int param_len, spp_task_copy_cb_t p_copy_cback)
|
||||
{
|
||||
@@ -55,7 +55,7 @@ static bool spp_task_send_msg(spp_task_msg_t *msg)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xQueueSend(spp_task_task_queue, msg, 10 / portTICK_RATE_MS) != pdTRUE) {
|
||||
if (xQueueSend(spp_task_task_queue, msg, 10 / portTICK_PERIOD_MS) != pdTRUE) {
|
||||
ESP_LOGE(SPP_TASK_TAG, "%s xQueue send failed", __func__);
|
||||
return false;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ static void spp_task_task_handler(void *arg)
|
||||
{
|
||||
spp_task_msg_t msg;
|
||||
for (;;) {
|
||||
if (pdTRUE == xQueueReceive(spp_task_task_queue, &msg, (portTickType)portMAX_DELAY)) {
|
||||
if (pdTRUE == xQueueReceive(spp_task_task_queue, &msg, (TickType_t)portMAX_DELAY)) {
|
||||
ESP_LOGD(SPP_TASK_TAG, "%s, sig 0x%x, 0x%x", __func__, msg.sig, msg.event);
|
||||
switch (msg.sig) {
|
||||
case SPP_TASK_SIG_WORK_DISPATCH:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -19,8 +19,8 @@ static void bt_app_task_handler(void *arg);
|
||||
static bool bt_app_send_msg(bt_app_msg_t *msg);
|
||||
static void bt_app_work_dispatched(bt_app_msg_t *msg);
|
||||
|
||||
static xQueueHandle bt_app_task_queue = NULL;
|
||||
static xTaskHandle bt_app_task_handle = NULL;
|
||||
static QueueHandle_t bt_app_task_queue = NULL;
|
||||
static TaskHandle_t bt_app_task_handle = NULL;
|
||||
|
||||
bool bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, void *p_params, int param_len, bt_app_copy_cb_t p_copy_cback)
|
||||
{
|
||||
@@ -54,7 +54,7 @@ static bool bt_app_send_msg(bt_app_msg_t *msg)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xQueueSend(bt_app_task_queue, msg, 10 / portTICK_RATE_MS) != pdTRUE) {
|
||||
if (xQueueSend(bt_app_task_queue, msg, 10 / portTICK_PERIOD_MS) != pdTRUE) {
|
||||
ESP_LOGE(BT_APP_CORE_TAG, "%s xQueue send failed", __func__);
|
||||
return false;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ static void bt_app_task_handler(void *arg)
|
||||
{
|
||||
bt_app_msg_t msg;
|
||||
for (;;) {
|
||||
if (pdTRUE == xQueueReceive(bt_app_task_queue, &msg, (portTickType)portMAX_DELAY)) {
|
||||
if (pdTRUE == xQueueReceive(bt_app_task_queue, &msg, (TickType_t)portMAX_DELAY)) {
|
||||
ESP_LOGD(BT_APP_CORE_TAG, "%s, sig 0x%x, 0x%x", __func__, msg.sig, msg.event);
|
||||
switch (msg.sig) {
|
||||
case BT_APP_SIG_WORK_DISPATCH:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -141,8 +141,8 @@ static uint64_t s_time_new, s_time_old;
|
||||
static esp_timer_handle_t s_periodic_timer;
|
||||
static uint64_t s_last_enter_time, s_now_enter_time;
|
||||
static uint64_t s_us_duration;
|
||||
static xSemaphoreHandle s_send_data_Semaphore = NULL;
|
||||
static xTaskHandle s_bt_app_send_data_task_handler = NULL;
|
||||
static SemaphoreHandle_t s_send_data_Semaphore = NULL;
|
||||
static TaskHandle_t s_bt_app_send_data_task_handler = NULL;
|
||||
static esp_hf_audio_state_t s_audio_code;
|
||||
|
||||
static void print_speed(void);
|
||||
@@ -214,7 +214,7 @@ static void bt_app_send_data_task(void *arg)
|
||||
uint32_t item_size = 0;
|
||||
uint8_t *buf = NULL;
|
||||
for (;;) {
|
||||
if (xSemaphoreTake(s_send_data_Semaphore, (portTickType)portMAX_DELAY)) {
|
||||
if (xSemaphoreTake(s_send_data_Semaphore, (TickType_t)portMAX_DELAY)) {
|
||||
s_now_enter_time = esp_timer_get_time();
|
||||
s_us_duration = s_now_enter_time - s_last_enter_time;
|
||||
if(s_audio_code == ESP_HF_AUDIO_STATE_CONNECTED_MSBC) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -19,8 +19,8 @@ static void bt_app_task_handler(void *arg);
|
||||
static bool bt_app_send_msg(bt_app_msg_t *msg);
|
||||
static void bt_app_work_dispatched(bt_app_msg_t *msg);
|
||||
|
||||
static xQueueHandle bt_app_task_queue = NULL;
|
||||
static xTaskHandle bt_app_task_handle = NULL;
|
||||
static QueueHandle_t bt_app_task_queue = NULL;
|
||||
static TaskHandle_t bt_app_task_handle = NULL;
|
||||
|
||||
bool bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, void *p_params, int param_len, bt_app_copy_cb_t p_copy_cback)
|
||||
{
|
||||
@@ -55,7 +55,7 @@ static bool bt_app_send_msg(bt_app_msg_t *msg)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xQueueSend(bt_app_task_queue, msg, 10 / portTICK_RATE_MS) != pdTRUE) {
|
||||
if (xQueueSend(bt_app_task_queue, msg, 10 / portTICK_PERIOD_MS) != pdTRUE) {
|
||||
ESP_LOGE(BT_APP_CORE_TAG, "%s xQueue send failed", __func__);
|
||||
return false;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ static void bt_app_task_handler(void *arg)
|
||||
{
|
||||
bt_app_msg_t msg;
|
||||
for (;;) {
|
||||
if (pdTRUE == xQueueReceive(bt_app_task_queue, &msg, (portTickType)portMAX_DELAY)) {
|
||||
if (pdTRUE == xQueueReceive(bt_app_task_queue, &msg, (TickType_t)portMAX_DELAY)) {
|
||||
ESP_LOGD(BT_APP_CORE_TAG, "%s, sig 0x%x, 0x%x", __func__, msg.sig, msg.event);
|
||||
switch (msg.sig) {
|
||||
case BT_APP_SIG_WORK_DISPATCH:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ static const char *s_a2d_conn_state_str[] = {"Disconnected", "Connecting", "Conn
|
||||
static const char *s_a2d_audio_state_str[] = {"Suspended", "Stopped", "Started"};
|
||||
static esp_avrc_rn_evt_cap_mask_t s_avrc_peer_rn_cap;
|
||||
static _lock_t s_volume_lock;
|
||||
static xTaskHandle s_vcs_task_hdl = NULL;
|
||||
static TaskHandle_t s_vcs_task_hdl = NULL;
|
||||
static uint8_t s_volume = 0;
|
||||
static bool s_volume_notify;
|
||||
|
||||
@@ -314,7 +314,7 @@ static void volume_change_simulation(void *arg)
|
||||
ESP_LOGI(BT_RC_TG_TAG, "start volume change simulation");
|
||||
|
||||
for (;;) {
|
||||
vTaskDelay(10000 / portTICK_RATE_MS);
|
||||
vTaskDelay(10000 / portTICK_PERIOD_MS);
|
||||
|
||||
uint8_t volume = (s_volume + 5) & 0x7f;
|
||||
volume_set_by_local_host(volume);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -21,9 +21,9 @@ static void bt_app_task_handler(void *arg);
|
||||
static bool bt_app_send_msg(bt_app_msg_t *msg);
|
||||
static void bt_app_work_dispatched(bt_app_msg_t *msg);
|
||||
|
||||
static xQueueHandle s_bt_app_task_queue = NULL;
|
||||
static xTaskHandle s_bt_app_task_handle = NULL;
|
||||
static xTaskHandle s_bt_i2s_task_handle = NULL;
|
||||
static QueueHandle_t s_bt_app_task_queue = NULL;
|
||||
static TaskHandle_t s_bt_app_task_handle = NULL;
|
||||
static TaskHandle_t s_bt_i2s_task_handle = NULL;
|
||||
static RingbufHandle_t s_ringbuf_i2s = NULL;;
|
||||
|
||||
bool bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, void *p_params, int param_len, bt_app_copy_cb_t p_copy_cback)
|
||||
@@ -59,7 +59,7 @@ static bool bt_app_send_msg(bt_app_msg_t *msg)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xQueueSend(s_bt_app_task_queue, msg, 10 / portTICK_RATE_MS) != pdTRUE) {
|
||||
if (xQueueSend(s_bt_app_task_queue, msg, 10 / portTICK_PERIOD_MS) != pdTRUE) {
|
||||
ESP_LOGE(BT_APP_CORE_TAG, "%s xQueue send failed", __func__);
|
||||
return false;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ static void bt_app_task_handler(void *arg)
|
||||
{
|
||||
bt_app_msg_t msg;
|
||||
for (;;) {
|
||||
if (pdTRUE == xQueueReceive(s_bt_app_task_queue, &msg, (portTickType)portMAX_DELAY)) {
|
||||
if (pdTRUE == xQueueReceive(s_bt_app_task_queue, &msg, (TickType_t)portMAX_DELAY)) {
|
||||
ESP_LOGD(BT_APP_CORE_TAG, "%s, sig 0x%x, 0x%x", __func__, msg.sig, msg.event);
|
||||
switch (msg.sig) {
|
||||
case BT_APP_SIG_WORK_DISPATCH:
|
||||
@@ -121,7 +121,7 @@ static void bt_i2s_task_handler(void *arg)
|
||||
size_t bytes_written = 0;
|
||||
|
||||
for (;;) {
|
||||
data = (uint8_t *)xRingbufferReceive(s_ringbuf_i2s, &item_size, (portTickType)portMAX_DELAY);
|
||||
data = (uint8_t *)xRingbufferReceive(s_ringbuf_i2s, &item_size, (TickType_t)portMAX_DELAY);
|
||||
if (item_size != 0){
|
||||
i2s_write(0, data, item_size, &bytes_written, portMAX_DELAY);
|
||||
vRingbufferReturnItem(s_ringbuf_i2s,(void *)data);
|
||||
@@ -155,7 +155,7 @@ void bt_i2s_task_shut_down(void)
|
||||
|
||||
size_t write_ringbuf(const uint8_t *data, size_t size)
|
||||
{
|
||||
BaseType_t done = xRingbufferSend(s_ringbuf_i2s, (void *)data, size, (portTickType)portMAX_DELAY);
|
||||
BaseType_t done = xRingbufferSend(s_ringbuf_i2s, (void *)data, size, (TickType_t)portMAX_DELAY);
|
||||
if(done){
|
||||
return size;
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ESP BLE Mesh Example
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#define TAG "CASE"
|
||||
|
||||
xQueueHandle xTaskQueue = 0;
|
||||
QueueHandle_t xTaskQueue = 0;
|
||||
|
||||
static const char *coex_get_case_env(coex_test_env_t *test_env, const char *keyword)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ static void excute_case(void *arg)
|
||||
}
|
||||
|
||||
if (run_case && run_case->func_stop != NULL ) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
run_case->func_stop();
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
@@ -260,7 +260,7 @@ static void run_task(void *arg)
|
||||
run_task_msg_t msg;
|
||||
|
||||
for (;;) {
|
||||
if (pdTRUE == xQueueReceive(xTaskQueue, &msg, (portTickType)portMAX_DELAY)) {
|
||||
if (pdTRUE == xQueueReceive(xTaskQueue, &msg, (TickType_t)portMAX_DELAY)) {
|
||||
if ( msg.case_id < sizeof(tc_case) / sizeof(tc_case[0]) ) {
|
||||
xTaskCreatePinnedToCore(excute_case, tc_case_table->name, 4096, &tc_case_table[msg.case_id], RUN_TASK_PRIORITY, NULL, 0);
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ESP BLE Mesh Example
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ typedef struct run_task_msg {
|
||||
uint8_t case_id;
|
||||
} run_task_msg_t;
|
||||
|
||||
extern xQueueHandle xTaskQueue ;
|
||||
extern QueueHandle_t xTaskQueue ;
|
||||
|
||||
void run_tc_init(void);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ESP BLE Mesh Example
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -422,7 +422,7 @@ static void handle_sync_timeout(void *arg)
|
||||
{
|
||||
static bool run_first = true;
|
||||
if (run_first == true) {
|
||||
xSemaphoreTake((SemaphoreHandle_t)arg, (portTickType)portMAX_DELAY);
|
||||
xSemaphoreTake((SemaphoreHandle_t)arg, (TickType_t)portMAX_DELAY);
|
||||
esp_timer_start_periodic( (esp_timer_handle_t)arg, 1000000);
|
||||
run_first = false;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ extern ble_mesh_node_statistics_t ble_mesh_node_statistics;
|
||||
|
||||
extern SemaphoreHandle_t ble_mesh_node_sema;
|
||||
|
||||
#define SEND_MESSAGE_TIMEOUT (30000/portTICK_RATE_MS)
|
||||
#define SEND_MESSAGE_TIMEOUT (30000/portTICK_PERIOD_MS)
|
||||
|
||||
#define arg_int_to_value(src_msg, dst_msg, message) do { \
|
||||
if (src_msg->count != 0) {\
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -193,7 +193,7 @@ esp_err_t transaction_run(transaction_t *trans)
|
||||
|
||||
// trans->event_group and trans->wait_events will not be changed once trans is created, so we don't need protect them
|
||||
current_bits = xEventGroupWaitBits(trans->event_group, trans->wait_events | TRANSACTION_ABORT_EVENT,
|
||||
1, 0, wait_time/portTICK_RATE_MS);
|
||||
1, 0, wait_time/portTICK_PERIOD_MS);
|
||||
|
||||
xSemaphoreTakeRecursive(trans_mutex, portMAX_DELAY);
|
||||
trans->current_bits |= current_bits;
|
||||
|
||||
@@ -205,7 +205,7 @@ static void board_uart_task(void *p)
|
||||
uint32_t input;
|
||||
|
||||
while (1) {
|
||||
int len = uart_read_bytes(MESH_UART_NUM, data, UART_BUF_SIZE, 100 / portTICK_RATE_MS);
|
||||
int len = uart_read_bytes(MESH_UART_NUM, data, UART_BUF_SIZE, 100 / portTICK_PERIOD_MS);
|
||||
if (len > 0) {
|
||||
input = strtoul((const char *)data, NULL, 16);
|
||||
remote_addr = input & 0xFFFF;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Iperf example - wifi commands
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -161,7 +161,7 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass)
|
||||
reconnect = false;
|
||||
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
|
||||
ESP_ERROR_CHECK( esp_wifi_disconnect() );
|
||||
xEventGroupWaitBits(wifi_event_group, DISCONNECTED_BIT, 0, 1, portTICK_RATE_MS);
|
||||
xEventGroupWaitBits(wifi_event_group, DISCONNECTED_BIT, 0, 1, portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
reconnect = true;
|
||||
@@ -170,7 +170,7 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass)
|
||||
ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &wifi_config) );
|
||||
esp_wifi_connect();
|
||||
|
||||
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_RATE_MS);
|
||||
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_PERIOD_MS);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ static void led_action_thread(void *arg)
|
||||
struct _led_state led = {0};
|
||||
|
||||
while (1) {
|
||||
if (xQueueReceive(led_action_queue, &led, (portTickType)portMAX_DELAY)) {
|
||||
if (xQueueReceive(led_action_queue, &led, (TickType_t)portMAX_DELAY)) {
|
||||
ESP_LOGI(TAG, "%s: pin 0x%04x onoff 0x%02x", __func__, led.pin, led.current);
|
||||
/* If the node is controlled by phone, add a delay when turn on/off led */
|
||||
if (fast_prov_server.primary_role == true) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -68,7 +68,7 @@ struct button_dev{
|
||||
#define BUTTON_GLITCH_FILTER_TIME_MS CONFIG_BUTTON_IO_GLITCH_FILTER_TIME_MS
|
||||
static const char* TAG = "button";
|
||||
|
||||
// static void button_press_cb(xTimerHandle tmr)
|
||||
// static void button_press_cb(TimerHandle_t tmr)
|
||||
static void button_press_cb(void* tmr)
|
||||
{
|
||||
#if !USE_ESP_TIMER
|
||||
@@ -87,7 +87,7 @@ static void button_press_cb(void* tmr)
|
||||
}
|
||||
}
|
||||
|
||||
// static void button_tap_psh_cb(xTimerHandle tmr)
|
||||
// static void button_tap_psh_cb(TimerHandle_t tmr)
|
||||
static void button_tap_psh_cb(void* tmr)
|
||||
{
|
||||
#if !USE_ESP_TIMER
|
||||
@@ -231,7 +231,7 @@ static void button_gpio_isr_handler(void* arg)
|
||||
}
|
||||
|
||||
#if !USE_ESP_TIMER
|
||||
static void button_free_tmr(xTimerHandle* tmr)
|
||||
static void button_free_tmr(TimerHandle_t* tmr)
|
||||
#else
|
||||
static void button_free_tmr(esp_timer_handle_t *tmr)
|
||||
#endif
|
||||
@@ -377,7 +377,7 @@ esp_err_t iot_button_set_evt_cb(button_handle_t btn_handle, button_cb_type_t typ
|
||||
if (type == BUTTON_CB_PUSH) {
|
||||
btn->tap_psh_cb.arg = arg;
|
||||
btn->tap_psh_cb.cb = cb;
|
||||
btn->tap_psh_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_RATE_MS;
|
||||
btn->tap_psh_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_PERIOD_MS;
|
||||
btn->tap_psh_cb.pbtn = btn;
|
||||
#if !USE_ESP_TIMER
|
||||
xTimerChangePeriod(btn->tap_psh_cb.tmr, btn->tap_psh_cb.interval, portMAX_DELAY);
|
||||
@@ -385,7 +385,7 @@ esp_err_t iot_button_set_evt_cb(button_handle_t btn_handle, button_cb_type_t typ
|
||||
} else if (type == BUTTON_CB_RELEASE) {
|
||||
btn->tap_rls_cb.arg = arg;
|
||||
btn->tap_rls_cb.cb = cb;
|
||||
btn->tap_rls_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_RATE_MS;
|
||||
btn->tap_rls_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_PERIOD_MS;
|
||||
btn->tap_rls_cb.pbtn = btn;
|
||||
#if !USE_ESP_TIMER
|
||||
xTimerChangePeriod(btn->tap_rls_cb.tmr, btn->tap_psh_cb.interval, portMAX_DELAY);
|
||||
@@ -393,10 +393,10 @@ esp_err_t iot_button_set_evt_cb(button_handle_t btn_handle, button_cb_type_t typ
|
||||
} else if (type == BUTTON_CB_TAP) {
|
||||
btn->tap_short_cb.arg = arg;
|
||||
btn->tap_short_cb.cb = cb;
|
||||
btn->tap_short_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_RATE_MS;
|
||||
btn->tap_short_cb.interval = BUTTON_GLITCH_FILTER_TIME_MS / portTICK_PERIOD_MS;
|
||||
btn->tap_short_cb.pbtn = btn;
|
||||
} else if (type == BUTTON_CB_SERIAL) {
|
||||
iot_button_set_serial_cb(btn_handle, 1, 1000 / portTICK_RATE_MS, cb, arg);
|
||||
iot_button_set_serial_cb(btn_handle, 1, 1000 / portTICK_PERIOD_MS, cb, arg);
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -33,7 +33,7 @@ static const char *TAG = "HID_DEV_DEMO";
|
||||
|
||||
typedef struct
|
||||
{
|
||||
xTaskHandle task_hdl;
|
||||
TaskHandle_t task_hdl;
|
||||
esp_hidd_dev_t *hid_dev;
|
||||
uint8_t protocol_mode;
|
||||
uint8_t *buffer;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -26,11 +26,11 @@ static size_t num_bt_scan_results = 0;
|
||||
static esp_hid_scan_result_t *ble_scan_results = NULL;
|
||||
static size_t num_ble_scan_results = 0;
|
||||
|
||||
static xSemaphoreHandle bt_hidh_cb_semaphore = NULL;
|
||||
static SemaphoreHandle_t bt_hidh_cb_semaphore = NULL;
|
||||
#define WAIT_BT_CB() xSemaphoreTake(bt_hidh_cb_semaphore, portMAX_DELAY)
|
||||
#define SEND_BT_CB() xSemaphoreGive(bt_hidh_cb_semaphore)
|
||||
|
||||
static xSemaphoreHandle ble_hidh_cb_semaphore = NULL;
|
||||
static SemaphoreHandle_t ble_hidh_cb_semaphore = NULL;
|
||||
#define WAIT_BLE_CB() xSemaphoreTake(ble_hidh_cb_semaphore, portMAX_DELAY)
|
||||
#define SEND_BLE_CB() xSemaphoreGive(ble_hidh_cb_semaphore)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -29,11 +29,11 @@ static size_t num_bt_scan_results = 0;
|
||||
static esp_hid_scan_result_t *ble_scan_results = NULL;
|
||||
static size_t num_ble_scan_results = 0;
|
||||
|
||||
static xSemaphoreHandle bt_hidh_cb_semaphore = NULL;
|
||||
static SemaphoreHandle_t bt_hidh_cb_semaphore = NULL;
|
||||
#define WAIT_BT_CB() xSemaphoreTake(bt_hidh_cb_semaphore, portMAX_DELAY)
|
||||
#define SEND_BT_CB() xSemaphoreGive(bt_hidh_cb_semaphore)
|
||||
|
||||
static xSemaphoreHandle ble_hidh_cb_semaphore = NULL;
|
||||
static SemaphoreHandle_t ble_hidh_cb_semaphore = NULL;
|
||||
#define WAIT_BLE_CB() xSemaphoreTake(ble_hidh_cb_semaphore, portMAX_DELAY)
|
||||
#define SEND_BLE_CB() xSemaphoreGive(ble_hidh_cb_semaphore)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* BLE Combined Advertising and Scanning Example.
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -439,7 +439,7 @@ void app_main(void)
|
||||
}
|
||||
ESP_LOGI(TAG, "BLE Advertise, cmd_sent: %d", cmd_cnt);
|
||||
}
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
xTaskCreatePinnedToCore(&hci_evt_process, "hci_evt_process", 2048, NULL, 6, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -339,7 +339,7 @@ void ble_client_uart_task(void *pvParameters)
|
||||
uart_event_t event;
|
||||
for (;;) {
|
||||
//Waiting for UART event.
|
||||
if (xQueueReceive(spp_common_uart_queue, (void * )&event, (portTickType)portMAX_DELAY)) {
|
||||
if (xQueueReceive(spp_common_uart_queue, (void * )&event, (TickType_t)portMAX_DELAY)) {
|
||||
switch (event.type) {
|
||||
//Event of UART receving data
|
||||
case UART_DATA:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -335,7 +335,7 @@ void ble_server_uart_task(void *pvParameters){
|
||||
int rc=0;
|
||||
for (;;) {
|
||||
//Waiting for UART event.
|
||||
if (xQueueReceive(spp_common_uart_queue, (void * )&event, (portTickType)portMAX_DELAY)) {
|
||||
if (xQueueReceive(spp_common_uart_queue, (void * )&event, (TickType_t)portMAX_DELAY)) {
|
||||
switch (event.type) {
|
||||
//Event of UART receving data
|
||||
case UART_DATA:
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
static const char *tag = "NimBLE_BLE_HeartRate";
|
||||
|
||||
static xTimerHandle blehr_tx_timer;
|
||||
static TimerHandle_t blehr_tx_timer;
|
||||
|
||||
static bool notify_state;
|
||||
|
||||
@@ -152,7 +152,7 @@ blehr_tx_hrate_reset(void)
|
||||
|
||||
/* This function simulates heart beat and notifies it to the client */
|
||||
static void
|
||||
blehr_tx_hrate(xTimerHandle ev)
|
||||
blehr_tx_hrate(TimerHandle_t ev)
|
||||
{
|
||||
static uint8_t hrm[2];
|
||||
int rc;
|
||||
|
||||
@@ -112,7 +112,7 @@ static void scli_task(void *arg)
|
||||
i = 0;
|
||||
memset(linebuf, 0, sizeof(linebuf));
|
||||
do {
|
||||
ret = xQueueReceive(uart_queue, (void * )&event, (portTickType)portMAX_DELAY);
|
||||
ret = xQueueReceive(uart_queue, (void * )&event, (TickType_t)portMAX_DELAY);
|
||||
if (ret != pdPASS) {
|
||||
if (stop == 1) {
|
||||
break;
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
#endif
|
||||
|
||||
static int s_active_interfaces = 0;
|
||||
static xSemaphoreHandle s_semph_get_ip_addrs;
|
||||
static SemaphoreHandle_t s_semph_get_ip_addrs;
|
||||
static esp_netif_t *s_example_esp_netif = NULL;
|
||||
|
||||
#ifdef CONFIG_EXAMPLE_CONNECT_IPV6
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*
|
||||
@@ -183,7 +183,7 @@ TEST_CASE("I2CWrite calls driver correctly")
|
||||
// will actually write the data but for the tests it is enough for now
|
||||
i2c_master_write_ExpectWithArrayAndReturn(&cmd_fix.dummy_handle, expected_write, WRITE_SIZE, EXPECTED_DATA_LEN, true, ESP_OK);
|
||||
i2c_master_stop_ExpectAndReturn(&cmd_fix.dummy_handle, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_RATE_MS, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_PERIOD_MS, ESP_OK);
|
||||
|
||||
std::vector<uint8_t> WRITE_BYTES = {0xAB, 0xBA};
|
||||
I2CWrite write(WRITE_BYTES);
|
||||
@@ -218,7 +218,7 @@ TEST_CASE("I2CRead calls driver correctly")
|
||||
// will actually read the data but for the tests it is enough for now
|
||||
i2c_master_read_ReturnArrayThruPtr_data(READ_DATA, READ_SIZE);
|
||||
i2c_master_stop_ExpectAndReturn(&cmd_fix.dummy_handle, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_RATE_MS, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_PERIOD_MS, ESP_OK);
|
||||
|
||||
I2CRead reader(READ_SIZE);
|
||||
std::vector<uint8_t> result = reader.do_transfer(I2CNumber::I2C0(), I2CAddress(0x47));
|
||||
@@ -261,7 +261,7 @@ TEST_CASE("I2CComposed calls driver correctly")
|
||||
// will actually read the data but for the tests it is enough for now
|
||||
i2c_master_read_ReturnArrayThruPtr_data(READ_DATA, READ_SIZE);
|
||||
i2c_master_stop_ExpectAndReturn(&cmd_fix.dummy_handle, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_RATE_MS, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_PERIOD_MS, ESP_OK);
|
||||
|
||||
I2CComposed composed_transfer;
|
||||
composed_transfer.add_write({0x47, 0x48, 0x49});
|
||||
@@ -289,7 +289,7 @@ TEST_CASE("I2CWrite transfer calls driver correctly")
|
||||
// will actually write the data but for the tests it is enough for now
|
||||
i2c_master_write_ExpectWithArrayAndReturn(&cmd_fix.dummy_handle, expected_write, WRITE_SIZE, EXPECTED_DATA_LEN, true, ESP_OK);
|
||||
i2c_master_stop_ExpectAndReturn(&cmd_fix.dummy_handle, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_RATE_MS, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_PERIOD_MS, ESP_OK);
|
||||
|
||||
I2CMaster master(I2CNumber::I2C0(), SCL_GPIO(1), SDA_GPIO(2), Frequency(400000));
|
||||
std::vector<uint8_t> WRITE_BYTES = {0xAB, 0xBA};
|
||||
@@ -310,7 +310,7 @@ TEST_CASE("I2CMaster synchronous write")
|
||||
// will actually write the data but for the tests it is enough for now
|
||||
i2c_master_write_ExpectWithArrayAndReturn(&cmd_fix.dummy_handle, expected_write, WRITE_SIZE, EXPECTED_DATA_LEN, true, ESP_OK);
|
||||
i2c_master_stop_ExpectAndReturn(&cmd_fix.dummy_handle, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_RATE_MS, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_PERIOD_MS, ESP_OK);
|
||||
|
||||
I2CMaster master(I2CNumber::I2C0(), SCL_GPIO(1), SDA_GPIO(2), Frequency(400000));
|
||||
std::vector<uint8_t> WRITE_BYTES = {0xAB, 0xBA};
|
||||
@@ -332,7 +332,7 @@ TEST_CASE("I2CMaster synchronous read")
|
||||
// will actually read the data but for the tests it is enough for now
|
||||
i2c_master_read_ReturnArrayThruPtr_data(READ_DATA, READ_SIZE);
|
||||
i2c_master_stop_ExpectAndReturn(&cmd_fix.dummy_handle, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_RATE_MS, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_PERIOD_MS, ESP_OK);
|
||||
|
||||
I2CMaster master(I2CNumber::I2C0(), SCL_GPIO(1), SDA_GPIO(2), Frequency(400000));
|
||||
std::vector<uint8_t> result = master.sync_read(I2CAddress(0x47), READ_SIZE);
|
||||
@@ -365,7 +365,7 @@ TEST_CASE("I2CMaster syncronous transfer (read and write)")
|
||||
// will actually read the data but for the tests it is enough for now
|
||||
i2c_master_read_ReturnArrayThruPtr_data(READ_DATA, READ_SIZE);
|
||||
i2c_master_stop_ExpectAndReturn(&cmd_fix.dummy_handle, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_RATE_MS, ESP_OK);
|
||||
i2c_master_cmd_begin_ExpectAndReturn(0, &cmd_fix.dummy_handle, 1000 / portTICK_PERIOD_MS, ESP_OK);
|
||||
|
||||
I2CMaster master(I2CNumber::I2C0(), SCL_GPIO(1), SDA_GPIO(2), Frequency(400000));
|
||||
vector<uint8_t> read_result = master.sync_transfer(I2CAddress(0x47), {0x47, 0x48, 0x49}, READ_SIZE);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -96,7 +96,7 @@ void I2CCommandLink::stop()
|
||||
|
||||
void I2CCommandLink::execute_transfer(I2CNumber i2c_num, chrono::milliseconds driver_timeout)
|
||||
{
|
||||
esp_err_t err = i2c_master_cmd_begin(i2c_num.get_num(), handle, driver_timeout.count() / portTICK_RATE_MS);
|
||||
esp_err_t err = i2c_master_cmd_begin(i2c_num.get_num(), handle, driver_timeout.count() / portTICK_PERIOD_MS);
|
||||
if (err != ESP_OK) {
|
||||
throw I2CTransferException(err);
|
||||
}
|
||||
@@ -184,12 +184,12 @@ I2CSlave::~I2CSlave()
|
||||
|
||||
int I2CSlave::write_raw(const uint8_t *data, size_t data_len, chrono::milliseconds timeout)
|
||||
{
|
||||
return i2c_slave_write_buffer(i2c_num.get_value(), data, data_len, (TickType_t) timeout.count() / portTICK_RATE_MS);
|
||||
return i2c_slave_write_buffer(i2c_num.get_value(), data, data_len, (TickType_t) timeout.count() / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
int I2CSlave::read_raw(uint8_t *buffer, size_t buffer_len, chrono::milliseconds timeout)
|
||||
{
|
||||
return i2c_slave_read_buffer(i2c_num.get_value(), buffer, buffer_len, (TickType_t) timeout.count() / portTICK_RATE_MS);
|
||||
return i2c_slave_read_buffer(i2c_num.get_value(), buffer, buffer_len, (TickType_t) timeout.count() / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
I2CWrite::I2CWrite(const vector<uint8_t> &bytes, chrono::milliseconds driver_timeout)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -225,7 +225,7 @@ bool SPITransactionDescriptor::wait_for(const chrono::milliseconds &timeout_dura
|
||||
|
||||
spi_transaction_t *acquired_trans_desc;
|
||||
esp_err_t err = device_handle->get_trans_result(&acquired_trans_desc,
|
||||
(TickType_t) timeout_duration.count() / portTICK_RATE_MS);
|
||||
(TickType_t) timeout_duration.count() / portTICK_PERIOD_MS);
|
||||
|
||||
if (err == ESP_ERR_TIMEOUT) {
|
||||
return false;
|
||||
|
||||
@@ -34,7 +34,7 @@ void print_thread_info(const char *extra = nullptr)
|
||||
ss << "Core id: " << xPortGetCoreID()
|
||||
<< ", prio: " << uxTaskPriorityGet(nullptr)
|
||||
<< ", minimum free stack: " << uxTaskGetStackHighWaterMark(nullptr) << " bytes.";
|
||||
ESP_LOGI(pcTaskGetTaskName(nullptr), "%s", ss.str().c_str());
|
||||
ESP_LOGI(pcTaskGetName(nullptr), "%s", ss.str().c_str());
|
||||
}
|
||||
|
||||
void thread_func_inherited()
|
||||
@@ -106,7 +106,7 @@ extern "C" void app_main(void)
|
||||
ss << "core id: " << xPortGetCoreID()
|
||||
<< ", prio: " << uxTaskPriorityGet(nullptr)
|
||||
<< ", minimum free stack: " << uxTaskGetStackHighWaterMark(nullptr) << " bytes.";
|
||||
ESP_LOGI(pcTaskGetTaskName(nullptr), "%s", ss.str().c_str());
|
||||
ESP_LOGI(pcTaskGetName(nullptr), "%s", ss.str().c_str());
|
||||
std::this_thread::sleep_for(sleep_time);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
static const char *TAG = "eth_example";
|
||||
static esp_eth_handle_t s_eth_handle = NULL;
|
||||
static xQueueHandle flow_control_queue = NULL;
|
||||
static QueueHandle_t flow_control_queue = NULL;
|
||||
static bool s_sta_is_connected = false;
|
||||
static bool s_ethernet_is_connected = false;
|
||||
static uint8_t s_eth_mac[6];
|
||||
|
||||
@@ -80,7 +80,7 @@ void esp_mesh_p2p_tx_main(void *arg)
|
||||
ESP_LOGI(MESH_TAG, "layer:%d, rtableSize:%d, %s", mesh_layer,
|
||||
esp_mesh_get_routing_table_size(),
|
||||
(is_mesh_connected && esp_mesh_is_root()) ? "ROOT" : is_mesh_connected ? "NODE" : "DISCONNECT");
|
||||
vTaskDelay(10 * 1000 / portTICK_RATE_MS);
|
||||
vTaskDelay(10 * 1000 / portTICK_PERIOD_MS);
|
||||
continue;
|
||||
}
|
||||
esp_mesh_get_routing_table((mesh_addr_t *) &route_table,
|
||||
@@ -120,7 +120,7 @@ void esp_mesh_p2p_tx_main(void *arg)
|
||||
}
|
||||
/* if route_table_size is less than 10, add delay to avoid watchdog in this task. */
|
||||
if (route_table_size < 10) {
|
||||
vTaskDelay(1 * 1000 / portTICK_RATE_MS);
|
||||
vTaskDelay(1 * 1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
|
||||
@@ -167,7 +167,7 @@ void esp_mesh_mqtt_task(void *arg)
|
||||
MACSTR ": sent with err code: %d", i, MAC2STR(s_route_table[i].addr), err);
|
||||
}
|
||||
}
|
||||
vTaskDelay(2 * 1000 / portTICK_RATE_MS);
|
||||
vTaskDelay(2 * 1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#define GPIO_INPUT_PIN_SEL ((1ULL<<GPIO_INPUT_IO_0) | (1ULL<<GPIO_INPUT_IO_1))
|
||||
#define ESP_INTR_FLAG_DEFAULT 0
|
||||
|
||||
static xQueueHandle gpio_evt_queue = NULL;
|
||||
static QueueHandle_t gpio_evt_queue = NULL;
|
||||
|
||||
static void IRAM_ATTR gpio_isr_handler(void* arg)
|
||||
{
|
||||
@@ -112,7 +112,7 @@ void app_main(void)
|
||||
int cnt = 0;
|
||||
while(1) {
|
||||
printf("cnt: %d\n", cnt++);
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(GPIO_OUTPUT_IO_0, cnt % 2);
|
||||
gpio_set_level(GPIO_OUTPUT_IO_1, cnt % 2);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ static esp_err_t __attribute__((unused)) i2c_master_read_slave(i2c_port_t i2c_nu
|
||||
}
|
||||
i2c_master_read_byte(cmd, data_rd + size - 1, NACK_VAL);
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
return ret;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ static esp_err_t __attribute__((unused)) i2c_master_write_slave(i2c_port_t i2c_n
|
||||
i2c_master_write_byte(cmd, (ESP_SLAVE_ADDR << 1) | WRITE_BIT, ACK_CHECK_EN);
|
||||
i2c_master_write(cmd, data_wr, size, ACK_CHECK_EN);
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
return ret;
|
||||
}
|
||||
@@ -123,19 +123,19 @@ static esp_err_t i2c_master_sensor_test(i2c_port_t i2c_num, uint8_t *data_h, uin
|
||||
i2c_master_write_byte(cmd, BH1750_SENSOR_ADDR << 1 | WRITE_BIT, ACK_CHECK_EN);
|
||||
i2c_master_write_byte(cmd, BH1750_CMD_START, ACK_CHECK_EN);
|
||||
i2c_master_stop(cmd);
|
||||
ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
|
||||
ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
if (ret != ESP_OK) {
|
||||
return ret;
|
||||
}
|
||||
vTaskDelay(30 / portTICK_RATE_MS);
|
||||
vTaskDelay(30 / portTICK_PERIOD_MS);
|
||||
cmd = i2c_cmd_link_create();
|
||||
i2c_master_start(cmd);
|
||||
i2c_master_write_byte(cmd, BH1750_SENSOR_ADDR << 1 | READ_BIT, ACK_CHECK_EN);
|
||||
i2c_master_read_byte(cmd, data_h, ACK_VAL);
|
||||
i2c_master_read_byte(cmd, data_l, NACK_VAL);
|
||||
i2c_master_stop(cmd);
|
||||
ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
|
||||
ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
return ret;
|
||||
}
|
||||
@@ -230,14 +230,14 @@ static void i2c_test_task(void *arg)
|
||||
ESP_LOGW(TAG, "%s: No ack, sensor not connected...skip...", esp_err_to_name(ret));
|
||||
}
|
||||
xSemaphoreGive(print_mux);
|
||||
vTaskDelay((DELAY_TIME_BETWEEN_ITEMS_MS * (task_idx + 1)) / portTICK_RATE_MS);
|
||||
vTaskDelay((DELAY_TIME_BETWEEN_ITEMS_MS * (task_idx + 1)) / portTICK_PERIOD_MS);
|
||||
//---------------------------------------------------
|
||||
#if !CONFIG_IDF_TARGET_ESP32C3
|
||||
for (i = 0; i < DATA_LENGTH; i++) {
|
||||
data[i] = i;
|
||||
}
|
||||
xSemaphoreTake(print_mux, portMAX_DELAY);
|
||||
size_t d_size = i2c_slave_write_buffer(I2C_SLAVE_NUM, data, RW_TEST_LENGTH, 1000 / portTICK_RATE_MS);
|
||||
size_t d_size = i2c_slave_write_buffer(I2C_SLAVE_NUM, data, RW_TEST_LENGTH, 1000 / portTICK_PERIOD_MS);
|
||||
if (d_size == 0) {
|
||||
ESP_LOGW(TAG, "i2c slave tx buffer full");
|
||||
ret = i2c_master_read_slave(I2C_MASTER_NUM, data_rd, DATA_LENGTH);
|
||||
@@ -260,7 +260,7 @@ static void i2c_test_task(void *arg)
|
||||
task_idx, esp_err_to_name(ret));
|
||||
}
|
||||
xSemaphoreGive(print_mux);
|
||||
vTaskDelay((DELAY_TIME_BETWEEN_ITEMS_MS * (task_idx + 1)) / portTICK_RATE_MS);
|
||||
vTaskDelay((DELAY_TIME_BETWEEN_ITEMS_MS * (task_idx + 1)) / portTICK_PERIOD_MS);
|
||||
//---------------------------------------------------
|
||||
int size;
|
||||
for (i = 0; i < DATA_LENGTH; i++) {
|
||||
@@ -270,7 +270,7 @@ static void i2c_test_task(void *arg)
|
||||
//we need to fill the slave buffer so that master can read later
|
||||
ret = i2c_master_write_slave(I2C_MASTER_NUM, data_wr, RW_TEST_LENGTH);
|
||||
if (ret == ESP_OK) {
|
||||
size = i2c_slave_read_buffer(I2C_SLAVE_NUM, data, RW_TEST_LENGTH, 1000 / portTICK_RATE_MS);
|
||||
size = i2c_slave_read_buffer(I2C_SLAVE_NUM, data, RW_TEST_LENGTH, 1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
if (ret == ESP_ERR_TIMEOUT) {
|
||||
ESP_LOGE(TAG, "I2C Timeout");
|
||||
@@ -287,7 +287,7 @@ static void i2c_test_task(void *arg)
|
||||
task_idx, esp_err_to_name(ret));
|
||||
}
|
||||
xSemaphoreGive(print_mux);
|
||||
vTaskDelay((DELAY_TIME_BETWEEN_ITEMS_MS * (task_idx + 1)) / portTICK_RATE_MS);
|
||||
vTaskDelay((DELAY_TIME_BETWEEN_ITEMS_MS * (task_idx + 1)) / portTICK_PERIOD_MS);
|
||||
#endif //!CONFIG_IDF_TARGET_ESP32C3
|
||||
}
|
||||
vSemaphoreDelete(print_mux);
|
||||
|
||||
@@ -41,7 +41,7 @@ static const char *TAG = "i2c-simple-example";
|
||||
*/
|
||||
static esp_err_t mpu9250_register_read(uint8_t reg_addr, uint8_t *data, size_t len)
|
||||
{
|
||||
return i2c_master_write_read_device(I2C_MASTER_NUM, MPU9250_SENSOR_ADDR, ®_addr, 1, data, len, I2C_MASTER_TIMEOUT_MS / portTICK_RATE_MS);
|
||||
return i2c_master_write_read_device(I2C_MASTER_NUM, MPU9250_SENSOR_ADDR, ®_addr, 1, data, len, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ static esp_err_t mpu9250_register_write_byte(uint8_t reg_addr, uint8_t data)
|
||||
int ret;
|
||||
uint8_t write_buf[2] = {reg_addr, data};
|
||||
|
||||
ret = i2c_master_write_to_device(I2C_MASTER_NUM, MPU9250_SENSOR_ADDR, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_RATE_MS);
|
||||
ret = i2c_master_write_to_device(I2C_MASTER_NUM, MPU9250_SENSOR_ADDR, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ static int do_i2cdetect_cmd(int argc, char **argv)
|
||||
i2c_master_start(cmd);
|
||||
i2c_master_write_byte(cmd, (address << 1) | WRITE_BIT, ACK_CHECK_EN);
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 50 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 50 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
if (ret == ESP_OK) {
|
||||
printf("%02x ", address);
|
||||
@@ -199,7 +199,7 @@ static int do_i2cget_cmd(int argc, char **argv)
|
||||
}
|
||||
i2c_master_read_byte(cmd, data + len - 1, NACK_VAL);
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 1000 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 1000 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
if (ret == ESP_OK) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
@@ -274,7 +274,7 @@ static int do_i2cset_cmd(int argc, char **argv)
|
||||
i2c_master_write_byte(cmd, i2cset_args.data->ival[i], ACK_CHECK_EN);
|
||||
}
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 1000 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 1000 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
if (ret == ESP_OK) {
|
||||
ESP_LOGI(TAG, "Write OK");
|
||||
@@ -351,7 +351,7 @@ static int do_i2cdump_cmd(int argc, char **argv)
|
||||
}
|
||||
i2c_master_read_byte(cmd, data + size - 1, NACK_VAL);
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 50 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 50 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
if (ret == ESP_OK) {
|
||||
for (int k = 0; k < size; k++) {
|
||||
|
||||
@@ -279,7 +279,7 @@ void adc_read_task(void* arg)
|
||||
uint32_t voltage;
|
||||
esp_adc_cal_get_voltage(ADC1_TEST_CHANNEL, &characteristics, &voltage);
|
||||
ESP_LOGI(TAG, "%d mV", voltage);
|
||||
vTaskDelay(200 / portTICK_RATE_MS);
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ void app_main(void)
|
||||
int test_bits = 16;
|
||||
while (1) {
|
||||
setup_triangle_sine_waves(test_bits);
|
||||
vTaskDelay(5000/portTICK_RATE_MS);
|
||||
vTaskDelay(5000/portTICK_PERIOD_MS);
|
||||
test_bits += 8;
|
||||
if(test_bits > 32)
|
||||
test_bits = 16;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*/
|
||||
@@ -142,7 +142,7 @@ static void i2s_music(void *args)
|
||||
ESP_LOGE(TAG, "[music] i2s music play falied.");
|
||||
abort();
|
||||
}
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
version: "1.0.0"
|
||||
|
||||
dependencies:
|
||||
espressif/es8311: "==0.0.2-alpha"
|
||||
espressif/es8311: ">=0.0.2"
|
||||
## Required IDF version
|
||||
idf:
|
||||
version: "^5.0"
|
||||
|
||||
@@ -39,7 +39,7 @@ typedef struct {
|
||||
static uint32_t cap_val_begin_of_sample = 0;
|
||||
static uint32_t cap_val_end_of_sample = 0;
|
||||
|
||||
static xQueueHandle cap_queue;
|
||||
static QueueHandle_t cap_queue;
|
||||
|
||||
/**
|
||||
* @brief generate single pulse on Trig pin to activate a new sample
|
||||
|
||||
@@ -49,7 +49,7 @@ static const char *TAG = "example";
|
||||
#define PCNT_INPUT_CTRL_IO 5 // Control GPIO HIGH=count up, LOW=count down
|
||||
#define LEDC_OUTPUT_IO 18 // Output GPIO of a sample 1 Hz pulse generator
|
||||
|
||||
xQueueHandle pcnt_evt_queue; // A queue to handle pulse counter events
|
||||
QueueHandle_t pcnt_evt_queue; // A queue to handle pulse counter events
|
||||
|
||||
/* A sample structure to pass events from the PCNT
|
||||
* interrupt handler to the main program.
|
||||
|
||||
@@ -109,7 +109,7 @@ esp_err_t slave_reset(essl_handle_t handle)
|
||||
return ret;
|
||||
}
|
||||
|
||||
vTaskDelay(500 / portTICK_RATE_MS);
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
ret = essl_wait_for_ready(handle, TIMEOUT_MAX);
|
||||
ESP_LOGI(TAG, "slave io ready");
|
||||
return ret;
|
||||
|
||||
@@ -112,7 +112,7 @@ static esp_err_t task_hostint(void)
|
||||
sdio_slave_send_host_int(i);
|
||||
//check reset for quick response to RESET signal
|
||||
if (s_job & JOB_RESET) break;
|
||||
vTaskDelay(500/portTICK_RATE_MS);
|
||||
vTaskDelay(500/portTICK_PERIOD_MS);
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
struct eeprom_context_t{
|
||||
eeprom_config_t cfg; ///< Configuration by the caller.
|
||||
spi_device_handle_t spi; ///< SPI device handle
|
||||
xSemaphoreHandle ready_sem; ///< Semaphore for ready signal
|
||||
SemaphoreHandle_t ready_sem; ///< Semaphore for ready signal
|
||||
};
|
||||
|
||||
typedef struct eeprom_context_t eeprom_context_t;
|
||||
|
||||
@@ -254,9 +254,9 @@ void lcd_init(spi_device_handle_t spi)
|
||||
|
||||
//Reset the display
|
||||
gpio_set_level(PIN_NUM_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(PIN_NUM_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
//detect LCD type
|
||||
uint32_t lcd_id = lcd_get_id(spi);
|
||||
@@ -296,7 +296,7 @@ void lcd_init(spi_device_handle_t spi)
|
||||
lcd_cmd(spi, lcd_init_cmds[cmd].cmd);
|
||||
lcd_data(spi, lcd_init_cmds[cmd].data, lcd_init_cmds[cmd].databytes&0x1F);
|
||||
if (lcd_init_cmds[cmd].databytes&0x80) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ Pins in use. The SPI Master can use the GPIO mux, so feel free to change these i
|
||||
|
||||
|
||||
//The semaphore indicating the slave is ready to receive stuff.
|
||||
static xQueueHandle rdySem;
|
||||
static QueueHandle_t rdySem;
|
||||
|
||||
/*
|
||||
This ISR is called when the handshake line goes high.
|
||||
|
||||
@@ -32,7 +32,7 @@ void tempsensor_example(void *arg)
|
||||
temp_sensor_start();
|
||||
ESP_LOGI(TAG, "Temperature sensor started");
|
||||
while (1) {
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
temp_sensor_read_celsius(&tsens_out);
|
||||
ESP_LOGI(TAG, "Temperature out celsius %f°C", tsens_out);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ typedef struct {
|
||||
* @brief Timer user data, will be pass to timer alarm callback
|
||||
*/
|
||||
typedef struct {
|
||||
xQueueHandle user_queue;
|
||||
QueueHandle_t user_queue;
|
||||
int timer_group;
|
||||
int timer_idx;
|
||||
int alarm_value;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*/
|
||||
@@ -101,11 +101,11 @@ static void tp_example_read_task(void *pvParameter)
|
||||
touch_event_t evt = {0};
|
||||
static uint8_t guard_mode_flag = 0;
|
||||
/* Wait touch sensor init done */
|
||||
vTaskDelay(50 / portTICK_RATE_MS);
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
tp_example_set_thresholds();
|
||||
|
||||
while (1) {
|
||||
int ret = xQueueReceive(que_touch, &evt, (portTickType)portMAX_DELAY);
|
||||
int ret = xQueueReceive(que_touch, &evt, (TickType_t)portMAX_DELAY);
|
||||
if (ret != pdTRUE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*/
|
||||
@@ -40,7 +40,7 @@ static void tp_example_read_task(void *pvParameter)
|
||||
uint32_t touch_value;
|
||||
|
||||
/* Wait touch sensor init done */
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
printf("Touch Sensor read, the output format is: \nTouchpad num:[raw data]\n\n");
|
||||
|
||||
while (1) {
|
||||
|
||||
@@ -58,7 +58,7 @@ static void rx_task(void *arg)
|
||||
esp_log_level_set(RX_TASK_TAG, ESP_LOG_INFO);
|
||||
uint8_t* data = (uint8_t*) malloc(RX_BUF_SIZE+1);
|
||||
while (1) {
|
||||
const int rxBytes = uart_read_bytes(UART_NUM_1, data, RX_BUF_SIZE, 1000 / portTICK_RATE_MS);
|
||||
const int rxBytes = uart_read_bytes(UART_NUM_1, data, RX_BUF_SIZE, 1000 / portTICK_PERIOD_MS);
|
||||
if (rxBytes > 0) {
|
||||
data[rxBytes] = 0;
|
||||
ESP_LOGI(RX_TASK_TAG, "Read %d bytes: '%s'", rxBytes, data);
|
||||
|
||||
@@ -66,7 +66,7 @@ static void echo_task(void *arg)
|
||||
|
||||
while (1) {
|
||||
// Read data from the UART
|
||||
int len = uart_read_bytes(ECHO_UART_PORT_NUM, data, (BUF_SIZE - 1), 20 / portTICK_RATE_MS);
|
||||
int len = uart_read_bytes(ECHO_UART_PORT_NUM, data, (BUF_SIZE - 1), 20 / portTICK_PERIOD_MS);
|
||||
// Write data back to the UART
|
||||
uart_write_bytes(ECHO_UART_PORT_NUM, (const char *) data, len);
|
||||
if (len) {
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#define BAUD_RATE (CONFIG_ECHO_UART_BAUD_RATE)
|
||||
|
||||
// Read packet timeout
|
||||
#define PACKET_READ_TICS (100 / portTICK_RATE_MS)
|
||||
#define PACKET_READ_TICS (100 / portTICK_PERIOD_MS)
|
||||
#define ECHO_TASK_STACK_SIZE (2048)
|
||||
#define ECHO_TASK_PRIO (10)
|
||||
#define ECHO_UART_PORT (CONFIG_ECHO_UART_PORT_NUM)
|
||||
|
||||
@@ -43,7 +43,7 @@ static void uart_event_task(void *pvParameters)
|
||||
uint8_t* dtmp = (uint8_t*) malloc(RD_BUF_SIZE);
|
||||
for(;;) {
|
||||
//Waiting for UART event.
|
||||
if(xQueueReceive(uart0_queue, (void * )&event, (portTickType)portMAX_DELAY)) {
|
||||
if(xQueueReceive(uart0_queue, (void * )&event, (TickType_t)portMAX_DELAY)) {
|
||||
bzero(dtmp, RD_BUF_SIZE);
|
||||
ESP_LOGI(TAG, "uart[%d] event:", EX_UART_NUM);
|
||||
switch(event.type) {
|
||||
|
||||
@@ -112,7 +112,7 @@ static void send_commands(void* arg) {
|
||||
|
||||
/* Discard the first messages sent by the console. */
|
||||
do {
|
||||
len = uart_read_bytes(DEFAULT_UART_CHANNEL, data, READ_BUF_SIZE, 100 / portTICK_RATE_MS);
|
||||
len = uart_read_bytes(DEFAULT_UART_CHANNEL, data, READ_BUF_SIZE, 100 / portTICK_PERIOD_MS);
|
||||
} while (len == 0);
|
||||
|
||||
if ( len == -1 ) {
|
||||
@@ -126,7 +126,7 @@ static void send_commands(void* arg) {
|
||||
|
||||
/* Get the answer back from the console, give it some delay. */
|
||||
do {
|
||||
len = uart_read_bytes(DEFAULT_UART_CHANNEL, data, READ_BUF_SIZE - 1, 250 / portTICK_RATE_MS);
|
||||
len = uart_read_bytes(DEFAULT_UART_CHANNEL, data, READ_BUF_SIZE - 1, 250 / portTICK_PERIOD_MS);
|
||||
} while (len == 0);
|
||||
|
||||
if ( len == -1 ) {
|
||||
|
||||
@@ -273,7 +273,7 @@ void start_esp_local_ctrl_service(void)
|
||||
/* Just for fun, let us keep toggling the value
|
||||
* of the boolean property2, every 1 second */
|
||||
while (1) {
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
prop2_value = !prop2_value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
// Timeout to update cid over Modbus
|
||||
#define UPDATE_CIDS_TIMEOUT_MS (500)
|
||||
#define UPDATE_CIDS_TIMEOUT_TICS (UPDATE_CIDS_TIMEOUT_MS / portTICK_RATE_MS)
|
||||
#define UPDATE_CIDS_TIMEOUT_TICS (UPDATE_CIDS_TIMEOUT_MS / portTICK_PERIOD_MS)
|
||||
|
||||
// Timeout between polls
|
||||
#define POLL_TIMEOUT_MS (1)
|
||||
#define POLL_TIMEOUT_TICS (POLL_TIMEOUT_MS / portTICK_RATE_MS)
|
||||
#define POLL_TIMEOUT_TICS (POLL_TIMEOUT_MS / portTICK_PERIOD_MS)
|
||||
|
||||
// The macro to get offset for parameter in the appropriate structure
|
||||
#define HOLD_OFFSET(field) ((uint16_t)(offsetof(holding_reg_params_t, field) + 1))
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
|
||||
// Timeout to update cid over Modbus
|
||||
#define UPDATE_CIDS_TIMEOUT_MS (500)
|
||||
#define UPDATE_CIDS_TIMEOUT_TICS (UPDATE_CIDS_TIMEOUT_MS / portTICK_RATE_MS)
|
||||
#define UPDATE_CIDS_TIMEOUT_TICS (UPDATE_CIDS_TIMEOUT_MS / portTICK_PERIOD_MS)
|
||||
|
||||
// Timeout between polls
|
||||
#define POLL_TIMEOUT_MS (1)
|
||||
#define POLL_TIMEOUT_TICS (POLL_TIMEOUT_MS / portTICK_RATE_MS)
|
||||
#define POLL_TIMEOUT_TICS (POLL_TIMEOUT_MS / portTICK_PERIOD_MS)
|
||||
#define MB_MDNS_PORT (502)
|
||||
|
||||
// The macro to get offset for parameter in the appropriate structure
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "slip_modem.h"
|
||||
|
||||
@@ -209,7 +201,7 @@ static void esp_slip_modem_uart_rx_task(void *arg)
|
||||
|
||||
while (slip_modem->running == true) {
|
||||
// Read data from the UART
|
||||
int len = uart_read_bytes(slip_modem->uart.uart_dev, slip_modem->buffer, slip_modem->buffer_len, 1 / portTICK_RATE_MS);
|
||||
int len = uart_read_bytes(slip_modem->uart.uart_dev, slip_modem->buffer, slip_modem->buffer_len, 1 / portTICK_PERIOD_MS);
|
||||
|
||||
if (len > 0) {
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ static void tcp_server_task(void *pvParameters)
|
||||
{
|
||||
static char rx_buffer[128];
|
||||
static const char *TAG = "nonblocking-socket-server";
|
||||
xSemaphoreHandle *server_ready = pvParameters;
|
||||
SemaphoreHandle_t *server_ready = pvParameters;
|
||||
struct addrinfo hints = { .ai_socktype = SOCK_STREAM };
|
||||
struct addrinfo *address_info;
|
||||
int listen_sock = INVALID_SOCK;
|
||||
@@ -388,7 +388,7 @@ void app_main(void)
|
||||
ESP_ERROR_CHECK(example_connect());
|
||||
|
||||
#ifdef CONFIG_EXAMPLE_TCP_SERVER
|
||||
xSemaphoreHandle server_ready = xSemaphoreCreateBinary();
|
||||
SemaphoreHandle_t server_ready = xSemaphoreCreateBinary();
|
||||
assert(server_ready);
|
||||
xTaskCreate(tcp_server_task, "tcp_server", 4096, &server_ready, 5, NULL);
|
||||
xSemaphoreTake(server_ready, portMAX_DELAY);
|
||||
|
||||
@@ -121,7 +121,7 @@ static void websocket_app_start(void)
|
||||
ESP_LOGI(TAG, "Sending %s", data);
|
||||
esp_websocket_client_send_text(client, data, len, portMAX_DELAY);
|
||||
}
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
xSemaphoreTake(shutdown_sema, portMAX_DELAY);
|
||||
|
||||
@@ -244,7 +244,7 @@ void app_main(void)
|
||||
/* Enable touch sensor clock. Work mode is "timer trigger". */
|
||||
touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER);
|
||||
touch_pad_fsm_start();
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
/* set touchpad wakeup threshold */
|
||||
uint32_t touch_value, wake_threshold;
|
||||
|
||||
@@ -39,7 +39,7 @@ static void esp_dump_per_task_heap_info(void)
|
||||
|
||||
for (int i = 0 ; i < *heap_info.num_totals; i++) {
|
||||
printf("Task: %s -> CAP_8BIT: %d CAP_32BIT: %d\n",
|
||||
heap_info.totals[i].task ? pcTaskGetTaskName(heap_info.totals[i].task) : "Pre-Scheduler allocs" ,
|
||||
heap_info.totals[i].task ? pcTaskGetName(heap_info.totals[i].task) : "Pre-Scheduler allocs" ,
|
||||
heap_info.totals[i].size[0], // Heap size with CAP_8BIT capabilities
|
||||
heap_info.totals[i].size[1]); // Heap size with CAP32_BIT capabilities
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ static void uart_wakeup_task(void *arg)
|
||||
|
||||
while(1) {
|
||||
// Waiting for UART event.
|
||||
if(xQueueReceive(uart_evt_que, (void * )&event, (portTickType)portMAX_DELAY)) {
|
||||
if(xQueueReceive(uart_evt_que, (void * )&event, (TickType_t)portMAX_DELAY)) {
|
||||
ESP_LOGI(TAG, "uart%d recved event:%d", EXAMPLE_UART_NUM, event.type);
|
||||
switch(event.type) {
|
||||
case UART_DATA:
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
135 xTaskGetTickCount
|
||||
57 xTaskGetTickCountFromISR
|
||||
136 uxTaskGetNumberOfTasks
|
||||
137 pcTaskGetTaskName xTaskToQuery=%t
|
||||
137 pcTaskGetName xTaskToQuery=%t
|
||||
138 uxTaskGetStackHighWaterMark xTask=%t
|
||||
139 vTaskSetApplicationTaskTag xTask=%t pxHookFunction=%u
|
||||
140 xTaskGetApplicationTaskTag xTask=%t
|
||||
@@ -52,7 +52,7 @@
|
||||
162 xTimerGetTimerDaemonTaskHandle
|
||||
163 xTimerPendFunctionCallFromISR xFunctionToPend=%u pvParameter1=%u ulParameter2=%u pxHigherPriorityTaskWoken=%u
|
||||
164 xTimerPendFunctionCall xFunctionToPend=%u pvParameter1=%u ulParameter2=%u xTicksToWait=%u
|
||||
165 pcTimerGetTimerName xTimer=%u
|
||||
165 pcTimerGetName xTimer=%u
|
||||
166 xTimerCreateTimerTask
|
||||
167 xTimerGenericCommand xTimer=%u xCommandID=%u xOptionalValue=%u pxHigherPriorityTaskWoken=%u xTicksToWait=%u
|
||||
53 xQueueGenericSend xQueue=%I pvItemToQueue=%p xTicksToWait=%u xCopyPosition=%u
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
135 xTaskGetTickCount
|
||||
57 xTaskGetTickCountFromISR
|
||||
136 uxTaskGetNumberOfTasks
|
||||
137 pcTaskGetTaskName xTaskToQuery=%t
|
||||
137 pcTaskGetName xTaskToQuery=%t
|
||||
138 uxTaskGetStackHighWaterMark xTask=%t
|
||||
139 vTaskSetApplicationTaskTag xTask=%t pxHookFunction=%u
|
||||
140 xTaskGetApplicationTaskTag xTask=%t
|
||||
@@ -52,7 +52,7 @@
|
||||
162 xTimerGetTimerDaemonTaskHandle
|
||||
163 xTimerPendFunctionCallFromISR xFunctionToPend=%u pvParameter1=%u ulParameter2=%u pxHigherPriorityTaskWoken=%u
|
||||
164 xTimerPendFunctionCall xFunctionToPend=%u pvParameter1=%u ulParameter2=%u xTicksToWait=%u
|
||||
165 pcTimerGetTimerName xTimer=%u
|
||||
165 pcTimerGetName xTimer=%u
|
||||
166 xTimerCreateTimerTask
|
||||
167 xTimerGenericCommand xTimer=%u xCommandID=%u xOptionalValue=%u pxHigherPriorityTaskWoken=%u xTicksToWait=%u
|
||||
53 xQueueGenericSend xQueue=%I pvItemToQueue=%p xTicksToWait=%u xCopyPosition=%u
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
static const char *TAG = "espnow_example";
|
||||
|
||||
static xQueueHandle s_example_espnow_queue;
|
||||
static QueueHandle_t s_example_espnow_queue;
|
||||
|
||||
static uint8_t s_example_broadcast_mac[ESP_NOW_ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
static uint16_t s_example_espnow_seq[EXAMPLE_ESPNOW_DATA_MAX] = { 0, 0 };
|
||||
@@ -153,7 +153,7 @@ static void example_espnow_task(void *pvParameter)
|
||||
bool is_broadcast = false;
|
||||
int ret;
|
||||
|
||||
vTaskDelay(5000 / portTICK_RATE_MS);
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
ESP_LOGI(TAG, "Start sending broadcast data");
|
||||
|
||||
/* Start sending broadcast ESPNOW data. */
|
||||
@@ -188,7 +188,7 @@ static void example_espnow_task(void *pvParameter)
|
||||
|
||||
/* Delay a while before sending the next data. */
|
||||
if (send_param->delay > 0) {
|
||||
vTaskDelay(send_param->delay/portTICK_RATE_MS);
|
||||
vTaskDelay(send_param->delay/portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "send data to "MACSTR"", MAC2STR(send_cb->mac_addr));
|
||||
|
||||
@@ -226,7 +226,7 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass)
|
||||
s_reconnect = false;
|
||||
xEventGroupClearBits(s_wifi_event_group, CONNECTED_BIT);
|
||||
ESP_ERROR_CHECK( esp_wifi_disconnect() );
|
||||
xEventGroupWaitBits(s_wifi_event_group, DISCONNECTED_BIT, 0, 1, portTICK_RATE_MS);
|
||||
xEventGroupWaitBits(s_wifi_event_group, DISCONNECTED_BIT, 0, 1, portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
s_reconnect = true;
|
||||
@@ -235,7 +235,7 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass)
|
||||
ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
|
||||
ESP_ERROR_CHECK( esp_wifi_connect() );
|
||||
|
||||
xEventGroupWaitBits(s_wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_RATE_MS);
|
||||
xEventGroupWaitBits(s_wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_PERIOD_MS);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass)
|
||||
reconnect = false;
|
||||
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
|
||||
ESP_ERROR_CHECK( esp_wifi_disconnect() );
|
||||
xEventGroupWaitBits(wifi_event_group, DISCONNECTED_BIT, 0, 1, portTICK_RATE_MS);
|
||||
xEventGroupWaitBits(wifi_event_group, DISCONNECTED_BIT, 0, 1, portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
reconnect = true;
|
||||
@@ -180,7 +180,7 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass)
|
||||
ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &wifi_config) );
|
||||
esp_wifi_connect();
|
||||
|
||||
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_RATE_MS);
|
||||
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_PERIOD_MS);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* For other possible switch functions (on/off,level up/down,step up/down). User need to implement and create them by themselves
|
||||
*/
|
||||
|
||||
static xQueueHandle gpio_evt_queue = NULL;
|
||||
static QueueHandle_t gpio_evt_queue = NULL;
|
||||
/* button function pair, should be defined in switch example source file */
|
||||
static switch_func_pair_t *switch_func_pair;
|
||||
/* call back function pointer */
|
||||
@@ -123,7 +123,7 @@ static void switch_driver_button_detected(void *arg)
|
||||
evt_flag = false;
|
||||
break;
|
||||
}
|
||||
vTaskDelay(10 / portTICK_RATE_MS);
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user