0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-27 12:53:53 +01:00

maybe my receiver is bugged? (rds spy)

This commit is contained in:
2025-12-28 23:30:37 +01:00
parent 9c348e25d6
commit 1ed47ea077
2 changed files with 9 additions and 8 deletions

View File

@@ -26,15 +26,17 @@ inline int _strncpy(char *dest, const char *src, int n) {
return i;
}
uint16_t crc16_ccitt(const char* data, uint16_t len) {
uint16_t i, crc=0xFFFF;
for (i=0; i < len; i++ ) {
crc = (unsigned char)(crc >> 8) | (crc << 8);
uint16_t crc = 0xffff;
for (size_t i = 0; i < len; i++) {
crc = (crc >> 8) | (crc << 8);
crc ^= data[i];
crc ^= (unsigned char)(crc & 0xff) >> 4;
crc ^= (crc & 0xff) >> 4;
crc ^= (crc << 8) << 4;
crc ^= ((crc & 0xff) << 4) << 1;
}
return ((crc ^= 0xFFFF) & 0xFFFF);
return crc ^ 0xffff;
}
inline uint16_t get_block_from_group(RDSGroup *group, uint8_t block) {