1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-15 17:52:45 +01:00
RIOT/pkg/openwsn/patches/0008-drivers-common-openserial-add-flag-to-echo-badcrc-fr.patch
2020-09-10 08:58:31 +02:00

32 lines
932 B
Diff

From a66e2713eb76a1c8b555760f73ce7418312b58d6 Mon Sep 17 00:00:00 2001
From: Francisco Molina <femolina@uc.cl>
Date: Thu, 4 Jun 2020 15:39:07 +0200
Subject: [PATCH 8/9] 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 f0dcb19e..2fc2c858 100644
--- a/drivers/common/openserial.c
+++ b/drivers/common/openserial.c
@@ -733,9 +733,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.28.0