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:
Darian Leung
2022-02-08 17:39:38 +08:00
parent 5810ed1d04
commit 57fd78f5ba
169 changed files with 635 additions and 706 deletions
@@ -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);