From bbb3239d861044de36ad221bf37d592a887b0ab8 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Wed, 24 Jan 2018 14:17:53 +0000 Subject: [PATCH] Used the constant for RF_MESSAGE_SIZE. --- code/espurna/rfbridge.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/espurna/rfbridge.ino b/code/espurna/rfbridge.ino index 596d51f2..c102630a 100644 --- a/code/espurna/rfbridge.ino +++ b/code/espurna/rfbridge.ino @@ -311,10 +311,10 @@ void _rfbReceive() { //DEBUG_MSG_P(PSTR("[RFBRIDGE] Received 0x%02X\n"), c); if (receiving) { - if (c == RF_CODE_STOP && (_uartpos == 1 || _uartpos == 10)) { + if (c == RF_CODE_STOP && (_uartpos == 1 || _uartpos == RF_MESSAGE_SIZE + 1)) { _rfbDecode(); receiving = false; - } else if (_uartpos < 10) { + } else if (_uartpos <= RF_MESSAGE_SIZE) { _uartbuf[_uartpos++] = c; } else { // wrong message, should have received a RF_CODE_STOP