Page 1 of 1

Main thread loop question

Posted: Wed Nov 19, 2014 2:38 am
by hkerner
In trying to get mailboxes working I wrote a basic application with two threads, one that posted a message every 100ms and one in a while(TRUE) loop that just fetched and toggled the status LED when there was a message. What I found was that it only worked if I had a loop (while(TRUE) chThdSleepMilliseconds(500);) in the main thread. Otherwise it breaks. I was wondering why this is, as it is not intuitive to me.

Re: Main thread loop question

Posted: Wed Nov 19, 2014 9:03 am
by Giovanni
Hi,

Please post the code of your loop.

Giovanni