Skip to content

Commit 478fb63

Browse files
author
Mathias Gredal
committed
RP2040: Fix use of deprecated volatile semantics for C++20 (#1318)
1 parent 44ae6cf commit 478fb63

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static inline void vPortRecursiveLock( BaseType_t xCoreID,
227227
if( ucOwnedByCore[ xCoreID ][ ulLockNum ] )
228228
{
229229
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 255u );
230-
ucRecursionCountByLock[ ulLockNum ]++;
230+
ucRecursionCountByLock[ ulLockNum ] = ucRecursionCountByLock[ ulLockNum ] + 1;
231231
return;
232232
}
233233
spin_lock_unsafe_blocking(pxSpinLock);
@@ -238,10 +238,11 @@ static inline void vPortRecursiveLock( BaseType_t xCoreID,
238238
}
239239
else
240240
{
241-
configASSERT( ( ucOwnedByCore[ xCoreID ] [ulLockNum ] ) != 0 );
241+
configASSERT( ( ucOwnedByCore[ xCoreID ] [ ulLockNum ] ) != 0 );
242242
configASSERT( ucRecursionCountByLock[ ulLockNum ] != 0 );
243243

244-
if( !--ucRecursionCountByLock[ ulLockNum ] )
244+
ucRecursionCountByLock[ ulLockNum ] = ucRecursionCountByLock[ ulLockNum ] - 1;
245+
if (ucRecursionCountByLock[ ulLockNum ] == 0U)
245246
{
246247
ucOwnedByCore[ xCoreID ] [ ulLockNum ] = 0;
247248
spin_unlock_unsafe(pxSpinLock);

0 commit comments

Comments
 (0)