Update tpuart_data_link_layer.cpp

- start confirm timout only after last byte was sent
- increase BYTE_TIMEOUT
This commit is contained in:
Bernator 2019-08-06 08:04:39 +02:00 committed by GitHub
parent f7e64b8c12
commit ba88e6b7b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,8 +80,8 @@
#define RX_WAIT_DATA_CON 3
#define TX_FRAME 4
#define BYTE_TIMEOUT 3 //milli seconds
#define CONFIRM_TIMEOUT 500 //milli seconds
#define BYTE_TIMEOUT 10 //milli seconds
#define CONFIRM_TIMEOUT 500 //milli seconds
#define RESET_TIMEOUT 100 //milli seconds
void TpUartDataLinkLayer::loop()
@ -107,8 +107,6 @@ void TpUartDataLinkLayer::loop()
if (!_waitConfirm && !isTxQueueEmpty())
{
loadNextTxFrame();
_waitConfirm = true;
_waitConfirmStartTime = _platform.millis();
_loopState = TX_FRAME;
}
}
@ -116,6 +114,8 @@ void TpUartDataLinkLayer::loop()
case TX_FRAME:
if (sendSingleFrameByte() == false)
{
_waitConfirm = true;
_waitConfirmStartTime = _platform.millis();
_loopState = IDLE;
}
break;