From 8dd3f83989924c9ab9e6ac4c2dc38a5f21dd5b20 Mon Sep 17 00:00:00 2001 From: Stefan Staub Date: Sun, 26 Dec 2021 09:53:55 +0100 Subject: [PATCH] avoid blocking --- library.properties | 2 +- src/NextionX2.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library.properties b/library.properties index f95d6be..935416a 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=NextionX2 -version=1.0.0 +version=1.1.0 author=Stefan Staub maintainer=Stefan Staub sentence=A universal alternative and more flexible Nextion library diff --git a/src/NextionX2.h b/src/NextionX2.h index a12ad63..a07ab8c 100644 --- a/src/NextionX2.h +++ b/src/NextionX2.h @@ -492,7 +492,7 @@ NextionComPort::NextionComPort() {} template void NextionComPort::begin(nextionSeriaType &nextionSerial, uint16_t baud) { nextionSerial.begin(baud); - while (!nextionSerial); + delay(100); this->nextionSerial = &nextionSerial; command(""); command("bkcmd=0"); @@ -501,7 +501,7 @@ void NextionComPort::begin(nextionSeriaType &nextionSerial, uint16_t baud) { template void NextionComPort::debug(debugSerialType &debugSerial, uint16_t baud) { debugSerial.begin(baud); - while (!debugSerial); + delay(100); this->debugSerial = &debugSerial; command("bkcmd=3"); }