UART reading timeout

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
joaquin
Posts: 50
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

UART reading timeout

Post by joaquin »

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
User avatar
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

Post by Giovanni »

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
joaquin
Posts: 50
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

Re: UART reading timeout

Post by joaquin »

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.
Post Reply