From c8a93f31e99a183426a65eda3cf4ba754545786b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 9 Feb 2026 09:28:15 -0600 Subject: [PATCH] Add comment explaining early guard --- esphome/components/dfplayer/dfplayer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/esphome/components/dfplayer/dfplayer.cpp b/esphome/components/dfplayer/dfplayer.cpp index 6ef9be3865..91aa608d01 100644 --- a/esphome/components/dfplayer/dfplayer.cpp +++ b/esphome/components/dfplayer/dfplayer.cpp @@ -132,9 +132,8 @@ void DFPlayer::send_cmd_(uint8_t cmd, uint16_t argument) { } void DFPlayer::loop() { - // Read message - // All current UART available() implementations return >= 0, - // use <= 0 to future-proof against any that may return negative on error. + // 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) return;