From e3ff81ea9913f6bafe67459e9c2725b5b9f3671b Mon Sep 17 00:00:00 2001 From: Nanosonde <2073569+nanosonde@users.noreply.github.com> Date: Wed, 15 Jul 2020 16:30:16 +0200 Subject: [PATCH] Remove forgotten code. --- src/knx/rf_physical_layer.cpp | 21 --------------------- src/knx/rf_physical_layer.h | 1 - 2 files changed, 22 deletions(-) diff --git a/src/knx/rf_physical_layer.cpp b/src/knx/rf_physical_layer.cpp index f01e301..2881685 100644 --- a/src/knx/rf_physical_layer.cpp +++ b/src/knx/rf_physical_layer.cpp @@ -174,27 +174,6 @@ bool RfPhysicalLayer::manchDecode(uint8_t *encodedData, uint8_t *decodedData) return true; } -int RfPhysicalLayer::crc16(uint8_t* buffer, int offset, int length) -{ - // CRC-16-DNP - // generator polynomial = 2^16 + 2^13 + 2^12 + 2^11 + 2^10 + 2^8 + 2^6 + 2^5 + 2^2 + 2^0 - int pn = 0x13d65; // 1 0011 1101 0110 0101 - - // for much data, using a lookup table would be a way faster CRC calculation - int crc = 0; - for (int i = offset; i < offset + length; i++) { - int bite = buffer[i] & 0xff; - for (int b = 8; b --> 0;) { - bool bit = ((bite >> b) & 1) == 1; - bool one = (crc >> 15 & 1) == 1; - crc <<= 1; - if (one ^ bit) - crc ^= pn; - } - } - return (~crc) & 0xffff; -} - uint8_t RfPhysicalLayer::sIdle() { uint8_t marcState; diff --git a/src/knx/rf_physical_layer.h b/src/knx/rf_physical_layer.h index 01a3c44..ceb3196 100644 --- a/src/knx/rf_physical_layer.h +++ b/src/knx/rf_physical_layer.h @@ -206,7 +206,6 @@ class RfPhysicalLayer void manchEncode(uint8_t *uncodedData, uint8_t *encodedData); bool manchDecode(uint8_t *encodedData, uint8_t *decodedData); - int crc16(uint8_t* buffer, int offset, int length); void powerDownCC1101(); void setOutputPowerLevel(int8_t dBm);