Hi,
I'm facing a unexpected behaviour regarding a function called from an Hardware Interruption routine, this is the situation:
1. I am processing an event through an HWI, then form this HWI I call an function:
HWI_Fxn() {
. . .
myFxn();
}
2. From this function I post a SWI, and I added a printf:
myFxn () {
. . .
SWI_post(mySWI);
printf("HWI context\n");
}
3. In the SWI function I also put a printf:
SWI_Fxn() {
printf("SWI context\n");
. . .
}
I used to think that myFxn() runs in HWI context, this means that it runs to completion, thus, myFxn() will schedule the SWI and print; and when myFxn finishes its execution the SWI could be executed.
But I'm getting the prints in the following order:
SWI context
HWI context
Is the myFxn() function really running in a Hardware Interruption context?
If yes, why the SWI is executed before the HWI finishes?
Is this a scheduling issue on the DSP/BIOS or this behavior is expected?
Thanks and best regards.
Armando.