Hi,
I'm working with the serial driver on a STM32F103.
I want to use sdGetTimeout(&SD1, OSAL_MS2I(200)) but the timeout didn't work/has no effect.
osalThreadSleep-functions work as expected.
Serial Driver Timeout has no effect
Re: Serial Driver Timeout has no effect
Sorry. Add a debug. For some reason the sdGet gets random data. Pretty strange, because I can't see anything on my serial sniffer.
Probably I'm missing something different.
Probably I'm missing something different.
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Serial Driver Timeout has no effect
To test the timeout call the function with no data in input, it must exit after the specified timeout.
Giovanni
Giovanni
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Serial Driver Timeout has no effect
Correct or it would immediately return buffered data.
Giovanni
Giovanni
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Serial Driver Timeout has no effect
Probably it is a good idea to add a flush in the queue directly?
Something like:
Something like:
Code: Select all
#define iqFlushI(iqp) \
do { \
(iqp)->q_wrptr = (iqp)->q_rdptr; \
(iqp)->q_counter = 0; \
} while(0)- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times