mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-06 13:15:19 -05:00
Fix RP2040 build without configASSERT defined
This commit is contained in:
parent
c0585ad814
commit
3ac8598089
1 changed files with 16 additions and 6 deletions
|
|
@ -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
|
||||
uint32_t ulCoreNum = get_core_num();
|
||||
uint32_t ulLockBit = 1u << ulLockNum;
|
||||
configASSERT( ulLockBit < 256u );
|
||||
#ifdef configASSERT
|
||||
configASSERT( ulLockBit < 256u );
|
||||
#endif
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
if( !--ucRecursionCountByLock[ ulLockNum ] )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue