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

View File

@@ -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);