mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-30 04:21:00 +02:00
IDF release/v4.4 ddc44956bf (#5911)
esp-dsp: master 6b25cbb esp-face: master 859f32a esp-rainmaker: f1b82c7 esp32-camera: master 61400bc esp_littlefs: master 3c29afc
This commit is contained in:
@ -139,18 +139,6 @@ BaseType_t xPortInIsrContext(void);
|
||||
*/
|
||||
BaseType_t xPortInterruptedFromISRContext(void);
|
||||
|
||||
/**
|
||||
* @brief Disable interrupts in a nested manner
|
||||
*
|
||||
* - Cleaner solution allows nested interrupts disabling and restoring via local registers or stack.
|
||||
* - They can be called from interrupts too.
|
||||
* - WARNING Only applies to current CPU.
|
||||
*
|
||||
* @note [refactor-todo] Define this as portSET_INTERRUPT_MASK_FROM_ISR() instead
|
||||
* @return unsigned Previous interrupt state
|
||||
*/
|
||||
static inline unsigned portENTER_CRITICAL_NESTED(void);
|
||||
|
||||
/* ---------------------- Spinlocks ------------------------
|
||||
- Spinlocks added to match API with SMP FreeRTOS. Single core RISC-V does not need spin locks
|
||||
- Because single core does not have a primitive spinlock data type, we have to implement one here
|
||||
@ -403,11 +391,10 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void)
|
||||
|
||||
// --------------------- Interrupts ------------------------
|
||||
|
||||
#define portEXIT_CRITICAL_NESTED(state) do { portCLEAR_INTERRUPT_MASK_FROM_ISR(state);} while(0);
|
||||
#define portDISABLE_INTERRUPTS() portSET_INTERRUPT_MASK_FROM_ISR()
|
||||
#define portENABLE_INTERRUPTS() portCLEAR_INTERRUPT_MASK_FROM_ISR(1)
|
||||
#define portSET_INTERRUPT_MASK_FROM_ISR() vPortSetInterruptMask()
|
||||
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(uxSavedStatusValue) vPortClearInterruptMask(uxSavedStatusValue)
|
||||
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(uxSavedStatusValue) vPortClearInterruptMask(uxSavedStatusValue)
|
||||
|
||||
// ------------------ Critical Sections --------------------
|
||||
|
||||
@ -472,11 +459,7 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void)
|
||||
|
||||
// --------------------- Interrupts ------------------------
|
||||
|
||||
static inline unsigned portENTER_CRITICAL_NESTED(void)
|
||||
{
|
||||
unsigned state = portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------- Spinlocks ------------------------
|
||||
|
||||
@ -538,6 +521,14 @@ bool xPortcheckValidStackMem(const void *ptr);
|
||||
#define portVALID_TCB_MEM(ptr) xPortCheckValidTCBMem(ptr)
|
||||
#define portVALID_STACK_MEM(ptr) xPortcheckValidStackMem(ptr)
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------- Deprecate ------------------------------------------------------
|
||||
* - Pull in header containing deprecated macros here
|
||||
* ------------------------------------------------------------------------------------------------------------------ */
|
||||
|
||||
#include "portmacro_deprecated.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* ---------------------------------------------------- Deprecate ------------------------------------------------------
|
||||
* - Macros or functions that should be deprecated in v5.0, then removed in the next major release
|
||||
* - Kept as not to cause a breaking change
|
||||
* - Include this header at the end of portmacro.h
|
||||
* ------------------------------------------------------------------------------------------------------------------ */
|
||||
|
||||
/**
|
||||
* @brief Disable interrupts in a nested manner
|
||||
*
|
||||
* Does the exact same thing as portSET_INTERRUPT_MASK_FROM_ISR()
|
||||
*
|
||||
* @deprecated This function is deprecated. Call portSET_INTERRUPT_MASK_FROM_ISR() instead
|
||||
*/
|
||||
static inline __attribute__((deprecated)) UBaseType_t portENTER_CRITICAL_NESTED(void) {
|
||||
return portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reenables interrupts in a nested manner
|
||||
*
|
||||
* Does the exact same thing as portCLEAR_INTERRUPT_MASK_FROM_ISR()
|
||||
*
|
||||
* @deprecated This function is deprecated. Call portCLEAR_INTERRUPT_MASK_FROM_ISR() instead
|
||||
*/
|
||||
static inline void __attribute__((deprecated)) portEXIT_CRITICAL_NESTED(UBaseType_t prev_level)
|
||||
{
|
||||
portCLEAR_INTERRUPT_MASK_FROM_ISR(prev_level);
|
||||
}
|
Reference in New Issue
Block a user