diff --git a/src/drivers/si7210/CMakeLists.txt b/src/drivers/si7210/CMakeLists.txt index 578508b628..f4b744d51d 100644 --- a/src/drivers/si7210/CMakeLists.txt +++ b/src/drivers/si7210/CMakeLists.txt @@ -34,7 +34,6 @@ px4_add_module( MODULE drivers__si7210 MAIN si7210 COMPILE_FLAGS - # -DDEBUG_BUILD SRCS si7210_main.cpp si7210.cpp diff --git a/src/drivers/si7210/si7210.cpp b/src/drivers/si7210/si7210.cpp index 1ce7979ee7..15f7284901 100644 --- a/src/drivers/si7210/si7210.cpp +++ b/src/drivers/si7210/si7210.cpp @@ -207,7 +207,6 @@ int SI7210::collect() perf_begin(_sample_perf); _collect_phase = false; - // bool si7210_notify = true; uint8_t reg; @@ -325,25 +324,3 @@ SI7210::RunImpl() break; } } - -bool SI7210::crc(const uint8_t data[], unsigned size, uint8_t checksum) -{ - uint8_t crc_value = 0xff; - - // calculate 8-bit checksum with polynomial 0x31 (x^8 + x^5 + x^4 + 1) - for (unsigned i = 0; i < size; i++) { - crc_value ^= (data[i]); - - for (int bit = 8; bit > 0; --bit) { - if (crc_value & 0x80) { - crc_value = (crc_value << 1) ^ 0x31; - - } else { - crc_value = (crc_value << 1); - } - } - } - - // verify checksum - return (crc_value == checksum); -} diff --git a/src/drivers/si7210/si7210.h b/src/drivers/si7210/si7210.h index 5eee584abc..d3d81bb73d 100644 --- a/src/drivers/si7210/si7210.h +++ b/src/drivers/si7210/si7210.h @@ -173,11 +173,6 @@ private: */ int get_sensor_data(uint8_t otpAddr, int8_t *data); - /** - * Calculate the CRC8 for the sensor payload data - */ - bool crc(const uint8_t data[], unsigned size, uint8_t checksum); - /** * Write a command in Sensirion specific logic */