Hi, I have SYS/BIOS 6.41.00.26.
I have a simple main.c:
// TP_on set a GPIO pin // TP_off clear GPIO pin static Void task(UArg arg0, UArg arg1) { while(1) { TP_on((TpIdx_t)arg0); TP_off((TpIdx_t)arg0); } } /* * ======== main ======== */ Void main() { // // Enable lazy stacking for interrupt handlers. This allows floating-point // instructions to be used within interrupt handlers, but at the expense of // extra stack usage. // ROM_FPULazyStackingEnable(); TP_init(); Task_Params taskParams; Task_Params_init(&taskParams); taskParams.priority = 1; taskParams.stackSize = 1024; taskParams.arg0 = TP32; Task_create (task, &taskParams, NULL); taskParams.arg0 = TP33; Task_create (task, &taskParams, NULL); BIOS_start(); }
Since I thought that the BIOS was preemptive I programmed the task as if it was the only thread running (as described in SYS/BIOS User Guide 3.5.6), the function task() is implemented as infinite loop without sleep, yield or other similar calls.
Running this example only one pin is toggled. It seems that the scheduler doesn't preempt the running task.
I try to add a Task_yield():
static Void task(UArg arg0, UArg arg1) { while(1) { TP_on((TpIdx_t)arg0); TP_off((TpIdx_t)arg0); Task_yield(); } }
In this way both process runs. But this behaviour is typical of cooperative system.
Is there a way to configure BIOS to preempt task at same priority without need of Task_yield()?
best regards
Max