From b74805251e367797716936224f123b6a99cec4e8 Mon Sep 17 00:00:00 2001 From: Olivier Date: Sun, 21 May 2017 21:39:44 +0200 Subject: [PATCH] Fix RFM69 driver (#855) --- drivers/RFM69/new/RFM69_new.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/RFM69/new/RFM69_new.cpp b/drivers/RFM69/new/RFM69_new.cpp index 1a8eeac..be30cc5 100644 --- a/drivers/RFM69/new/RFM69_new.cpp +++ b/drivers/RFM69/new/RFM69_new.cpp @@ -1,4 +1,4 @@ -/* +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each @@ -316,7 +316,7 @@ LOCAL void RFM69_interruptHandler(void) if (RFM69.currentPacket.header.version >= RFM69_MIN_PACKET_HEADER_VERSION) { // read payload readingLength = RFM69.currentPacket.header.packetLen - (RFM69_HEADER_LEN - 1); - if (readingLength < RFM69_MAX_PACKET_LEN) { + if (readingLength > RFM69_MAX_PACKET_LEN) { readingLength = RFM69_MAX_PACKET_LEN; } RFM69.currentPacket.payloadLen = readingLength;