Skip to content

Commit 3ac8598

Browse files
committed
Fix RP2040 build without configASSERT defined
1 parent c0585ad commit 3ac8598

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

portable/ThirdParty/GCC/RP2040/include/portmacro.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,24 @@ static inline void vPortRecursiveLock( uint32_t ulLockNum,
213213
static uint8_t ucOwnedByCore[ portMAX_CORE_COUNT ];
214214
static uint8_t ucRecursionCountByLock[ portRTOS_SPINLOCK_COUNT ];
215215

216-
configASSERT( ulLockNum < portRTOS_SPINLOCK_COUNT );
216+
#ifdef configASSERT
217+
configASSERT( ulLockNum < portRTOS_SPINLOCK_COUNT );
218+
#endif
217219
uint32_t ulCoreNum = get_core_num();
218220
uint32_t ulLockBit = 1u << ulLockNum;
219-
configASSERT( ulLockBit < 256u );
221+
#ifdef configASSERT
222+
configASSERT( ulLockBit < 256u );
223+
#endif
220224

221225
if( uxAcquire )
222226
{
223227
if( __builtin_expect( !*pxSpinLock, 0 ) )
224228
{
225229
if( ucOwnedByCore[ ulCoreNum ] & ulLockBit )
226230
{
227-
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 255u );
231+
#ifdef configASSERT
232+
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 255u );
233+
#endif
228234
ucRecursionCountByLock[ ulLockNum ]++;
229235
return;
230236
}
@@ -235,14 +241,18 @@ static inline void vPortRecursiveLock( uint32_t ulLockNum,
235241
}
236242

237243
__mem_fence_acquire();
238-
configASSERT( ucRecursionCountByLock[ ulLockNum ] == 0 );
244+
#ifdef configASSERT
245+
configASSERT( ucRecursionCountByLock[ ulLockNum ] == 0 );
246+
#endif
239247
ucRecursionCountByLock[ ulLockNum ] = 1;
240248
ucOwnedByCore[ ulCoreNum ] |= ulLockBit;
241249
}
242250
else
243251
{
244-
configASSERT( ( ucOwnedByCore[ ulCoreNum ] & ulLockBit ) != 0 );
245-
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 0 );
252+
#ifdef configASSERT
253+
configASSERT( ( ucOwnedByCore[ ulCoreNum ] & ulLockBit ) != 0 );
254+
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 0 );
255+
#endif
246256

247257
if( !--ucRecursionCountByLock[ ulLockNum ] )
248258
{

0 commit comments

Comments
 (0)