#include #include #include #include #include #include #include #include #include #include "ipclib_interrupt.h" #define EV1_EVE2_EVENT_NOTIFY 23 #define EVE_LOADING_IPC_EVENT_ID 8 Void eve11_IPC_CallbackFun(uint32_t remoteProcId, uint32_t eventId, uint32_t payload, void *arg, int32_t status); Void Taskfxn_1(UArg arg1, UArg arg2) { System_printf("Hello !! This is from taskfxn_1() \n"); System_flush(); Int32 status = IPCLIB_SOK; UInt16 eveProcId = MultiProc_getId("EVE2"); printf("\n EVE2 Id = %d", eveProcId); printf("\n Im a task function of eve1 \n "); uint32_t numprocs = 0U; System_printf("\n Initializing IPC lib on EVE1 ..... \n"); System_flush(); IpcLib_InterruptInitPrms initPrm; IpcLib_interruptSetDefaultInitPrm(&initPrm); initPrm.validProcIds[numprocs] = IPCLIB_EVE1_ID; numprocs++; initPrm.validProcIds[numprocs] = IPCLIB_EVE2_ID; numprocs++; initPrm.numValidProcs = numprocs; initPrm.msgTimeOut = 0xFFFF; status = IpcLib_interruptInit(&initPrm); System_printf("\n IPC_LIB initialization is done ..... \n"); System_flush(); if (status != IPCLIB_SOK) { System_printf("IPC_LIB initialization failed : EVE1! = %d! \n ", status); System_flush(); } else { System_printf("IPC_LIB initialization successful : EVE1!! =%d \n ",status); System_flush(); } status = IpcLib_interruptEnable(IPCLIB_EVE2_ID); if (status != IPCLIB_SOK) { System_printf("IPC_LIB interruptEnable failed : EVE1! = %d! \n ", status); System_flush(); } else { System_printf("IPC_LIB interruptEnable successful : EVE1!! =%d \n ",status); System_flush(); } System_printf("\n Registering the IpcLib event..... \n"); System_flush(); status = IpcLib_interruptRegisterEvent( IPCLIB_EVE2_ID, 6, (IpcLib_InterruptCallback) (&eve11_IPC_CallbackFun), NULL); if (status != IPCLIB_SOK) { System_printf("Register event failed : EVE1! = %d! \n ", status); System_flush(); } else { System_printf("Register event successful : EVE1! = %d! \n ", status); System_flush(); } System_printf("\n Calling IpcLib_interruptSendEvent() ..... \n"); System_flush(); status = IpcLib_interruptSendEvent(IPCLIB_EVE2_ID, EVE_LOADING_IPC_EVENT_ID, EV1_EVE2_EVENT_NOTIFY, FALSE); if (status != IPCLIB_SOK) { System_printf("Message sent event failed : EVE1! = %d! \n ", status); System_flush(); } else { System_printf("Message sent event successful : EVE1! = %d! \n ", status); System_flush(); } } Void Taskfxn_2(UArg arg1, UArg arg2) { System_printf("\n Hello !! This is from taskfxn_2() >>. DONE....\n"); System_flush(); } int main(int argc, char** argv) { Task_Handle task1, task2; Error_Block eb1,eb2; Task_Params taskparams1,taskparams2; int status; System_printf("\n Starting main()\n"); System_flush(); Error_init(&eb1); Error_init(&eb2); Task_Params_init(&taskparams1); Task_Params_init(&taskparams2); taskparams1.priority = 2; taskparams2.priority = 1; task1 = Task_create(Taskfxn_1, &taskparams1, &eb1); task2 = Task_create(Taskfxn_2, &taskparams2, &eb2); if(NULL==task1 || NULL==task2) { System_abort("\n Error in creating a task for eve1 \n"); System_flush(); } BIOS_start(); return 0; } Void eve11_IPC_CallbackFun(uint32_t remoteProcId, uint32_t eventId, uint32_t payload, void *arg, int32_t status) { uint32_t paylodRecv; paylodRecv = payload; }