Tasks are functions which take void arguments and return void. Currently PMU firmware has no way to check that the task returns in a pre-determined time, so this needs to be ensured by the task design. Let us consider a task which prints out a message:
void TaskPrintMsg(void)
{
xil_printf("Task has been triggered\r\n");
}
If we want to schedule the above task to occur every 500ms, the following code can be used. The TaskModPtr is a pointer for module which is scheduling the task.
Status = XPfw_CoreScheduleTask(TaskModPtr, 500U, TaskPrintMsg);
if(XST_SUCCESS == Status) {
xil_printf("Task has been added successfully !\r\n");
}
else {
xil_printf(Ërror: Failed to add Task !\r\n");
}