Re: UART2 RX interrupt how to do it?
Posted: Mon Mar 03, 2025 5:09 pm
Hi,
There is something I do not get in all the above examples. You either have a while (1) loop to wait for an event to occur or a for (;;) which is for me the same.
The whole point of the interrupt is precisely to not have such types of infinite loops that do eat cpu time.
After looking all over internet it seems that the only way to get a true interrupt mechanism, firing an interrupt handler to recover the bytes from the uart needs to be written from scratch right? In the isr handler beside clearing the interrupts we also need to give a semaphore to the actual uart_data_process task.
The queue management waiting for an event to happen does not look to me any better than just waiting for bytes to appear at the uart with the proper flags being raised…..
Am I right or I miss something fundamental ?
Thanks
There is something I do not get in all the above examples. You either have a while (1) loop to wait for an event to occur or a for (;;) which is for me the same.
The whole point of the interrupt is precisely to not have such types of infinite loops that do eat cpu time.
After looking all over internet it seems that the only way to get a true interrupt mechanism, firing an interrupt handler to recover the bytes from the uart needs to be written from scratch right? In the isr handler beside clearing the interrupts we also need to give a semaphore to the actual uart_data_process task.
The queue management waiting for an event to happen does not look to me any better than just waiting for bytes to appear at the uart with the proper flags being raised…..
Am I right or I miss something fundamental ?
Thanks