From c43262e10aa3c3603617c375696a4a6959c0c2b0 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Fri, 21 Jun 2024 23:33:50 +0200 Subject: [PATCH] Some extra checks --- src/main/rx/crsf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/rx/crsf.c b/src/main/rx/crsf.c index 095e1b89a06..58a3b4783ff 100755 --- a/src/main/rx/crsf.c +++ b/src/main/rx/crsf.c @@ -278,7 +278,7 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig) return RX_FRAME_PENDING; } - int channelCount = 16; + int channelCount = 0; switch(rcChannelsHeader->resolution) { case CRSF_11_BIT: @@ -306,7 +306,7 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig) return RX_FRAME_PENDING; } - if(crsfFrame.frame.frameLength != payloadSize + CRSF_FRAME_LENGTH_TYPE_CRC) { // TYPE_CRC or _CRC? + if(crsfFrame.frame.frameLength != payloadSize + CRSF_FRAME_LENGTH_TYPE_CRC || channelCount == 0) { // TYPE_CRC or _CRC? return RX_FRAME_PENDING; }