-
Notifications
You must be signed in to change notification settings - Fork 1k
[PR 496 rework] Disable USART IRQ in uart_write and uart_debug_write #502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can you explain under what conditions this would happen? |
In fact by default, the Defining |
Signed-off-by: Frederic Pillon <[email protected]>
Signed-off-by: Frederic.Pillon <[email protected]>
When a receive IT fires while the HAL handle is locked, the receive callback fails to re-enable the IT and the serial port stops receiving anymore. This can happen when transmit IT is enabled outside the IRQ in HardwareSerial::write(), following a buffer full condition that disables transmit IT in HAL_UART_TxCpltCallback(). Solution is to temporarily disable the IRQ while the interrupt enable flags are modified.
Signed-off-by: Frederic.Pillon <[email protected]>
I've added some code enhancement which allow to save space and avoid loop to search the right |
Remove of 4 arrays which are no more needed. Add rx/tx_callback in the serial_t. Signed-off-by: Frederic.Pillon <[email protected]>
baudrate, databits, stopbits and parity are used only during init. So, they are no reason to save them in the structure. This allow to save space. Signed-off-by: Frederic.Pillon <[email protected]>
This PR is a rework of #496 and fixes issues #494 and #467
It hardens and enhances the original PR.
I've tested several config and it works with Arduino Serial monitor.
Note that if the same U(S)ART is used for
Serial
andprintf()
some bytes could be lost due to IRQ disabling.@ppescher and @benwaffle could you review and test it on your side