Hi,
is it possible to use finite timeouts with chprintf()? I use this function to emit data to a serial line, which may asynchronously disconnect in the middle of the call, in which case my task hangs forever
Regards,
Vladimir
chprintf and finite timeout Topic is solved
-
- Posts: 35
- Joined: Fri Feb 09, 2018 12:44 am
- Has thanked: 2 times
- Been thanked: 5 times
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: chprintf and finite timeout
Hi,
It is not currently possible, it would require changes because chprintf() prints on a stream (BaseSequentialStream) and streams don't have timeouts.
You could consider the normal printf() and provide your output function with timeout, this is compiler-dependent however. I will look into changes for chprintf() but this could take a while.
Moving this topic under "change requests".
BTW, you could reset the serial driver output queue, it would be released.
Giovanni
It is not currently possible, it would require changes because chprintf() prints on a stream (BaseSequentialStream) and streams don't have timeouts.
You could consider the normal printf() and provide your output function with timeout, this is compiler-dependent however. I will look into changes for chprintf() but this could take a while.
Moving this topic under "change requests".
BTW, you could reset the serial driver output queue, it would be released.
Giovanni
-
- Posts: 35
- Joined: Fri Feb 09, 2018 12:44 am
- Has thanked: 2 times
- Been thanked: 5 times
Re: chprintf and finite timeout
Thank you, Giovanni.
Can I reset both the queues from an ordinary task, not from an interrupt?
Can I reset both the queues from an ordinary task, not from an interrupt?
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Return to “Small Change Requests”
Who is online
Users browsing this forum: No registered users and 31 guests