mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-30 04:21:00 +02:00
IDF release/v4.4 f23dcd3555 (#5996)
esp-dsp: master 6b25cbb esp-face: master d141502 esp-rainmaker: f1b82c7 esp32-camera: master 61400bc esp_littlefs: master 3c29afc
This commit is contained in:
@ -166,10 +166,19 @@
|
||||
#define configSTACK_OVERHEAD_APPTRACE 0
|
||||
#endif
|
||||
|
||||
/* Stack watchpoint decreases minimum usable stack size by up to 60 bytes.
|
||||
See FreeRTOS FREERTOS_WATCHPOINT_END_OF_STACK option in Kconfig. */
|
||||
#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK
|
||||
#define configSTACK_OVERHEAD_WATCHPOINT 60
|
||||
#else
|
||||
#define configSTACK_OVERHEAD_WATCHPOINT 0
|
||||
#endif
|
||||
|
||||
#define configSTACK_OVERHEAD_TOTAL ( \
|
||||
configSTACK_OVERHEAD_CHECKER + \
|
||||
configSTACK_OVERHEAD_OPTIMIZATION + \
|
||||
configSTACK_OVERHEAD_APPTRACE \
|
||||
configSTACK_OVERHEAD_APPTRACE + \
|
||||
configSTACK_OVERHEAD_WATCHPOINT \
|
||||
)
|
||||
|
||||
#define configMINIMAL_STACK_SIZE (768 + configSTACK_OVERHEAD_TOTAL)
|
||||
|
@ -162,69 +162,19 @@ BaseType_t xPortInterruptedFromISRContext(void);
|
||||
typedef struct {
|
||||
uint32_t owner;
|
||||
uint32_t count;
|
||||
#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG
|
||||
const char *lastLockedFn;
|
||||
int lastLockedLine;
|
||||
#endif
|
||||
} portMUX_TYPE;
|
||||
/**< Spinlock initializer */
|
||||
#ifndef CONFIG_FREERTOS_PORTMUX_DEBUG
|
||||
#define portMUX_INITIALIZER_UNLOCKED { \
|
||||
#define portMUX_INITIALIZER_UNLOCKED { \
|
||||
.owner = portMUX_FREE_VAL, \
|
||||
.count = 0, \
|
||||
}
|
||||
#else
|
||||
#define portMUX_INITIALIZER_UNLOCKED { \
|
||||
.owner = portMUX_FREE_VAL, \
|
||||
.count = 0, \
|
||||
.lastLockedFn = "(never locked)", \
|
||||
.lastLockedLine = -1 \
|
||||
}
|
||||
#endif /* CONFIG_FREERTOS_PORTMUX_DEBUG */
|
||||
#define portMUX_FREE_VAL SPINLOCK_FREE /**< Spinlock is free. [refactor-todo] check if this is still required */
|
||||
#define portMUX_NO_TIMEOUT SPINLOCK_WAIT_FOREVER /**< When passed for 'timeout_cycles', spin forever if necessary. [refactor-todo] check if this is still required */
|
||||
#define portMUX_TRY_LOCK SPINLOCK_NO_WAIT /**< Try to acquire the spinlock a single time only. [refactor-todo] check if this is still required */
|
||||
|
||||
/**
|
||||
* @brief Initialize a spinlock
|
||||
*
|
||||
* - Initializes a spinlock that is used by FreeRTOS SMP critical sections
|
||||
*
|
||||
* @note [refactor-todo] We can make this inline or consider making it a macro
|
||||
* @param[in] mux Spinlock
|
||||
*/
|
||||
void vPortCPUInitializeMutex(portMUX_TYPE *mux);
|
||||
|
||||
/**
|
||||
* @brief Acquire a spinlock
|
||||
*
|
||||
* @note [refactor-todo] check if we still need this
|
||||
* @note [refactor-todo] Check if this should be inlined
|
||||
* @param[in] mux Spinlock
|
||||
*/
|
||||
void vPortCPUAcquireMutex(portMUX_TYPE *mux);
|
||||
|
||||
/**
|
||||
* @brief Acquire a spinlock but with a specified timeout
|
||||
*
|
||||
* @note [refactor-todo] Check if we still need this
|
||||
* @note [refactor-todo] Check if this should be inlined
|
||||
* @note [refactor-todo] Check if this function should be renamed (due to bool return type)
|
||||
* @param[in] mux Spinlock
|
||||
* @param[in] timeout Timeout in number of CPU cycles
|
||||
* @return true Spinlock acquired
|
||||
* @return false Timed out
|
||||
*/
|
||||
bool vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout_cycles);
|
||||
|
||||
/**
|
||||
* @brief Release a spinlock
|
||||
*
|
||||
* @note [refactor-todo] check if we still need this
|
||||
* @note [refactor-todo] Check if this should be inlined
|
||||
* @param[in] mux Spinlock
|
||||
*/
|
||||
void vPortCPUReleaseMutex(portMUX_TYPE *mux);
|
||||
#define portMUX_FREE_VAL SPINLOCK_FREE /**< Spinlock is free. [refactor-todo] check if this is still required */
|
||||
#define portMUX_NO_TIMEOUT SPINLOCK_WAIT_FOREVER /**< When passed for 'timeout_cycles', spin forever if necessary. [refactor-todo] check if this is still required */
|
||||
#define portMUX_TRY_LOCK SPINLOCK_NO_WAIT /**< Try to acquire the spinlock a single time only. [refactor-todo] check if this is still required */
|
||||
#define portMUX_INITIALIZE(mux) ({ \
|
||||
(mux)->owner = portMUX_FREE_VAL; \
|
||||
(mux)->count = 0; \
|
||||
})
|
||||
|
||||
/**
|
||||
* @brief Wrapper for atomic compare-and-set instruction
|
||||
@ -398,11 +348,19 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void)
|
||||
|
||||
// ------------------ Critical Sections --------------------
|
||||
|
||||
#define portENTER_CRITICAL(mux) {(void)mux; vPortEnterCritical();}
|
||||
#define portEXIT_CRITICAL(mux) {(void)mux; vPortExitCritical();}
|
||||
#define portENTER_CRITICAL(mux) {(void)mux; vPortEnterCritical();}
|
||||
#define portEXIT_CRITICAL(mux) {(void)mux; vPortExitCritical();}
|
||||
#define portTRY_ENTER_CRITICAL(mux, timeout) ({ \
|
||||
(void)mux; (void)timeout; \
|
||||
vPortEnterCritical(); \
|
||||
BaseType_t ret = pdPASS; \
|
||||
ret; \
|
||||
})
|
||||
//In single-core RISC-V, we can use the same critical section API
|
||||
#define portENTER_CRITICAL_ISR(mux) portENTER_CRITICAL(mux)
|
||||
#define portEXIT_CRITICAL_ISR(mux) portEXIT_CRITICAL(mux)
|
||||
#define portENTER_CRITICAL_ISR(mux) portENTER_CRITICAL(mux)
|
||||
#define portEXIT_CRITICAL_ISR(mux) portEXIT_CRITICAL(mux)
|
||||
#define portTRY_ENTER_CRITICAL_ISR(mux, timeout) portTRY_ENTER_CRITICAL(mux, timeout)
|
||||
|
||||
/* [refactor-todo] on RISC-V, both ISR and non-ISR cases result in the same call. We can redefine this macro */
|
||||
#define portENTER_CRITICAL_SAFE(mux) ({ \
|
||||
if (xPortInIsrContext()) { \
|
||||
@ -418,6 +376,7 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void)
|
||||
portEXIT_CRITICAL(mux); \
|
||||
} \
|
||||
})
|
||||
#define portTRY_ENTER_CRITICAL_SAFE(mux, timeout) portENTER_CRITICAL_SAFE(mux, timeout)
|
||||
|
||||
// ---------------------- Yielding -------------------------
|
||||
|
||||
|
@ -32,3 +32,63 @@ static inline void __attribute__((deprecated)) portEXIT_CRITICAL_NESTED(UBaseTyp
|
||||
{
|
||||
portCLEAR_INTERRUPT_MASK_FROM_ISR(prev_level);
|
||||
}
|
||||
|
||||
/* ---------------------- Spinlocks --------------------- */
|
||||
|
||||
/**
|
||||
* @brief Deprecated placed holder function to initialize a spinlock
|
||||
*
|
||||
* Currently does nothing.
|
||||
*
|
||||
* @deprecated This function is deprecated. If on multi-core, use spinlock_initialize() instead
|
||||
* @param[in] mux Spinlock
|
||||
*/
|
||||
static inline void __attribute__((deprecated)) __attribute__((always_inline)) vPortCPUInitializeMutex(portMUX_TYPE *mux)
|
||||
{
|
||||
(void)mux;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deprecated placed holder function to acquire a spinlock
|
||||
*
|
||||
* Currently does nothing.
|
||||
*
|
||||
* @deprecated This function is deprecated. If on multi-core, use spinlock_acquire() instead
|
||||
* @param[in] mux Spinlock
|
||||
*/
|
||||
static inline void __attribute__((deprecated)) __attribute__((always_inline)) vPortCPUAcquireMutex(portMUX_TYPE *mux)
|
||||
{
|
||||
(void)mux;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deprecated placed holder function to acquire a spinlock but with a specified timeout
|
||||
*
|
||||
* Currently just returns true
|
||||
*
|
||||
* @deprecated This function is deprecated. If on multi-core, use spinlock_acquire() instead
|
||||
* @note Does not have deprecated attribute due to usage in app_trace_util.c
|
||||
* @param[in] mux Spinlock
|
||||
* @param[in] timeout Timeout in number of CPU cycles
|
||||
* @return true Always returns true
|
||||
*/
|
||||
static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout_cycles)
|
||||
{
|
||||
(void)mux;
|
||||
(void)timeout_cycles;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deprecated placed holder function to release a spinlock
|
||||
*
|
||||
* Currently does nothing.
|
||||
*
|
||||
* @deprecated This function is deprecated. If on multi-core, use spinlock_release() instead
|
||||
* @note Does not have deprecated attribute due to usage in app_trace_util.c
|
||||
* @param[in] mux Spinlock
|
||||
*/
|
||||
static inline void __attribute__((always_inline)) vPortCPUReleaseMutex(portMUX_TYPE *mux)
|
||||
{
|
||||
(void)mux;
|
||||
}
|
||||
|
Reference in New Issue
Block a user