CHG: reverted back from a time-outed usb receive function
This commit is contained in:
@@ -128,7 +128,6 @@ serial_port uart_open(const char* pcPortName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void uart_close(const serial_port sp) {
|
void uart_close(const serial_port sp) {
|
||||||
if (!sp) return;
|
|
||||||
if (sp == INVALID_SERIAL_PORT) return;
|
if (sp == INVALID_SERIAL_PORT) return;
|
||||||
if (sp == CLAIMED_SERIAL_PORT) return;
|
if (sp == CLAIMED_SERIAL_PORT) return;
|
||||||
|
|
||||||
@@ -162,7 +161,7 @@ bool uart_receive(const serial_port sp, byte_t* pbtRx, size_t pszMaxRxLen, size_
|
|||||||
int byteCount;
|
int byteCount;
|
||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
uint64_t timeout_at = msclock() + RECV_TOTAL_TIMEOUT_MS;
|
//uint64_t timeout_at = msclock() + RECV_TOTAL_TIMEOUT_MS;
|
||||||
|
|
||||||
// Reset the output count
|
// Reset the output count
|
||||||
*pszRxLen = 0;
|
*pszRxLen = 0;
|
||||||
@@ -212,8 +211,8 @@ bool uart_receive(const serial_port sp, byte_t* pbtRx, size_t pszMaxRxLen, size_
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// } while (byteCount);
|
} while (byteCount);
|
||||||
} while (msclock() < timeout_at);
|
// } while (msclock() < timeout_at);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user