mirror of
https://github.com/thelsing/knx.git
synced 2025-04-05 01:15:46 +02:00
fix-tpuart-error
This commit is contained in:
parent
245b82e627
commit
c5fc04c487
@ -560,7 +560,27 @@ void TpUartDataLinkLayer::enabled(bool value)
|
|||||||
{
|
{
|
||||||
_platform.setupUart();
|
_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;
|
_enabled = true;
|
||||||
print("ownaddr ");
|
print("ownaddr ");
|
||||||
|
Loading…
Reference in New Issue
Block a user