SysBios 6.33.04.39
Im trying to use Event_post(EventHandle, Event_Id_00) inside an HWI to triger a task doing Event_pend(EventHandle, Event_Id_00, Event_Id_00, BIOS_WAIT_FOREVER) and it doesnt seem to be working correctly.
Are we able to use Event_post() inside a HWI? if yes, is there anything we are doing wrong?
Here is some of the code:
void interrupt CANRX_INTERRUPT()
{
//VARIABLES
unsigned long CanStat;
//GET STATUS OF CAN
CanStat = (HWREG(CAN0_BASE + CAN_O_MSG1INT) & CAN_MSG1INT_INTPND_M);
CanStat |= (HWREG(CAN0_BASE + CAN_O_MSG2INT) << 16);
//IF THERE IS A MESSAGE IN CAN, POST AN EVENT
if((CanStat & 1) == 1)
{
//POST EVENT
Event_post(EventHandle, Event_Id_00);
//CLEAR INTERUPT
CANIntClear();
}
}
void MESSAGE_READ_TASK(UArg args1, UArg args2)
{
while(1)
{
//WAIT FOR EVENT
Event_pend(EventHandle, Event_Id_00, Event_Id_00, 1000000);
//READ DATA
CANMessageGet(CAN0_BASE, 1, &ObjectRx, 1);
}
}