Fix RP2040 compile warning (#736)

* Fix Pico compile warning -- port layer

* Warning resolved for volatile discard task.c (#5)

---------

Co-authored-by: Pranjal Chanda <40349163+pranjalchanda08@users.noreply.github.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
ActoryOu 2023-08-03 16:56:42 +08:00 committed by GitHub
parent 20300df3c3
commit dd1b87dae9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -493,7 +493,7 @@ void vPortYield( void )
void vPortEnableInterrupts( void ) void vPortEnableInterrupts( void )
{ {
#if ( configSUPPORT_PICO_SYNC_INTEROP == 1 ) #if ( configSUPPORT_PICO_SYNC_INTEROP == 1 )
int xCoreID = portGET_CORE_ID(); int xCoreID = ( int ) portGET_CORE_ID();
if( pxYieldSpinLock[xCoreID] ) if( pxYieldSpinLock[xCoreID] )
{ {
spin_lock_t* const pxTmpLock = pxYieldSpinLock[xCoreID]; spin_lock_t* const pxTmpLock = pxYieldSpinLock[xCoreID];
@ -530,7 +530,12 @@ void vClearInterruptMaskFromISR( __attribute__( ( unused ) ) uint32_t ulMask )
void vYieldCore( int xCoreID ) void vYieldCore( int xCoreID )
{ {
configASSERT(xCoreID != portGET_CORE_ID()); /* Remove warning if configASSERT is not defined.
* xCoreID is not used in this function due to this is a dual-core system. The yielding core must be different from the current core. */
( void ) xCoreID;
configASSERT( xCoreID != ( int ) portGET_CORE_ID() );
#if portRUNNING_ON_BOTH_CORES #if portRUNNING_ON_BOTH_CORES
/* Non blocking, will cause interrupt on other core if the queue isn't already full, /* Non blocking, will cause interrupt on other core if the queue isn't already full,
in which case an IRQ must be pending */ in which case an IRQ must be pending */
@ -1004,7 +1009,7 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void )
// by the spinlock, we can defer until portENABLE_INTERRUPTS is called which is always called when // by the spinlock, we can defer until portENABLE_INTERRUPTS is called which is always called when
// the scheduler is unlocked during this call // the scheduler is unlocked during this call
configASSERT(pxLock->spin_lock); configASSERT(pxLock->spin_lock);
int xCoreID = portGET_CORE_ID(); int xCoreID = ( int ) portGET_CORE_ID();
pxYieldSpinLock[xCoreID] = pxLock->spin_lock; pxYieldSpinLock[xCoreID] = pxLock->spin_lock;
ulYieldSpinLockSaveValue[xCoreID] = ulSave; ulYieldSpinLockSaveValue[xCoreID] = ulSave;
xEventGroupWaitBits( xEventGroup, prvGetEventGroupBit(pxLock->spin_lock), xEventGroupWaitBits( xEventGroup, prvGetEventGroupBit(pxLock->spin_lock),
@ -1076,7 +1081,7 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void )
* by the spinlock, we can defer until portENABLE_INTERRUPTS is called which is always called when * by the spinlock, we can defer until portENABLE_INTERRUPTS is called which is always called when
* the scheduler is unlocked during this call */ * the scheduler is unlocked during this call */
configASSERT(pxLock->spin_lock); configASSERT(pxLock->spin_lock);
int xCoreID = portGET_CORE_ID(); int xCoreID = ( int ) portGET_CORE_ID();
pxYieldSpinLock[xCoreID] = pxLock->spin_lock; pxYieldSpinLock[xCoreID] = pxLock->spin_lock;
ulYieldSpinLockSaveValue[xCoreID] = ulSave; ulYieldSpinLockSaveValue[xCoreID] = ulSave;
xEventGroupWaitBits( xEventGroup, xEventGroupWaitBits( xEventGroup,

View file

@ -5541,7 +5541,7 @@ static void prvCheckTasksWaitingTermination( void )
/* xTask is NULL then get the state of the calling task. */ /* xTask is NULL then get the state of the calling task. */
pxTCB = prvGetTCBFromHandle( xTask ); pxTCB = prvGetTCBFromHandle( xTask );
pxTaskStatus->xHandle = ( TaskHandle_t ) pxTCB; pxTaskStatus->xHandle = pxTCB;
pxTaskStatus->pcTaskName = ( const char * ) &( pxTCB->pcTaskName[ 0 ] ); pxTaskStatus->pcTaskName = ( const char * ) &( pxTCB->pcTaskName[ 0 ] );
pxTaskStatus->uxCurrentPriority = pxTCB->uxPriority; pxTaskStatus->uxCurrentPriority = pxTCB->uxPriority;
pxTaskStatus->pxStackBase = pxTCB->pxStack; pxTaskStatus->pxStackBase = pxTCB->pxStack;