mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
fix-tpuart-error
This commit is contained in:
parent
245b82e627
commit
c5fc04c487
@ -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 ");
|
||||
|
Loading…
Reference in New Issue
Block a user