Hi,
I have one or buttons that when depressed, cause a serial port message to be sent. When a key has not been depressed, I want to send a query and read a response. I am considering two ways to do this;
#1. Have an event with a timeout. On timeout I query and read a response. Otherwise, when a button is depressed, I send a "command".
#2. Have an event with NO timeout but have a parallel execution thread thats always writing and reading on a timed basis.
Method #1 seems the most intuitive to me to prevent conflict (only 1 thing can be done at a time, either send the command or poll).
But I am wondering what would happen if method #2 was implemented. Is there a way to "block" the push button if the poll path is taken. Obviously I wouldn't want to start a poll and then have the push button interrupt the poll-response.