1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/openwsn/patches/0009-drivers-common-openserial-add-flag-to-echo-badcrc-fr.patch
Francisco Molina 844ccfbeb3
pkg/OpenWSN: initial import
Co-authored-by: Peter Kietzmann <peter.kietzmann@haw-hamburg.de>
Co-authored-by: Jose Alamos <jose.alamos@haw-hamburg.de>
Co-authored-by: Michel Rottleuthner <michel.rottleuthner@haw-hamburg.de>
2020-06-30 13:08:36 +02:00

33 lines
942 B
Diff

From 04eae39ebd20de1fef5982f66f57cc8fb0fc44d4 Mon Sep 17 00:00:00 2001
From: Francisco Molina <femolina@uc.cl>
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