From 8b69dd7d90c13ffb05f967b4ec5f2ff3fb4d38c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Tue, 30 May 2017 17:20:06 +0200 Subject: [PATCH] Move crc16.[ch] to shared --- {right/src/buspal => shared}/crc16.c | 10 ---------- {right/src/buspal => shared}/crc16.h | 2 ++ 2 files changed, 2 insertions(+), 10 deletions(-) rename {right/src/buspal => shared}/crc16.c (79%) rename {right/src/buspal => shared}/crc16.h (98%) diff --git a/right/src/buspal/crc16.c b/shared/crc16.c similarity index 79% rename from right/src/buspal/crc16.c rename to shared/crc16.c index 4ac6e0d..02dfc25 100644 --- a/right/src/buspal/crc16.c +++ b/shared/crc16.c @@ -1,19 +1,12 @@ -#include "bootloader_common.h" #include "crc16.h" void crc16_init(crc16_data_t *crc16Config) { - assert(crc16Config); - - // initialize running crc and byte count crc16Config->currentCrc = 0; } void crc16_update(crc16_data_t *crc16Config, const uint8_t *src, uint32_t lengthInBytes) { - assert(crc16Config); - assert(src); - uint32_t crc = crc16Config->currentCrc; uint32_t j; @@ -38,8 +31,5 @@ void crc16_update(crc16_data_t *crc16Config, const uint8_t *src, uint32_t length void crc16_finalize(crc16_data_t *crc16Config, uint16_t *hash) { - assert(crc16Config); - assert(hash); - *hash = crc16Config->currentCrc; } diff --git a/right/src/buspal/crc16.h b/shared/crc16.h similarity index 98% rename from right/src/buspal/crc16.h rename to shared/crc16.h index fb7372d..e12fe3c 100644 --- a/right/src/buspal/crc16.h +++ b/shared/crc16.h @@ -1,6 +1,8 @@ #ifndef __CRC16_H__ #define __CRC16_H__ +#include + typedef struct Crc16Data { uint16_t currentCrc; } crc16_data_t;