You understood the concept very well. Now, whether you use a RTOS or just plain vanilla coding with interrupts, you will almost always end up using signals(messages in rtos) to indicate occurance of events. Now, that said, the microcontroller executes several instructions every second and appear to happen nearly in synch with your input (unless you are superhuman) Due to that, even though you are polling for an event in the main loop, you will capture it within a few 100uS of your switch operating. You might even be able to capture the switch bounce if your code is optimum. So, do not fear, give it a roll and let us know if it helped.
Another option is to use the BUTTON command of PBP in a tight main loop to decide if you need to run your routine. Use no interrupts at all.


) Due to that, even though you are polling for an event in the main loop, you will capture it within a few 100uS of your switch operating. You might even be able to capture the switch bounce if your code is optimum. So, do not fear, give it a roll and let us know if it helped.


Bookmarks