Add static initializers for muxes, add mutex init to vPortCPUAcquireMutex

This commit is contained in:
Jeroen Domburg
2016-08-22 17:36:32 +08:00
parent f853f94335
commit 925fbb587e
7 changed files with 16 additions and 6 deletions

View File

@@ -147,6 +147,13 @@ typedef struct {
#define portMUX_VAL_MASK 0x000000FF
#define portMUX_VAL_SHIFT 0
//Keep this in sync with the portMUX_TYPE struct definition
#ifdef portMUX_DEBUG
#define portMUX_INITIALIZER_UNLOCKED { portMUX_MAGIC_VAL|portMUX_FREE_VAL }
#else
#define portMUX_INITIALIZER_UNLOCKED { portMUX_MAGIC_VAL|portMUX_FREE_VAL, "(never locked)", -1 }
#endif
/* Critical section management. NW-TODO: replace XTOS_SET_INTLEVEL with more efficient version, if any? */
// These cannot be nested. They should be used with a lot of care and cannot be called from interrupt level.
#define portDISABLE_INTERRUPTS() do { XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); portbenchmarkINTERRUPT_DISABLE(); } while (0)