From 4b94c0a02e74b6bac98bb8e33bee539fc45113a4 Mon Sep 17 00:00:00 2001 From: mandersch <malte.k.andersch@gmail.com> Date: Wed, 14 Sep 2022 12:13:44 +0200 Subject: [PATCH] Fix Tasks 2-99 not running the inner loop --- pb_utils/pb_submitter/test_prog.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pb_utils/pb_submitter/test_prog.c b/pb_utils/pb_submitter/test_prog.c index a1260e89cfbf..74d87392c328 100644 --- a/pb_utils/pb_submitter/test_prog.c +++ b/pb_utils/pb_submitter/test_prog.c @@ -5,12 +5,13 @@ int main(void) { // Make sure program is not finished before pb scheduler takes control sleep(1); - int a = 0; int b = 0; 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 - printf("loop run: %d \n", b); + printf("loop run: %d, c = %d \n", b, c); usleep(1); } return 0; -- GitLab