mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Merge pull request #249 from OpenKNX/fix-tpuart-error
fix #247 - TPUART Error Message
This commit is contained in:
commit
494c76c7d8
@ -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