I need to service a UART input within 5ms. Of course if I poll continuously (without delays) the other tasks would not run. The MQX timer resolution is 5ms so this isn't low enough to reliably respond to the UART if I simply poll every tick for new data. I thought that I should either reduce the timer resolution or implement an ISR to handle this.
In the first solution I assume I would need to increase BSP_ALARM_FREQUENCY from 200 (ticks per second), is this correct? I'm concerned though about how this will affect all the other kernel and timer functionality. Also it seems that the interrupt approach would be preferable and improve efficiency, but if this works it would obviously be much easier at least to start with.
To use an interrupt, I assume I would want to use the _int_install_isr call for the specific UART port interrupt vector (similar to how the “isr” MQX example replaces the timer isr)? I also assume that this would imply that I want to open the polled serial driver (not the interrupt-driven driver). Am I on the right track with this?
If I do this, is there a way to signal another task to process the data immediately (without waiting any ticks), or should I expect to process and respond to the serial data within the ISR? Does the interrupt get triggered on the start bit, or after a full character is received? Will I also see interrupts triggered when I send data?
Are there other potential solutions that I should consider?