Skip to content

Commit 4a12dba

Browse files
authored
Updated FreeRTOS names (#8418)
1 parent 431bf8b commit 4a12dba

21 files changed

+41
-41
lines changed

Diff for: cores/esp32/HWCDC.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
ESP_EVENT_DEFINE_BASE(ARDUINO_HW_CDC_EVENTS);
3333

3434
static RingbufHandle_t tx_ring_buf = NULL;
35-
static xQueueHandle rx_queue = NULL;
35+
static QueueHandle_t rx_queue = NULL;
3636
static uint8_t rx_data_buf[64] = {0};
3737
static intr_handle_t intr_handle = NULL;
3838
static volatile bool initial_empty = false;
39-
static xSemaphoreHandle tx_lock = NULL;
39+
static SemaphoreHandle_t tx_lock = NULL;
4040

4141
// workaround for when USB CDC is not connected
4242
static uint32_t tx_timeout_ms = 0;

Diff for: cores/esp32/HardwareSerial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void HardwareSerial::_uartEventTask(void *args)
298298
if (uartEventQueue != NULL) {
299299
for(;;) {
300300
//Waiting for UART event.
301-
if(xQueueReceive(uartEventQueue, (void * )&event, (portTickType)portMAX_DELAY)) {
301+
if(xQueueReceive(uartEventQueue, (void * )&event, (TickType_t)portMAX_DELAY)) {
302302
hardwareSerial_error_t currentErr = UART_NO_ERROR;
303303
switch(event.type) {
304304
case UART_DATA:

Diff for: cores/esp32/USBCDC.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ size_t USBCDC::setRxBufferSize(size_t rx_queue_len){
123123
uxQueueSpacesAvailable(rx_queue) + uxQueueMessagesWaiting(rx_queue) : 0;
124124

125125
if (rx_queue_len != currentQueueSize) {
126-
xQueueHandle new_rx_queue = NULL;
126+
QueueHandle_t new_rx_queue = NULL;
127127
if (rx_queue_len) {
128128
new_rx_queue = xQueueCreate(rx_queue_len, sizeof(uint8_t));
129129
if(!new_rx_queue){

Diff for: cores/esp32/USBCDC.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ class USBCDC: public Stream
135135
bool rts;
136136
bool connected;
137137
bool reboot_enable;
138-
xQueueHandle rx_queue;
139-
xSemaphoreHandle tx_lock;
138+
QueueHandle_t rx_queue;
139+
SemaphoreHandle_t tx_lock;
140140
uint32_t tx_timeout_ms;
141141

142142
};

Diff for: cores/esp32/esp32-hal-cpu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ typedef struct apb_change_cb_s {
6060

6161

6262
static apb_change_t * apb_change_callbacks = NULL;
63-
static xSemaphoreHandle apb_change_lock = NULL;
63+
static SemaphoreHandle_t apb_change_lock = NULL;
6464

6565
static void initApbChangeCallback(){
6666
static volatile bool initialized = false;

Diff for: cores/esp32/esp32-hal-i2c-slave.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ typedef struct i2c_slave_struct_t {
7676
void * arg;
7777
intr_handle_t intr_handle;
7878
TaskHandle_t task_handle;
79-
xQueueHandle event_queue;
79+
QueueHandle_t event_queue;
8080
#if I2C_SLAVE_USE_RX_QUEUE
81-
xQueueHandle rx_queue;
81+
QueueHandle_t rx_queue;
8282
#else
8383
RingbufHandle_t rx_ring_buf;
8484
#endif
85-
xQueueHandle tx_queue;
85+
QueueHandle_t tx_queue;
8686
uint32_t rx_data_count;
8787
#if !CONFIG_DISABLE_HAL_LOCKS
88-
xSemaphoreHandle lock;
88+
SemaphoreHandle_t lock;
8989
#endif
9090
} i2c_slave_struct_t;
9191

@@ -431,7 +431,7 @@ size_t i2cSlaveWrite(uint8_t num, const uint8_t *buf, uint32_t len, uint32_t tim
431431
to_queue = len;
432432
}
433433
for (size_t i = 0; i < to_queue; i++) {
434-
if (xQueueSend(i2c->tx_queue, &buf[i], timeout_ms / portTICK_RATE_MS) != pdTRUE) {
434+
if (xQueueSend(i2c->tx_queue, &buf[i], timeout_ms / portTICK_PERIOD_MS) != pdTRUE) {
435435
xQueueReset(i2c->tx_queue);
436436
to_queue = 0;
437437
break;

Diff for: cores/esp32/esp32-hal-i2c.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ esp_err_t i2cWrite(uint8_t i2c_num, uint16_t address, const uint8_t* buff, size_
184184
}
185185

186186
//short implementation does not support zero size writes (example when scanning) PR in IDF?
187-
//ret = i2c_master_write_to_device((i2c_port_t)i2c_num, address, buff, size, timeOutMillis / portTICK_RATE_MS);
187+
//ret = i2c_master_write_to_device((i2c_port_t)i2c_num, address, buff, size, timeOutMillis / portTICK_PERIOD_MS);
188188

189189
ret = ESP_OK;
190190
uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = { 0 };
@@ -207,7 +207,7 @@ esp_err_t i2cWrite(uint8_t i2c_num, uint16_t address, const uint8_t* buff, size_
207207
if (ret != ESP_OK) {
208208
goto end;
209209
}
210-
ret = i2c_master_cmd_begin((i2c_port_t)i2c_num, cmd, timeOutMillis / portTICK_RATE_MS);
210+
ret = i2c_master_cmd_begin((i2c_port_t)i2c_num, cmd, timeOutMillis / portTICK_PERIOD_MS);
211211

212212
end:
213213
if(cmd != NULL){
@@ -235,7 +235,7 @@ esp_err_t i2cRead(uint8_t i2c_num, uint16_t address, uint8_t* buff, size_t size,
235235
if(!bus[i2c_num].initialized){
236236
log_e("bus is not initialized");
237237
} else {
238-
ret = i2c_master_read_from_device((i2c_port_t)i2c_num, address, buff, size, timeOutMillis / portTICK_RATE_MS);
238+
ret = i2c_master_read_from_device((i2c_port_t)i2c_num, address, buff, size, timeOutMillis / portTICK_PERIOD_MS);
239239
if(ret == ESP_OK){
240240
*readCount = size;
241241
} else {
@@ -264,7 +264,7 @@ esp_err_t i2cWriteReadNonStop(uint8_t i2c_num, uint16_t address, const uint8_t*
264264
if(!bus[i2c_num].initialized){
265265
log_e("bus is not initialized");
266266
} else {
267-
ret = i2c_master_write_read_device((i2c_port_t)i2c_num, address, wbuff, wsize, rbuff, rsize, timeOutMillis / portTICK_RATE_MS);
267+
ret = i2c_master_write_read_device((i2c_port_t)i2c_num, address, wbuff, wsize, rbuff, rsize, timeOutMillis / portTICK_PERIOD_MS);
268268
if(ret == ESP_OK){
269269
*readCount = rsize;
270270
} else {

Diff for: cores/esp32/esp32-hal-rmt.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct rmt_obj_s {
6060
size_t *num_symbols_read; // Pointer to the number of RMT symbol read by IDF RMT RX Done
6161

6262
#if !CONFIG_DISABLE_HAL_LOCKS
63-
xSemaphoreHandle g_rmt_objlocks; // Channel Semaphore Lock
63+
SemaphoreHandle_t g_rmt_objlocks; // Channel Semaphore Lock
6464
#endif /* CONFIG_DISABLE_HAL_LOCKS */
6565
};
6666

@@ -69,7 +69,7 @@ typedef struct rmt_obj_s *rmt_bus_handle_t;
6969
/**
7070
Internal variables used in RMT API
7171
*/
72-
static xSemaphoreHandle g_rmt_block_lock = NULL;
72+
static SemaphoreHandle_t g_rmt_block_lock = NULL;
7373

7474
/**
7575
Internal method (private) declarations

Diff for: cores/esp32/esp32-hal-spi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
struct spi_struct_t {
6060
spi_dev_t * dev;
6161
#if !CONFIG_DISABLE_HAL_LOCKS
62-
xSemaphoreHandle lock;
62+
SemaphoreHandle_t lock;
6363
#endif
6464
uint8_t num;
6565
int8_t sck;

Diff for: cores/esp32/esp32-hal-tinyusb.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static void hw_cdc_reset_handler(void *arg) {
406406
usb_serial_jtag_ll_clr_intsts_mask(usbjtag_intr_status);
407407

408408
if (usbjtag_intr_status & USB_SERIAL_JTAG_INTR_BUS_RESET) {
409-
xSemaphoreGiveFromISR((xSemaphoreHandle)arg, &xTaskWoken);
409+
xSemaphoreGiveFromISR((SemaphoreHandle_t)arg, &xTaskWoken);
410410
}
411411

412412
if (xTaskWoken == pdTRUE) {
@@ -441,7 +441,7 @@ static void usb_switch_to_cdc_jtag(){
441441
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
442442
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_BUS_RESET);
443443
intr_handle_t intr_handle = NULL;
444-
xSemaphoreHandle reset_sem = xSemaphoreCreateBinary();
444+
SemaphoreHandle_t reset_sem = xSemaphoreCreateBinary();
445445
if(reset_sem){
446446
if(esp_intr_alloc(ETS_USB_SERIAL_JTAG_INTR_SOURCE, 0, hw_cdc_reset_handler, reset_sem, &intr_handle) != ESP_OK){
447447
vSemaphoreDelete(reset_sem);

Diff for: cores/esp32/esp32-hal-uart.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static int s_uart_debug_nr = 0;
3838
struct uart_struct_t {
3939

4040
#if !CONFIG_DISABLE_HAL_LOCKS
41-
xSemaphoreHandle lock;
41+
SemaphoreHandle_t lock;
4242
#endif
4343

4444
uint8_t num;
@@ -459,7 +459,7 @@ uint8_t uartRead(uart_t* uart)
459459
c = uart->peek_byte;
460460
} else {
461461

462-
int len = uart_read_bytes(uart->num, &c, 1, 20 / portTICK_RATE_MS);
462+
int len = uart_read_bytes(uart->num, &c, 1, 20 / portTICK_PERIOD_MS);
463463
if (len <= 0) { // includes negative return from IDF in case of error
464464
c = 0;
465465
}
@@ -481,7 +481,7 @@ uint8_t uartPeek(uart_t* uart)
481481
if (uart->has_peek) {
482482
c = uart->peek_byte;
483483
} else {
484-
int len = uart_read_bytes(uart->num, &c, 1, 20 / portTICK_RATE_MS);
484+
int len = uart_read_bytes(uart->num, &c, 1, 20 / portTICK_PERIOD_MS);
485485
if (len <= 0) { // includes negative return from IDF in case of error
486486
c = 0;
487487
} else {

Diff for: libraries/AsyncUDP/src/AsyncUDP.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ typedef struct {
145145
struct netif * netif;
146146
} lwip_event_packet_t;
147147

148-
static xQueueHandle _udp_queue;
148+
static QueueHandle_t _udp_queue;
149149
static volatile TaskHandle_t _udp_task_handle = NULL;
150150

151151
static void _udp_task(void *pvParameters){

Diff for: libraries/AsyncUDP/src/AsyncUDP.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class AsyncUDP : public Print
104104
{
105105
protected:
106106
udp_pcb *_pcb;
107-
//xSemaphoreHandle _lock;
107+
//SemaphoreHandle_t _lock;
108108
bool _connected;
109109
esp_err_t _lastErr;
110110
AuPacketHandlerFunction _handler;

Diff for: libraries/BluetoothSerial/src/BluetoothSerial.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ const char * _spp_server_name = "ESP32SPP";
4747
#define SPP_CONGESTED_TIMEOUT 1000
4848

4949
static uint32_t _spp_client = 0;
50-
static xQueueHandle _spp_rx_queue = NULL;
51-
static xQueueHandle _spp_tx_queue = NULL;
50+
static QueueHandle_t _spp_rx_queue = NULL;
51+
static QueueHandle_t _spp_tx_queue = NULL;
5252
static SemaphoreHandle_t _spp_tx_done = NULL;
5353
static TaskHandle_t _spp_task_handle = NULL;
5454
static EventGroupHandle_t _spp_event_group = NULL;

Diff for: libraries/USB/examples/CustomHIDDevice/CustomHIDDevice.ino

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#if ARDUINO_USB_MODE
2-
#warning This sketch should be used when USB is in OTG mode
3-
void setup(){}
4-
void loop(){}
2+
#warning This sketch should be used when USB is in OTG mode
3+
void setup(){}
4+
void loop(){}
55
#else
6-
#include "USB.h"
7-
#include "USBHID.h"
8-
USBHID HID;
6+
#include "USB.h"
7+
#include "USBHID.h"
8+
USBHID HID;
99

1010
static const uint8_t report_descriptor[] = { // 8 axis
1111
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
@@ -55,7 +55,6 @@ public:
5555
};
5656

5757
CustomHIDDevice Device;
58-
#endif /* ARDUINO_USB_MODE */
5958

6059
const int buttonPin = 0;
6160
int previousButtonState = HIGH;
@@ -83,3 +82,4 @@ void loop() {
8382
delay(100);
8483
}
8584
}
85+
#endif /* ARDUINO_USB_MODE */

Diff for: libraries/USB/src/USBHID.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ static tinyusb_hid_device_t tinyusb_hid_devices[USB_HID_DEVICES_MAX];
3636

3737
static uint8_t tinyusb_hid_devices_num = 0;
3838
static bool tinyusb_hid_devices_is_initialized = false;
39-
static xSemaphoreHandle tinyusb_hid_device_input_sem = NULL;
40-
static xSemaphoreHandle tinyusb_hid_device_input_mutex = NULL;
39+
static SemaphoreHandle_t tinyusb_hid_device_input_sem = NULL;
40+
static SemaphoreHandle_t tinyusb_hid_device_input_mutex = NULL;
4141

4242
static bool tinyusb_hid_is_initialized = false;
4343
static uint8_t tinyusb_loaded_hid_devices_num = 0;

Diff for: libraries/USB/src/USBHIDVendor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ esp_err_t arduino_usb_event_handler_register_with(esp_event_base_t event_base, i
6060
// max size is 64 and we need one byte for the report ID
6161
static uint8_t HID_VENDOR_REPORT_SIZE = 63;
6262
static uint8_t feature[64];
63-
static xQueueHandle rx_queue = NULL;
63+
static QueueHandle_t rx_queue = NULL;
6464
static bool prepend_size = false;
6565

6666
USBHIDVendor::USBHIDVendor(uint8_t report_size, bool prepend): hid(){

Diff for: libraries/USB/src/USBVendor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ esp_err_t arduino_usb_event_post(esp_event_base_t event_base, int32_t event_id,
2323
esp_err_t arduino_usb_event_handler_register_with(esp_event_base_t event_base, int32_t event_id, esp_event_handler_t event_handler, void *event_handler_arg);
2424

2525
static USBVendor * _Vendor = NULL;
26-
static xQueueHandle rx_queue = NULL;
26+
static QueueHandle_t rx_queue = NULL;
2727
static uint8_t USB_VENDOR_ENDPOINT_SIZE = 64;
2828

2929
uint16_t tusb_vendor_load_descriptor(uint8_t * dst, uint8_t * itf)
-4 Bytes
Binary file not shown.

Diff for: libraries/WiFi/examples/FTM/FTM_Initiator/FTM_Initiator.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const uint8_t FTM_FRAME_COUNT = 16;
2323
const uint16_t FTM_BURST_PERIOD = 2;
2424

2525
// Semaphore to signal when FTM Report has been received
26-
xSemaphoreHandle ftmSemaphore;
26+
SemaphoreHandle_t ftmSemaphore;
2727
// Status of the received FTM Report
2828
bool ftmSuccess = true;
2929

Diff for: libraries/WiFi/src/WiFiGeneric.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static void set_esp_netif_hostname(const char * name){
296296
}
297297
}
298298

299-
static xQueueHandle _arduino_event_queue;
299+
static QueueHandle_t _arduino_event_queue;
300300
static TaskHandle_t _arduino_event_task_handle = NULL;
301301
static EventGroupHandle_t _arduino_event_group = NULL;
302302

0 commit comments

Comments
 (0)