Update RF24.cpp (#1569)

Fix #1568
This commit is contained in:
Olivier
2025-05-05 11:07:26 +01:00
committed by GitHub
parent e298769eb7
commit 3020658f9a

View File

@@ -348,7 +348,7 @@ LOCAL uint8_t RF24_getDynamicPayloadSize(void)
{
uint8_t result = RF24_spiMultiByteTransfer(RF24_CMD_READ_RX_PL_WID, NULL, 1, true);
// check if payload size invalid
if(result > 32) {
if(result > 32 || !result) {
RF24_DEBUG(PSTR("!RF24:GDP:PYL INV\n")); // payload len invalid
RF24_flushRX();
result = 0;