1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

fixed a small problem in port.c, also added some debug statements.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1246 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
cwabbott 2010-08-08 18:38:03 +00:00 committed by cwabbott
parent c71de4b309
commit f041569bfe

View File

@ -392,13 +392,19 @@ portBASE_TYPE xPortStartScheduler( void )
} else { } else {
ResumeThread(psSim->hThread); ResumeThread(psSim->hThread);
} }
//debug_printf("switched context\n"); debug_printf("switched context\n");
} }
else else
{ {
//Oops, we just suspended the task that we want to resume! //Oops, we just suspended the task that we want to resume!
//TODO: resolve this before it happens //TODO: resolve this before it happens
ResumeThread(psSim->hThread); if(psSim->yielded) {
psSim->yielded = FALSE;
ReleaseSemaphore(psSim->hSemaphore, 1, NULL); // awake next task
} else {
ResumeThread(psSim->hThread);
}
debug_printf("didn't switch context\n");
} }
} }