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 ucOwnedByCore[ portMAX_CORE_COUNT ];
|
||||||
static uint8_t ucRecursionCountByLock[ portRTOS_SPINLOCK_COUNT ];
|
static uint8_t ucRecursionCountByLock[ portRTOS_SPINLOCK_COUNT ];
|
||||||
|
|
||||||
|
#ifdef configASSERT
|
||||||
configASSERT( ulLockNum < portRTOS_SPINLOCK_COUNT );
|
configASSERT( ulLockNum < portRTOS_SPINLOCK_COUNT );
|
||||||
|
#endif
|
||||||
uint32_t ulCoreNum = get_core_num();
|
uint32_t ulCoreNum = get_core_num();
|
||||||
uint32_t ulLockBit = 1u << ulLockNum;
|
uint32_t ulLockBit = 1u << ulLockNum;
|
||||||
|
#ifdef configASSERT
|
||||||
configASSERT( ulLockBit < 256u );
|
configASSERT( ulLockBit < 256u );
|
||||||
|
#endif
|
||||||
|
|
||||||
if( uxAcquire )
|
if( uxAcquire )
|
||||||
{
|
{
|
||||||
|
|
@ -224,7 +228,9 @@ static inline void vPortRecursiveLock( uint32_t ulLockNum,
|
||||||
{
|
{
|
||||||
if( ucOwnedByCore[ ulCoreNum ] & ulLockBit )
|
if( ucOwnedByCore[ ulCoreNum ] & ulLockBit )
|
||||||
{
|
{
|
||||||
|
#ifdef configASSERT
|
||||||
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 255u );
|
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 255u );
|
||||||
|
#endif
|
||||||
ucRecursionCountByLock[ ulLockNum ]++;
|
ucRecursionCountByLock[ ulLockNum ]++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -235,14 +241,18 @@ static inline void vPortRecursiveLock( uint32_t ulLockNum,
|
||||||
}
|
}
|
||||||
|
|
||||||
__mem_fence_acquire();
|
__mem_fence_acquire();
|
||||||
|
#ifdef configASSERT
|
||||||
configASSERT( ucRecursionCountByLock[ ulLockNum ] == 0 );
|
configASSERT( ucRecursionCountByLock[ ulLockNum ] == 0 );
|
||||||
|
#endif
|
||||||
ucRecursionCountByLock[ ulLockNum ] = 1;
|
ucRecursionCountByLock[ ulLockNum ] = 1;
|
||||||
ucOwnedByCore[ ulCoreNum ] |= ulLockBit;
|
ucOwnedByCore[ ulCoreNum ] |= ulLockBit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef configASSERT
|
||||||
configASSERT( ( ucOwnedByCore[ ulCoreNum ] & ulLockBit ) != 0 );
|
configASSERT( ( ucOwnedByCore[ ulCoreNum ] & ulLockBit ) != 0 );
|
||||||
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 0 );
|
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 0 );
|
||||||
|
#endif
|
||||||
|
|
||||||
if( !--ucRecursionCountByLock[ ulLockNum ] )
|
if( !--ucRecursionCountByLock[ ulLockNum ] )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue