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>
diff --git a/portable/ThirdParty/GCC/RP2040/port.c b/portable/ThirdParty/GCC/RP2040/port.c
index 73452e0..bf0dcf4 100644
--- a/portable/ThirdParty/GCC/RP2040/port.c
+++ b/portable/ThirdParty/GCC/RP2040/port.c
@@ -493,7 +493,7 @@
void vPortEnableInterrupts( void )
{
#if ( configSUPPORT_PICO_SYNC_INTEROP == 1 )
- int xCoreID = portGET_CORE_ID();
+ int xCoreID = ( int ) portGET_CORE_ID();
if( pxYieldSpinLock[xCoreID] )
{
spin_lock_t* const pxTmpLock = pxYieldSpinLock[xCoreID];
@@ -530,7 +530,12 @@
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
/* Non blocking, will cause interrupt on other core if the queue isn't already full,
in which case an IRQ must be pending */
@@ -1004,7 +1009,7 @@
// by the spinlock, we can defer until portENABLE_INTERRUPTS is called which is always called when
// the scheduler is unlocked during this call
configASSERT(pxLock->spin_lock);
- int xCoreID = portGET_CORE_ID();
+ int xCoreID = ( int ) portGET_CORE_ID();
pxYieldSpinLock[xCoreID] = pxLock->spin_lock;
ulYieldSpinLockSaveValue[xCoreID] = ulSave;
xEventGroupWaitBits( xEventGroup, prvGetEventGroupBit(pxLock->spin_lock),
@@ -1076,7 +1081,7 @@
* by the spinlock, we can defer until portENABLE_INTERRUPTS is called which is always called when
* the scheduler is unlocked during this call */
configASSERT(pxLock->spin_lock);
- int xCoreID = portGET_CORE_ID();
+ int xCoreID = ( int ) portGET_CORE_ID();
pxYieldSpinLock[xCoreID] = pxLock->spin_lock;
ulYieldSpinLockSaveValue[xCoreID] = ulSave;
xEventGroupWaitBits( xEventGroup,
diff --git a/tasks.c b/tasks.c
index c4e8bd4..b630730 100644
--- a/tasks.c
+++ b/tasks.c
@@ -5541,7 +5541,7 @@
/* xTask is NULL then get the state of the calling task. */
pxTCB = prvGetTCBFromHandle( xTask );
- pxTaskStatus->xHandle = ( TaskHandle_t ) pxTCB;
+ pxTaskStatus->xHandle = pxTCB;
pxTaskStatus->pcTaskName = ( const char * ) &( pxTCB->pcTaskName[ 0 ] );
pxTaskStatus->uxCurrentPriority = pxTCB->uxPriority;
pxTaskStatus->pxStackBase = pxTCB->pxStack;