diff --git a/packages/ti/osal/src/freertos/HwiP_freertos_c7x.c b/packages/ti/osal/src/freertos/HwiP_freertos_c7x.c
index 44fb4a59cc9e4b9c9562ddf3d4431de38d7dfeb7..0e799ed6a3b5faea8b372bd453fb4209a8c2e332 100644 (file)
/*
* ======== HwiP_clearInterrupt ========
*/
-void HwiP_clearInterrupt(int32_t interruptNum)
+void HwiP_clearInterrupt(uint32_t interruptNum)
{
- Hwi_clearInterrupt((uint32_t)interruptNum);
+ Hwi_clearInterrupt(interruptNum);
}
/*
* ======== HwiP_create ========
*/
-HwiP_Handle HwiP_create(int32_t interruptNum, HwiP_Fxn hwiFxn,
+HwiP_Handle HwiP_create(uint32_t interruptNum, HwiP_Fxn hwiFxn,
const HwiP_Params *params)
{
HwiP_freeRtos *handle = (HwiP_freeRtos *) NULL_PTR;
uint32_t i;
uintptr_t key;
uintptr_t temp;
- HwiP_freeRtos *hwiPool;
+ HwiP_freeRtos *hwiPool;
uint32_t maxHwi;
- int32_t iStat;
+ int32_t iStat;
/* Check if user has specified any memory block to be used, which gets
* the precedence over the internal static memory block
*/
- if (gOsal_HwAttrs.extHwiPBlock.base != (uintptr_t)0U)
+ if ((uintptr_t)0U != gOsal_HwAttrs.extHwiPBlock.base)
{
/* pick up the external memory block configured */
hwiPool = (HwiP_freeRtos *) gOsal_HwAttrs.extHwiPBlock.base;
hwiPool = (HwiP_freeRtos *) &gOsalHwiPFreeRtosPool[0];
maxHwi = OSAL_FREERTOS_C7X_CONFIGNUM_HWI;
- if(gOsalHwiAllocCnt==0U)
+ if(0U == gOsalHwiAllocCnt)
{
(void)memset((void *)gOsalHwiPFreeRtosPool,0,sizeof(gOsalHwiPFreeRtosPool));
}
for (i = 0U; i < maxHwi; i++)
{
- if (hwiPool[i].used == (bool)false)
+ if ((bool)false == hwiPool[i].used)
{
hwiPool[i].used = (bool)true;
/* Update statistics */
handle = (HwiP_freeRtos *) &hwiPool[i];
}
- if (handle != NULL_PTR)
+ if (NULL_PTR != handle)
{
- if (params == NULL_PTR)
+ if (NULL_PTR == params)
{
Hwi_Params_init(&hwiParams);
iStat = Hwi_construct(&handle->hwi, interruptNum, (Hwi_FuncPtr)hwiFxn, &hwiParams);
Hwi_Params_init(&hwiParams);
hwiParams.arg = params->arg;
- if (params->priority==0U)
+ if (0U == params->priority)
{
/* A priority of 0 is invalid for many targets. -1 forces
sysbios to assign a default priority */
hwiParams.priority = (int32_t)params->priority;
}
- hwiParams.eventId = (int32_t)params->evtId;
- if (params->enableIntr == (uint32_t)true)
+ hwiParams.eventId = params->evtId;
+ if (TRUE == params->enableIntr)
{
hwiParams.enableInt = (bool)true;
}
iStat = Hwi_construct(&handle->hwi, interruptNum, (Hwi_FuncPtr)hwiFxn,
&hwiParams);
- if (iStat != 0)
+ if (0 != iStat)
{
/* Free the allocated memory and return null */
handle->used = (bool)false;
/*
* ======== HwiP_createDirect ========
*/
-HwiP_Handle HwiP_createDirect(int32_t interruptNum, HwiP_DirectFxn hwiFxn,
+HwiP_Handle HwiP_createDirect(uint32_t interruptNum, HwiP_DirectFxn hwiFxn,
const HwiP_Params *params)
{
HwiP_Handle handle;
*/
HwiP_Status HwiP_delete(HwiP_Handle handle)
{
- HWIPOSAL_Assert((handle == NULL_PTR));
+ HWIPOSAL_Assert(NULL_PTR == handle);
uintptr_t key;
HwiP_Status ret;
HwiP_freeRtos *hwi = (HwiP_freeRtos *)handle;
- if((hwi!=NULL_PTR) && (hwi->used== (bool)true)) {
+ if((NULL_PTR != hwi) && ((bool)true == hwi->used)) {
Hwi_destruct(&hwi->hwi);
key = HwiP_disable();
hwi->used = (bool)false;
{
uintptr_t key = (uintptr_t)NULL_PTR;
- if(( xPortInIsrContext() == 1 ) ||
- ( xTaskGetSchedulerState() == taskSCHEDULER_NOT_STARTED ))
+ if(( 1 == xPortInIsrContext() ) ||
+ ( taskSCHEDULER_NOT_STARTED == xTaskGetSchedulerState() ))
{
key = Hwi_disable();
}
/*
* ======== HwiP_disableInterrupt ========
*/
-void HwiP_disableInterrupt(int32_t interruptNum)
+void HwiP_disableInterrupt(uint32_t interruptNum)
{
- (void)Hwi_disableInterrupt((uint32_t)interruptNum);
+ (void)Hwi_disableInterrupt(interruptNum);
}
/*
* ======== HwiP_enableInterrupt ========
*/
-void HwiP_enableInterrupt(int32_t interruptNum)
+void HwiP_enableInterrupt(uint32_t interruptNum)
{
- (void)Hwi_enableInterrupt((uint32_t)interruptNum);
+ (void)Hwi_enableInterrupt(interruptNum);
}
/*
params->arg = 0;
params->priority = HWIP_USE_DEFAULT_PRIORITY;
params->evtId = 0;
- params->enableIntr = (uint32_t)true;
+ params->enableIntr = TRUE;
#if defined(__GNUC__) && !defined(__ti__)
#pragma GCC diagnostic push
*/
void HwiP_restore(uintptr_t key)
{
- if(( xPortInIsrContext() == 1) ||
- ( xTaskGetSchedulerState() == taskSCHEDULER_NOT_STARTED ))
+ if(( 1 == xPortInIsrContext() ) ||
+ ( taskSCHEDULER_NOT_STARTED == xTaskGetSchedulerState() ))
{
(void)Hwi_restore((uint32_t)key);
}