Skip to content
Snippets Groups Projects
Commit 4b94c0a0 authored by mandersch's avatar mandersch
Browse files

Fix Tasks 2-99 not running the inner loop

parent 3e758815
Branches
No related tags found
No related merge requests found
...@@ -5,12 +5,13 @@ int main(void) ...@@ -5,12 +5,13 @@ int main(void)
{ {
// Make sure program is not finished before pb scheduler takes control // Make sure program is not finished before pb scheduler takes control
sleep(1); sleep(1);
int a = 0;
int b = 0; int b = 0;
for (;b < 100; b++) { for (;b < 100; b++) {
for (;a < 100000; a++){asm("");} int a = 0;
int c = 0;
for (;a < 100000; a++){c = c + a;}
// check if program runs && syscall to switch tasks // check if program runs && syscall to switch tasks
printf("loop run: %d \n", b); printf("loop run: %d, c = %d \n", b, c);
usleep(1); usleep(1);
} }
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment