Hi everybody,
Could you please help me: i need to use an uart interrupt routine in a RTX code. I've already found some examples for the uart interrupt routine, but i cannot make it work using tasks. Has anybody an example to show me how to use it. Thanks
One thing here is that it is possible to use a mailbox feature and send received characters as the mailbox "pointer" to the read task. The size of the mailbox obviously controls the number of characters that can be queued this way.
It is also possible to just signal the read task that there are one or more characters available in the incomming circular buffer. The read task then clears this signal when it starts processing data. If the ISR is run during the processing, and inserts more data, then the read task might get accidentaly activated once without any more data avaiable. But that isn't really a problem.
The concept of just flagging existence of data means that there isn't any issue of any queue depth for the RTOS. It's just a question if the read task should freeze or not when it has consumed all data in the ring buffer and then performs a new wait. Has the ISR run during the read process, then the task will not block (but might not find more data). Has the ISR not run during the read process, then the read task will get stuck waiting for a new wakeup signal.