lpcmanager

Parents ce82f040a277
Children b88edaa644e4
Smarteh RS485 bus: Rx timeout changed from 50 ms to 20 ms (slaves answer in approx. 10 ms). Timeout is žset outside while loop because select() decreases timeout gradually.
--- a/LPCBus/MC9_Devices_decl.c Tue Dec 13 10:29:07 2016 +0100
+++ b/LPCBus/MC9_Devices_decl.c Fri Jan 13 15:22:25 2017 +0100
@@ -460,14 +460,13 @@
/* Turn to listen mode*/
RecieveMode();
- while(count < uartBufSize){
+ FD_ZERO(&set); /* clear the set */
+ FD_SET(UART_fd, &set); /* add our file descriptor to the set */
- FD_ZERO(&set); /* clear the set */
- FD_SET(UART_fd, &set); /* add our file descriptor to the set */
-
- timeout.tv_sec = 0;
- timeout.tv_usec = 50000;
-
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 20000;
+
+ while(count < uartBufSize){
rv = select(UART_fd + 1, &set, NULL, NULL, &timeout);
if(rv == -1)
printf("RS485 select error\n");