Main thread loop question

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
hkerner
Posts: 24
Joined: Tue Jul 22, 2014 12:05 am

Main thread loop question

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Main thread loop question

Post by Giovanni »

Hi,

Please post the code of your loop.

Giovanni
Post Reply