summaryrefslogtreecommitdiff
path: root/src/osal
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2026-03-06 11:57:53 +0700
committerGitHub <[email protected]>2026-03-06 11:57:53 +0700
commit06a4c6d7190ef83f76b2a65496f2a48a54a8c134 (patch)
tree71489788f7dab079de99948dc25bfeaa9be292d0 /src/osal
parent694d921643be7c81fae42eb438cc29bf1560980c (diff)
parent94baf394686f92d9edaf109dcae30fa7b531fefc (diff)
Merge pull request #3528 from hathach/improve-iar-warnings
Add IAR warning flags to CMake build and resolve warnings
Diffstat (limited to 'src/osal')
-rw-r--r--src/osal/osal_freertos.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/osal/osal_freertos.h b/src/osal/osal_freertos.h
index 32ee2d55c..db724179d 100644
--- a/src/osal/osal_freertos.h
+++ b/src/osal/osal_freertos.h
@@ -141,11 +141,12 @@ TU_ATTR_ALWAYS_INLINE static inline void osal_spin_init(osal_spinlock_t *ctx) {
TU_ATTR_ALWAYS_INLINE static inline void osal_spin_lock(osal_spinlock_t *ctx, bool in_isr) {
if (in_isr) {
- if (TUP_MCU_MULTIPLE_CORE == 0) {
- (void) ctx;
- return; // single core MCU does not need to lock in ISR
- }
+ #if TUP_MCU_MULTIPLE_CORE
*ctx = taskENTER_CRITICAL_FROM_ISR();
+ #else
+ (void) ctx;
+ return; // single core MCU does not need to lock in ISR
+ #endif
} else {
taskENTER_CRITICAL();
}
@@ -153,11 +154,12 @@ TU_ATTR_ALWAYS_INLINE static inline void osal_spin_lock(osal_spinlock_t *ctx, bo
TU_ATTR_ALWAYS_INLINE static inline void osal_spin_unlock(osal_spinlock_t *ctx, bool in_isr) {
if (in_isr) {
- if (TUP_MCU_MULTIPLE_CORE == 0) {
- (void) ctx;
- return; // single core MCU does not need to lock in ISR
- }
+ #if TUP_MCU_MULTIPLE_CORE
taskEXIT_CRITICAL_FROM_ISR(*ctx);
+ #else
+ (void) ctx;
+ return; // single core MCU does not need to lock in ISR
+ #endif
} else {
taskEXIT_CRITICAL();
}