Function-style critical section macros

This commit is contained in:
Scott Lahteine
2020-02-11 01:13:02 -06:00
parent 7b02a62da8
commit fa6e7cb733
15 changed files with 42 additions and 42 deletions

View File

@@ -65,8 +65,8 @@ extern portMUX_TYPE spinlock;
#define NUM_SERIAL 1
#endif
#define CRITICAL_SECTION_START portENTER_CRITICAL(&spinlock)
#define CRITICAL_SECTION_END portEXIT_CRITICAL(&spinlock)
#define CRITICAL_SECTION_START() portENTER_CRITICAL(&spinlock)
#define CRITICAL_SECTION_END() portEXIT_CRITICAL(&spinlock)
#define ISRS_ENABLED() (spinlock.owner == portMUX_FREE_VAL)
#define ENABLE_ISRS() if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock)
#define DISABLE_ISRS() portENTER_CRITICAL(&spinlock)