Add comment explaining early guard

This commit is contained in:
J. Nick Koston
2026-02-09 09:30:43 -06:00
parent f19bb2cd0a
commit 44e9346e9c
+2
View File
@@ -19,6 +19,8 @@ void Modbus::setup() {
void Modbus::loop() {
const uint32_t now = App.get_loop_component_start_time();
// 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.