serial_unix: Split timeout in seconds and microseconds
Macos exposed errors when tv_usec was > 1000000.
This commit is contained in:
parent
43770736f1
commit
3aa6f16964
@ -190,7 +190,8 @@ int platform_buffer_read(uint8_t *data, int maxsize)
|
|||||||
c = data;
|
c = data;
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
|
|
||||||
tv.tv_usec = 1000 * cortexm_wait_timeout;
|
tv.tv_sec = cortexm_wait_timeout / 1000 ;
|
||||||
|
tv.tv_usec = 1000 * (cortexm_wait_timeout % 1000);
|
||||||
|
|
||||||
/* Look for start of response */
|
/* Look for start of response */
|
||||||
do {
|
do {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user