diff --git a/portable/ThirdParty/GCC/RP2040/include/portmacro.h b/portable/ThirdParty/GCC/RP2040/include/portmacro.h index bf91eda36f..06246ebc1e 100644 --- a/portable/ThirdParty/GCC/RP2040/include/portmacro.h +++ b/portable/ThirdParty/GCC/RP2040/include/portmacro.h @@ -213,10 +213,14 @@ static inline void vPortRecursiveLock( uint32_t ulLockNum, static uint8_t ucOwnedByCore[ portMAX_CORE_COUNT ]; static uint8_t ucRecursionCountByLock[ portRTOS_SPINLOCK_COUNT ]; - configASSERT( ulLockNum < portRTOS_SPINLOCK_COUNT ); + #ifdef configASSERT + configASSERT( ulLockNum < portRTOS_SPINLOCK_COUNT ); + #endif /* configASSERT */ uint32_t ulCoreNum = get_core_num(); uint32_t ulLockBit = 1u << ulLockNum; - configASSERT( ulLockBit < 256u ); + #ifdef configASSERT + configASSERT( ulLockBit < 256u ); + #endif /* configASSERT */ if( uxAcquire ) { @@ -224,7 +228,9 @@ static inline void vPortRecursiveLock( uint32_t ulLockNum, { if( ucOwnedByCore[ ulCoreNum ] & ulLockBit ) { - configASSERT( ucRecursionCountByLock[ ulLockNum ] != 255u ); + #ifdef configASSERT + configASSERT( ucRecursionCountByLock[ ulLockNum ] != 255u ); + #endif /* configASSERT */ ucRecursionCountByLock[ ulLockNum ]++; return; } @@ -235,14 +241,18 @@ static inline void vPortRecursiveLock( uint32_t ulLockNum, } __mem_fence_acquire(); - configASSERT( ucRecursionCountByLock[ ulLockNum ] == 0 ); + #ifdef configASSERT + configASSERT( ucRecursionCountByLock[ ulLockNum ] == 0 ); + #endif /* configASSERT */ ucRecursionCountByLock[ ulLockNum ] = 1; ucOwnedByCore[ ulCoreNum ] |= ulLockBit; } else { - configASSERT( ( ucOwnedByCore[ ulCoreNum ] & ulLockBit ) != 0 ); - configASSERT( ucRecursionCountByLock[ ulLockNum ] != 0 ); + #ifdef configASSERT + configASSERT( ( ucOwnedByCore[ ulCoreNum ] & ulLockBit ) != 0 ); + configASSERT( ucRecursionCountByLock[ ulLockNum ] != 0 ); + #endif /* configASSERT */ if( !--ucRecursionCountByLock[ ulLockNum ] ) {