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;