I have tried to migrate an rs485 driver to the UART driver, and I haven't found a timeout reading call. I know that it could be done using virtual timers, but it would complicate the code. For Usart models, its fairly straightforward to do.
Am I missing something, or it's just that it has not yet been implemented?
Thanks in advance,
Joaquin
UART reading timeout
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: UART reading timeout
Hi Joaquin,
I have to apologize, for some reason I totally missed this post and failed to answer, it was not my intention to ignore it. Today I accidentally discovered the "View unread posts" option of the board...
Anyway, the UART driver does not implement timeouts and it is meant to be that way, you guess is correct, the best approach is to start a virtual timer and stop the ongoing transfer from the timer callback.
Giovanni
I have to apologize, for some reason I totally missed this post and failed to answer, it was not my intention to ignore it. Today I accidentally discovered the "View unread posts" option of the board...
Anyway, the UART driver does not implement timeouts and it is meant to be that way, you guess is correct, the best approach is to start a virtual timer and stop the ongoing transfer from the timer callback.
Giovanni
Re: UART reading timeout
Giovanni, thanks a lot. I solved the problem modifying the USART model in Chibios to handle TX/RX pin and it was working properly, but now I'm trying to modify my code to adhere to your standard, so the migration to another version of ChibiOS would be more transparent.