Browse Source

Merge pull request #461 from pelson/magic_number

Used the constant for RF_MESSAGE_SIZE.
i18n
Xose Pérez 6 years ago
committed by GitHub
parent
commit
97f0a4d61f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      code/espurna/rfbridge.ino

+ 2
- 2
code/espurna/rfbridge.ino View File

@ -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


Loading…
Cancel
Save