From 04eae39ebd20de1fef5982f66f57cc8fb0fc44d4 Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Thu, 4 Jun 2020 15:39:07 +0200 Subject: [PATCH 09/11] drivers/common/openserial: add flag to echo badcrc frames --- drivers/common/openserial.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/common/openserial.c b/drivers/common/openserial.c index 5c3c0003..c6cdddf0 100644 --- a/drivers/common/openserial.c +++ b/drivers/common/openserial.c @@ -981,9 +981,13 @@ port_INLINE void inputHdlcClose(void) { openserial_vars.inputBufFillLevel -= 2; } else { // the CRC is incorrect - +#ifdef OPENSERIAL_ECHO_BADCRC + // Force echo on invalid crc + openserial_vars.inputBuf[0] = SERFRAME_PC2MOTE_TRIGGERSERIALECHO; +#else // drop the incoming frame openserial_vars.inputBufFillLevel = 0; +#endif } } -- 2.27.0