Add comment explaining available() <= 0 check

This commit is contained in:
J. Nick Koston
2026-02-09 04:31:16 -06:00
parent 2a17592d57
commit 9742880bf7

View File

@@ -133,6 +133,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.
int avail = this->available();
if (avail <= 0)
return;