Merge pull request #249 from OpenKNX/fix-tpuart-error

fix #247 - TPUART Error Message
This commit is contained in:
thelsing 2023-06-16 11:18:10 +02:00 committed by GitHub
commit 494c76c7d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -560,7 +560,27 @@ void TpUartDataLinkLayer::enabled(bool value)
{
_platform.setupUart();
if (resetChip())
uint8_t cmd = U_RESET_REQ;
_platform.writeUart(cmd);
_waitConfirmStartTime = millis();
bool flag = false;
while (true)
{
int resp = _platform.readUart();
if (resp == U_RESET_IND)
{
flag = true;
break;
}
else if (millis() - _waitConfirmStartTime > RESET_TIMEOUT)
{
flag = false;
break;
}
}
if (flag)
{
_enabled = true;
print("ownaddr ");