Add comment explaining early guard

This commit is contained in:
J. Nick Koston
2026-02-09 09:31:19 -06:00
parent c77d70c093
commit e9a0d06880
+2
View File
@@ -31,6 +31,8 @@ void Tuya::setup() {
}
void Tuya::loop() {
// Early return avoids stack adjustment for the batch buffer below.
// loop() runs ~7000/min so most calls have nothing to read.
int avail = this->available();
if (avail > 0) {
// Read all available bytes in batches to reduce UART call overhead.