From 3cd43710e676e6fd00b8755fc235fa47385995d4 Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Mon, 12 Nov 2018 11:16:42 +0100 Subject: [PATCH] spi_slave: re-enable checksum for payload Signed-off-by: Christian Ambach --- src/spislave.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spislave.cpp b/src/spislave.cpp index bbcb677d..53ac8479 100644 --- a/src/spislave.cpp +++ b/src/spislave.cpp @@ -66,9 +66,9 @@ void spi_slave_task(void *param) { uint8_t *messageSize = txbuf + 3; *messageSize = msg.MessageSize; memcpy(txbuf + HEADER_SIZE, &msg.Message, msg.MessageSize); - // calculate crc16 checksum, not used yet - // uint16_t *crc = (uint16_t *)txbuf; - //*crc = crc16_be(0, messageType, msg.MessageSize + HEADER_SIZE - 2); + // calculate crc16 checksum + uint16_t *crc = (uint16_t *)txbuf; + *crc = crc16_be(0, messageType, msg.MessageSize + HEADER_SIZE - 2); // set length for spi slave driver transaction_size = HEADER_SIZE + msg.MessageSize;