data psk demod minor fixes, pyramid demod add CS

also adjusted autocorrelate and added a printout for lf search u
This commit is contained in:
marshmellow42 2015-03-13 11:09:12 -04:00
commit 73d04bb417
6 changed files with 104 additions and 50 deletions

View file

@ -5,8 +5,9 @@
//-----------------------------------------------------------------------------
// Generic CRC calculation code.
//-----------------------------------------------------------------------------
#include "crc.h"
#include <stdint.h>
#include <stddef.h>
void crc_init(crc_t *crc, int order, uint32_t polynom, uint32_t initial_value, uint32_t final_xor)
{
@ -40,3 +41,15 @@ uint32_t crc_finish(crc_t *crc)
{
return ( crc->state ^ crc->final_xor ) & crc->mask;
}
uint32_t CRC8Maxim(uint8_t *buff, size_t size )
{
crc_t crc;
crc_init(&crc, 9, 0x8c, 0x00, 0x00);
crc_clear(&crc);
for (size_t i=0; i < size; ++i){
crc_update(&crc, buff[i], 8);
}
return crc_finish(&crc);
}