From 50145ed17927b9a80646c843ed6ae8bd7f878e53 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Wed, 8 Feb 2023 17:51:11 -0300 Subject: [PATCH] esp_rom: Remove STATUS struct in favor of ETS_STATUS Signed-off-by: Gustavo Henrique Nihei --- .../esp_rom/include/esp32/rom/ets_sys.h | 10 ++++-- components/esp_rom/include/esp32/rom/uart.h | 16 ++++----- .../esp_rom/include/esp32c2/rom/ets_sys.h | 10 ++++-- components/esp_rom/include/esp32c2/rom/uart.h | 12 +++---- .../esp_rom/include/esp32c3/rom/ets_sys.h | 10 ++++-- components/esp_rom/include/esp32c3/rom/uart.h | 10 +++--- .../esp_rom/include/esp32c6/rom/ets_sys.h | 10 ++++-- components/esp_rom/include/esp32c6/rom/uart.h | 12 +++---- .../esp_rom/include/esp32h2/rom/ets_sys.h | 10 ++++-- components/esp_rom/include/esp32h2/rom/uart.h | 12 +++---- .../esp_rom/include/esp32h4/rom/ets_sys.h | 10 ++++-- components/esp_rom/include/esp32h4/rom/uart.h | 12 +++---- .../esp_rom/include/esp32s2/rom/ets_sys.h | 10 ++++-- components/esp_rom/include/esp32s2/rom/uart.h | 34 +++++++------------ .../esp_rom/include/esp32s3/rom/ets_sys.h | 10 ++++-- components/esp_rom/include/esp32s3/rom/uart.h | 10 +++--- .../esp_supplicant/src/esp_scan.c | 4 +-- .../esp_supplicant/src/esp_wps.c | 6 ++-- tools/ci/check_copyright_ignore.txt | 1 - 19 files changed, 124 insertions(+), 85 deletions(-) diff --git a/components/esp_rom/include/esp32/rom/ets_sys.h b/components/esp_rom/include/esp32/rom/ets_sys.h index 6f9688fcf1..549db8ffc6 100644 --- a/components/esp_rom/include/esp32/rom/ets_sys.h +++ b/components/esp_rom/include/esp32/rom/ets_sys.h @@ -48,7 +48,10 @@ extern "C" { typedef enum { ETS_OK = 0, /**< return successful in ets*/ - ETS_FAILED = 1 /**< return failed in ets*/ + ETS_FAILED = 1, /**< return failed in ets*/ + ETS_PENDING = 2, + ETS_BUSY = 3, + ETS_CANCEL = 4, } ETS_STATUS; typedef uint32_t ETSSignal; @@ -621,13 +624,16 @@ void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num); #define ETS_MEM_BAR() asm volatile ( "" : : : "memory" ) +#ifdef ESP_PLATFORM +// Remove in IDF v6.0 (IDF-7044) typedef enum { OK = 0, FAIL, PENDING, BUSY, CANCEL, -} STATUS; +} STATUS __attribute__((deprecated("Use ETS_STATUS instead"))); +#endif /** * @} diff --git a/components/esp_rom/include/esp32/rom/uart.h b/components/esp_rom/include/esp32/rom/uart.h index 3eb59f30f9..3bd0d38f48 100644 --- a/components/esp_rom/include/esp32/rom/uart.h +++ b/components/esp_rom/include/esp32/rom/uart.h @@ -227,7 +227,7 @@ void uart_buff_switch(uint8_t uart_no); * * @return OK. */ -STATUS uart_tx_one_char(uint8_t TxChar); +ETS_STATUS uart_tx_one_char(uint8_t TxChar); /** * @brief Output a char to message exchange channel, wait until fifo not full. @@ -237,7 +237,7 @@ STATUS uart_tx_one_char(uint8_t TxChar); * * @return OK. */ -STATUS uart_tx_one_char2(uint8_t TxChar); +ETS_STATUS uart_tx_one_char2(uint8_t TxChar); /** * @brief Wait until uart tx full empty. @@ -273,7 +273,7 @@ static inline void IRAM_ATTR uart_tx_wait_idle(uint8_t uart_no) { * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_one_char(uint8_t *pRxChar); +ETS_STATUS uart_rx_one_char(uint8_t *pRxChar); /** * @brief Get an input char from message channel, wait until successful. @@ -295,7 +295,7 @@ char uart_rx_one_char_block(void); * * @return OK. */ -STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); +ETS_STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); /** * @brief Process uart received information in the interrupt handler. @@ -318,7 +318,7 @@ void uart_rx_intr_handler(void *para); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); +ETS_STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); /** * @brief Get all chars from receive buffer. @@ -329,7 +329,7 @@ STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); * @return OK for successful. * FAIL for failed. */ -STATUS UartGetCmdLn(uint8_t *pCmdLn); +ETS_STATUS UartGetCmdLn(uint8_t *pCmdLn); /** * @brief Get uart configuration struct. @@ -379,7 +379,7 @@ int recv_packet(uint8_t *p, int len, uint8_t is_sync); * @return OK for successful. * FAIL for failed. */ -STATUS SendMsg(uint8_t *pData, uint16_t DataLen); +ETS_STATUS SendMsg(uint8_t *pData, uint16_t DataLen); /** * @brief Receive an packet from download tool, with SLIP escaping. @@ -395,7 +395,7 @@ STATUS SendMsg(uint8_t *pData, uint16_t DataLen); * @return OK for successful. * FAIL for failed. */ -STATUS RcvMsg(uint8_t *pData, uint16_t MaxDataLen, uint8_t is_sync); +ETS_STATUS RcvMsg(uint8_t *pData, uint16_t MaxDataLen, uint8_t is_sync); extern UartDevice UartDev; diff --git a/components/esp_rom/include/esp32c2/rom/ets_sys.h b/components/esp_rom/include/esp32c2/rom/ets_sys.h index 6d2e3a4ef4..ad642fcc46 100644 --- a/components/esp_rom/include/esp32c2/rom/ets_sys.h +++ b/components/esp_rom/include/esp32c2/rom/ets_sys.h @@ -43,7 +43,10 @@ extern "C" { typedef enum { ETS_OK = 0, /**< return successful in ets*/ - ETS_FAILED = 1 /**< return failed in ets*/ + ETS_FAILED = 1, /**< return failed in ets*/ + ETS_PENDING = 2, + ETS_BUSY = 3, + ETS_CANCEL = 4, } ETS_STATUS; typedef ETS_STATUS ets_status_t; @@ -438,13 +441,16 @@ void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num); #define ETS_MEM_BAR() asm volatile ( "" : : : "memory" ) +#ifdef ESP_PLATFORM +// Remove in IDF v6.0 (IDF-7044) typedef enum { OK = 0, FAIL, PENDING, BUSY, CANCEL, -} STATUS; +} STATUS __attribute__((deprecated("Use ETS_STATUS instead"))); +#endif /** * @} diff --git a/components/esp_rom/include/esp32c2/rom/uart.h b/components/esp_rom/include/esp32c2/rom/uart.h index 8a4507e810..454e0d83a1 100644 --- a/components/esp_rom/include/esp32c2/rom/uart.h +++ b/components/esp_rom/include/esp32c2/rom/uart.h @@ -205,7 +205,7 @@ void uart_tx_switch(uint8_t uart_no); * * @return OK. */ -STATUS uart_tx_one_char(uint8_t TxChar); +ETS_STATUS uart_tx_one_char(uint8_t TxChar); /** * @brief Output a char to message exchange channel, wait until fifo not full. @@ -215,7 +215,7 @@ STATUS uart_tx_one_char(uint8_t TxChar); * * @return OK. */ -STATUS uart_tx_one_char2(uint8_t TxChar); +ETS_STATUS uart_tx_one_char2(uint8_t TxChar); /** * @brief Wait until uart tx full empty. @@ -245,7 +245,7 @@ void uart_tx_wait_idle(uint8_t uart_no); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_one_char(uint8_t *pRxChar); +ETS_STATUS uart_rx_one_char(uint8_t *pRxChar); /** * @brief Get an input char from message channel, wait until successful. @@ -267,7 +267,7 @@ char uart_rx_one_char_block(void); * * @return OK. */ -STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); +ETS_STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); /** * @brief Get an char from receive buffer. @@ -280,7 +280,7 @@ STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); +ETS_STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); /** * @brief Get all chars from receive buffer. @@ -291,7 +291,7 @@ STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); * @return OK for successful. * FAIL for failed. */ -STATUS UartGetCmdLn(uint8_t *pCmdLn); +ETS_STATUS UartGetCmdLn(uint8_t *pCmdLn); /** * @brief Get uart configuration struct. diff --git a/components/esp_rom/include/esp32c3/rom/ets_sys.h b/components/esp_rom/include/esp32c3/rom/ets_sys.h index d5489bd835..06b3b47d8c 100644 --- a/components/esp_rom/include/esp32c3/rom/ets_sys.h +++ b/components/esp_rom/include/esp32c3/rom/ets_sys.h @@ -43,7 +43,10 @@ extern "C" { typedef enum { ETS_OK = 0, /**< return successful in ets*/ - ETS_FAILED = 1 /**< return failed in ets*/ + ETS_FAILED = 1, /**< return failed in ets*/ + ETS_PENDING = 2, + ETS_BUSY = 3, + ETS_CANCEL = 4, } ETS_STATUS; typedef ETS_STATUS ets_status_t; @@ -430,13 +433,16 @@ void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num); #define ETS_MEM_BAR() asm volatile ( "" : : : "memory" ) +#ifdef ESP_PLATFORM +// Remove in IDF v6.0 (IDF-7044) typedef enum { OK = 0, FAIL, PENDING, BUSY, CANCEL, -} STATUS; +} STATUS __attribute__((deprecated("Use ETS_STATUS instead"))); +#endif /** * @} diff --git a/components/esp_rom/include/esp32c3/rom/uart.h b/components/esp_rom/include/esp32c3/rom/uart.h index 0cd91b06d5..a4fbd52077 100644 --- a/components/esp_rom/include/esp32c3/rom/uart.h +++ b/components/esp_rom/include/esp32c3/rom/uart.h @@ -195,7 +195,7 @@ void uart_div_modify(uint8_t uart_no, uint32_t DivLatchValue); * * @return OK. */ -STATUS uart_tx_one_char(uint8_t TxChar); +ETS_STATUS uart_tx_one_char(uint8_t TxChar); /** * @brief Output a char to message exchange channel, wait until fifo not full. @@ -205,7 +205,7 @@ STATUS uart_tx_one_char(uint8_t TxChar); * * @return OK. */ -STATUS uart_tx_one_char2(uint8_t TxChar); +ETS_STATUS uart_tx_one_char2(uint8_t TxChar); /** * @brief Wait until uart tx full empty. @@ -235,7 +235,7 @@ void uart_tx_wait_idle(uint8_t uart_no); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_one_char(uint8_t *pRxChar); +ETS_STATUS uart_rx_one_char(uint8_t *pRxChar); /** * @brief Get an input char from message channel, wait until successful. @@ -257,7 +257,7 @@ char uart_rx_one_char_block(void); * * @return OK. */ -STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); +ETS_STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); /** * @brief Get an char from receive buffer. @@ -270,7 +270,7 @@ STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); +ETS_STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); /** * @brief Get uart configuration struct. diff --git a/components/esp_rom/include/esp32c6/rom/ets_sys.h b/components/esp_rom/include/esp32c6/rom/ets_sys.h index 48a724d54b..7c04af3a54 100644 --- a/components/esp_rom/include/esp32c6/rom/ets_sys.h +++ b/components/esp_rom/include/esp32c6/rom/ets_sys.h @@ -43,7 +43,10 @@ extern "C" { typedef enum { ETS_OK = 0, /**< return successful in ets*/ - ETS_FAILED = 1 /**< return failed in ets*/ + ETS_FAILED = 1, /**< return failed in ets*/ + ETS_PENDING = 2, + ETS_BUSY = 3, + ETS_CANCEL = 4, } ETS_STATUS; typedef ETS_STATUS ets_status_t; @@ -407,13 +410,16 @@ void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num); #define ETS_MEM_BAR() asm volatile ( "" : : : "memory" ) +#ifdef ESP_PLATFORM +// Remove in IDF v6.0 (IDF-7044) typedef enum { OK = 0, FAIL, PENDING, BUSY, CANCEL, -} STATUS; +} STATUS __attribute__((deprecated("Use ETS_STATUS instead"))); +#endif /** * @} diff --git a/components/esp_rom/include/esp32c6/rom/uart.h b/components/esp_rom/include/esp32c6/rom/uart.h index 380f19a4e5..9045c42f6f 100644 --- a/components/esp_rom/include/esp32c6/rom/uart.h +++ b/components/esp_rom/include/esp32c6/rom/uart.h @@ -205,7 +205,7 @@ void uart_tx_switch(uint8_t uart_no); * * @return OK. */ -STATUS uart_tx_one_char(uint8_t TxChar); +ETS_STATUS uart_tx_one_char(uint8_t TxChar); /** * @brief Output a char to message exchange channel, wait until fifo not full. @@ -215,7 +215,7 @@ STATUS uart_tx_one_char(uint8_t TxChar); * * @return OK. */ -STATUS uart_tx_one_char2(uint8_t TxChar); +ETS_STATUS uart_tx_one_char2(uint8_t TxChar); /** * @brief Wait until uart tx full empty. @@ -245,7 +245,7 @@ void uart_tx_wait_idle(uint8_t uart_no); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_one_char(uint8_t *pRxChar); +ETS_STATUS uart_rx_one_char(uint8_t *pRxChar); /** * @brief Get an input char from message channel, wait until successful. @@ -267,7 +267,7 @@ char uart_rx_one_char_block(void); * * @return OK. */ -STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); +ETS_STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); /** * @brief Process uart recevied information in the interrupt handler. @@ -290,7 +290,7 @@ void uart_rx_intr_handler(void *para); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); +ETS_STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); /** * @brief Get all chars from receive buffer. @@ -301,7 +301,7 @@ STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); * @return OK for successful. * FAIL for failed. */ -STATUS UartGetCmdLn(uint8_t *pCmdLn); +ETS_STATUS UartGetCmdLn(uint8_t *pCmdLn); /** * @brief Get uart configuration struct. diff --git a/components/esp_rom/include/esp32h2/rom/ets_sys.h b/components/esp_rom/include/esp32h2/rom/ets_sys.h index b9ac5a13f4..b9247bc3bd 100644 --- a/components/esp_rom/include/esp32h2/rom/ets_sys.h +++ b/components/esp_rom/include/esp32h2/rom/ets_sys.h @@ -43,7 +43,10 @@ extern "C" { typedef enum { ETS_OK = 0, /**< return successful in ets*/ - ETS_FAILED = 1 /**< return failed in ets*/ + ETS_FAILED = 1, /**< return failed in ets*/ + ETS_PENDING = 2, + ETS_BUSY = 3, + ETS_CANCEL = 4, } ETS_STATUS; typedef ETS_STATUS ets_status_t; @@ -406,13 +409,16 @@ void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num); #define ETS_MEM_BAR() asm volatile ( "" : : : "memory" ) +#ifdef ESP_PLATFORM +// Remove in IDF v6.0 (IDF-7044) typedef enum { OK = 0, FAIL, PENDING, BUSY, CANCEL, -} STATUS; +} STATUS __attribute__((deprecated("Use ETS_STATUS instead"))); +#endif /** * @} diff --git a/components/esp_rom/include/esp32h2/rom/uart.h b/components/esp_rom/include/esp32h2/rom/uart.h index 380f19a4e5..9045c42f6f 100644 --- a/components/esp_rom/include/esp32h2/rom/uart.h +++ b/components/esp_rom/include/esp32h2/rom/uart.h @@ -205,7 +205,7 @@ void uart_tx_switch(uint8_t uart_no); * * @return OK. */ -STATUS uart_tx_one_char(uint8_t TxChar); +ETS_STATUS uart_tx_one_char(uint8_t TxChar); /** * @brief Output a char to message exchange channel, wait until fifo not full. @@ -215,7 +215,7 @@ STATUS uart_tx_one_char(uint8_t TxChar); * * @return OK. */ -STATUS uart_tx_one_char2(uint8_t TxChar); +ETS_STATUS uart_tx_one_char2(uint8_t TxChar); /** * @brief Wait until uart tx full empty. @@ -245,7 +245,7 @@ void uart_tx_wait_idle(uint8_t uart_no); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_one_char(uint8_t *pRxChar); +ETS_STATUS uart_rx_one_char(uint8_t *pRxChar); /** * @brief Get an input char from message channel, wait until successful. @@ -267,7 +267,7 @@ char uart_rx_one_char_block(void); * * @return OK. */ -STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); +ETS_STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); /** * @brief Process uart recevied information in the interrupt handler. @@ -290,7 +290,7 @@ void uart_rx_intr_handler(void *para); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); +ETS_STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); /** * @brief Get all chars from receive buffer. @@ -301,7 +301,7 @@ STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); * @return OK for successful. * FAIL for failed. */ -STATUS UartGetCmdLn(uint8_t *pCmdLn); +ETS_STATUS UartGetCmdLn(uint8_t *pCmdLn); /** * @brief Get uart configuration struct. diff --git a/components/esp_rom/include/esp32h4/rom/ets_sys.h b/components/esp_rom/include/esp32h4/rom/ets_sys.h index 902127abfb..91544de628 100644 --- a/components/esp_rom/include/esp32h4/rom/ets_sys.h +++ b/components/esp_rom/include/esp32h4/rom/ets_sys.h @@ -43,7 +43,10 @@ extern "C" { typedef enum { ETS_OK = 0, /**< return successful in ets*/ - ETS_FAILED = 1 /**< return failed in ets*/ + ETS_FAILED = 1, /**< return failed in ets*/ + ETS_PENDING = 2, + ETS_BUSY = 3, + ETS_CANCEL = 4, } ETS_STATUS; typedef ETS_STATUS ets_status_t; @@ -441,13 +444,16 @@ void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num); #define ETS_MEM_BAR() asm volatile ( "" : : : "memory" ) +#ifdef ESP_PLATFORM +// Remove in IDF v6.0 (IDF-7044) typedef enum { OK = 0, FAIL, PENDING, BUSY, CANCEL, -} STATUS; +} STATUS __attribute__((deprecated("Use ETS_STATUS instead"))); +#endif /** * @} diff --git a/components/esp_rom/include/esp32h4/rom/uart.h b/components/esp_rom/include/esp32h4/rom/uart.h index d271893d76..28677ac409 100644 --- a/components/esp_rom/include/esp32h4/rom/uart.h +++ b/components/esp_rom/include/esp32h4/rom/uart.h @@ -205,7 +205,7 @@ void uart_tx_switch(uint8_t uart_no); * * @return OK. */ -STATUS uart_tx_one_char(uint8_t TxChar); +ETS_STATUS uart_tx_one_char(uint8_t TxChar); /** * @brief Output a char to message exchange channel, wait until fifo not full. @@ -215,7 +215,7 @@ STATUS uart_tx_one_char(uint8_t TxChar); * * @return OK. */ -STATUS uart_tx_one_char2(uint8_t TxChar); +ETS_STATUS uart_tx_one_char2(uint8_t TxChar); /** * @brief Wait until uart tx full empty. @@ -245,7 +245,7 @@ void uart_tx_wait_idle(uint8_t uart_no); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_one_char(uint8_t *pRxChar); +ETS_STATUS uart_rx_one_char(uint8_t *pRxChar); /** * @brief Get an input char from message channel, wait until successful. @@ -267,7 +267,7 @@ char uart_rx_one_char_block(void); * * @return OK. */ -STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); +ETS_STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); /** * @brief Get an char from receive buffer. @@ -280,7 +280,7 @@ STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); +ETS_STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); /** * @brief Get all chars from receive buffer. @@ -291,7 +291,7 @@ STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); * @return OK for successful. * FAIL for failed. */ -STATUS UartGetCmdLn(uint8_t *pCmdLn); +ETS_STATUS UartGetCmdLn(uint8_t *pCmdLn); /** * @brief Get uart configuration struct. diff --git a/components/esp_rom/include/esp32s2/rom/ets_sys.h b/components/esp_rom/include/esp32s2/rom/ets_sys.h index a2cf1adce3..19c1994de7 100644 --- a/components/esp_rom/include/esp32s2/rom/ets_sys.h +++ b/components/esp_rom/include/esp32s2/rom/ets_sys.h @@ -45,7 +45,10 @@ extern "C" { typedef enum { ETS_OK = 0, /**< return successful in ets*/ - ETS_FAILED = 1 /**< return failed in ets*/ + ETS_FAILED = 1, /**< return failed in ets*/ + ETS_PENDING = 2, + ETS_BUSY = 3, + ETS_CANCEL = 4, } ETS_STATUS; typedef ETS_STATUS ets_status_t; @@ -556,13 +559,16 @@ void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num); #define ETS_MEM_BAR() asm volatile ( "" : : : "memory" ) +#ifdef ESP_PLATFORM +// Remove in IDF v6.0 (IDF-7044) typedef enum { OK = 0, FAIL, PENDING, BUSY, CANCEL, -} STATUS; +} STATUS __attribute__((deprecated("Use ETS_STATUS instead"))); +#endif /** * @} diff --git a/components/esp_rom/include/esp32s2/rom/uart.h b/components/esp_rom/include/esp32s2/rom/uart.h index 899413f317..491d2c28fb 100644 --- a/components/esp_rom/include/esp32s2/rom/uart.h +++ b/components/esp_rom/include/esp32s2/rom/uart.h @@ -1,16 +1,8 @@ -// Copyright 2010-2016 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: 2010-2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ROM_UART_H_ #define _ROM_UART_H_ @@ -251,7 +243,7 @@ void uart_buff_switch(uint8_t uart_no); * * @return OK. */ -STATUS uart_tx_one_char(uint8_t TxChar); +ETS_STATUS uart_tx_one_char(uint8_t TxChar); /** * @brief Output a char to message exchange channel, wait until fifo not full. @@ -261,7 +253,7 @@ STATUS uart_tx_one_char(uint8_t TxChar); * * @return OK. */ -STATUS uart_tx_one_char2(uint8_t TxChar); +ETS_STATUS uart_tx_one_char2(uint8_t TxChar); /** * @brief Wait until uart tx full empty. @@ -291,7 +283,7 @@ void uart_tx_wait_idle(uint8_t uart_no); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_one_char(uint8_t *pRxChar); +ETS_STATUS uart_rx_one_char(uint8_t *pRxChar); /** * @brief Get an input char from message channel, wait until successful. @@ -313,7 +305,7 @@ char uart_rx_one_char_block(void); * * @return OK. */ -STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); +ETS_STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); /** * @brief Process uart recevied information in the interrupt handler. @@ -336,7 +328,7 @@ void uart_rx_intr_handler(void *para); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); +ETS_STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); /** * @brief Get all chars from receive buffer. @@ -347,7 +339,7 @@ STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); * @return OK for successful. * FAIL for failed. */ -STATUS UartGetCmdLn(uint8_t *pCmdLn); +ETS_STATUS UartGetCmdLn(uint8_t *pCmdLn); /** * @brief Get uart configuration struct. @@ -397,7 +389,7 @@ int recv_packet(uint8_t *p, int len, uint8_t is_sync); * @return OK for successful. * FAIL for failed. */ -STATUS SendMsg(uint8_t *pData, uint16_t DataLen); +ETS_STATUS SendMsg(uint8_t *pData, uint16_t DataLen); /** * @brief Receive an packet from download tool, with SLIP escaping. @@ -413,7 +405,7 @@ STATUS SendMsg(uint8_t *pData, uint16_t DataLen); * @return OK for successful. * FAIL for failed. */ -STATUS RcvMsg(uint8_t *pData, uint16_t MaxDataLen, uint8_t is_sync); +ETS_STATUS RcvMsg(uint8_t *pData, uint16_t MaxDataLen, uint8_t is_sync); /** * @brief Check if this UART is in download connection. diff --git a/components/esp_rom/include/esp32s3/rom/ets_sys.h b/components/esp_rom/include/esp32s3/rom/ets_sys.h index 9047442c36..83c93b2eb6 100644 --- a/components/esp_rom/include/esp32s3/rom/ets_sys.h +++ b/components/esp_rom/include/esp32s3/rom/ets_sys.h @@ -43,7 +43,10 @@ extern "C" { typedef enum { ETS_OK = 0, /**< return successful in ets*/ - ETS_FAILED = 1 /**< return failed in ets*/ + ETS_FAILED = 1, /**< return failed in ets*/ + ETS_PENDING = 2, + ETS_BUSY = 3, + ETS_CANCEL = 4, } ETS_STATUS; typedef ETS_STATUS ets_status_t; @@ -543,13 +546,16 @@ void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num); #define ETS_MEM_BAR() asm volatile ( "" : : : "memory" ) +#ifdef ESP_PLATFORM +// Remove in IDF v6.0 (IDF-7044) typedef enum { OK = 0, FAIL, PENDING, BUSY, CANCEL, -} STATUS; +} STATUS __attribute__((deprecated("Use ETS_STATUS instead"))); +#endif /** * @} diff --git a/components/esp_rom/include/esp32s3/rom/uart.h b/components/esp_rom/include/esp32s3/rom/uart.h index 3486886ad5..864563f788 100644 --- a/components/esp_rom/include/esp32s3/rom/uart.h +++ b/components/esp_rom/include/esp32s3/rom/uart.h @@ -203,7 +203,7 @@ void uart_tx_switch(uint8_t uart_no); * * @return OK. */ -STATUS uart_tx_one_char(uint8_t TxChar); +ETS_STATUS uart_tx_one_char(uint8_t TxChar); /** * @brief Output a char to message exchange channel, wait until fifo not full. @@ -213,7 +213,7 @@ STATUS uart_tx_one_char(uint8_t TxChar); * * @return OK. */ -STATUS uart_tx_one_char2(uint8_t TxChar); +ETS_STATUS uart_tx_one_char2(uint8_t TxChar); /** * @brief Wait until uart tx full empty. @@ -243,7 +243,7 @@ void uart_tx_wait_idle(uint8_t uart_no); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_one_char(uint8_t *pRxChar); +ETS_STATUS uart_rx_one_char(uint8_t *pRxChar); /** * @brief Get an input char from message channel, wait until successful. @@ -265,7 +265,7 @@ char uart_rx_one_char_block(void); * * @return OK. */ -STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); +ETS_STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); /** * @brief Get an char from receive buffer. @@ -278,7 +278,7 @@ STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); * @return OK for successful. * FAIL for failed. */ -STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); +ETS_STATUS uart_rx_readbuff( RcvMsgBuff *pRxBuff, uint8_t *pRxByte); /** * @brief Get uart configuration struct. diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_scan.c b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c index 21f9b1e05e..6abb0e0602 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_scan.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c @@ -24,7 +24,7 @@ extern struct wpa_supplicant g_wpa_supp; -static void scan_done_event_handler(void *arg, STATUS status) +static void scan_done_event_handler(void *arg, ETS_STATUS status) { struct wpa_supplicant *wpa_s = &g_wpa_supp; @@ -226,7 +226,7 @@ static int issue_scan(struct wpa_supplicant *wpa_s, wpa_s->type |= (1 << WLAN_FC_STYPE_BEACON) | (1 << WLAN_FC_STYPE_PROBE_RESP); esp_wifi_register_mgmt_frame_internal(wpa_s->type, wpa_s->subtype); - typedef void (* scan_done_cb_t)(void *arg, STATUS status); + typedef void (* scan_done_cb_t)(void *arg, ETS_STATUS status); extern int esp_wifi_promiscuous_scan_start(wifi_scan_config_t *config, scan_done_cb_t cb); /* issue scan */ if (esp_wifi_promiscuous_scan_start(params, scan_done_event_handler) < 0) { diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index b5d1ac622e..21dd374f1b 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -56,7 +56,7 @@ static uint8_t s_wps_sig_cnt[SIG_WPS_NUM] = {0}; #endif -void wifi_wps_scan_done(void *arg, STATUS status); +void wifi_wps_scan_done(void *arg, ETS_STATUS status); void wifi_wps_scan(void *data, void *user_ctx); int wifi_station_wps_start(void); int wps_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len); @@ -1532,7 +1532,7 @@ wps_sm_get(void) } void -wifi_wps_scan_done(void *arg, STATUS status) +wifi_wps_scan_done(void *arg, ETS_STATUS status) { struct wps_sm *sm = gWpsSm; wifi_config_t wifi_config = {0}; @@ -1596,7 +1596,7 @@ wifi_wps_scan_internal(void) sm->scan_cnt++; wpa_printf(MSG_DEBUG, "wifi_wps_scan : %d", sm->scan_cnt); - typedef void (* scan_done_cb_t)(void *arg, STATUS status); + typedef void (* scan_done_cb_t)(void *arg, ETS_STATUS status); extern int esp_wifi_promiscuous_scan_start(wifi_scan_config_t *config, scan_done_cb_t cb); esp_wifi_promiscuous_scan_start(NULL, wifi_wps_scan_done); } diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 06a3c78985..b6100f65e4 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -501,7 +501,6 @@ components/esp_rom/include/esp32s2/rom/libc_stubs.h components/esp_rom/include/esp32s2/rom/opi_flash.h components/esp_rom/include/esp32s2/rom/rsa_pss.h components/esp_rom/include/esp32s2/rom/sha.h -components/esp_rom/include/esp32s2/rom/uart.h components/esp_rom/include/esp32s2/rom/usb/cdc_acm.h components/esp_rom/include/esp32s2/rom/usb/chip_usb_dw_wrapper.h components/esp_rom/include/esp32s2/rom/usb/cpio.h