Address review comments

Remove crc
This commit is contained in:
Jaeyoung-Lim
2021-06-21 10:34:22 +02:00
parent 4f87cb0b76
commit 66ad2fd586
3 changed files with 0 additions and 29 deletions
-1
View File
@@ -34,7 +34,6 @@ px4_add_module(
MODULE drivers__si7210
MAIN si7210
COMPILE_FLAGS
# -DDEBUG_BUILD
SRCS
si7210_main.cpp
si7210.cpp
-23
View File
@@ -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);
}
-5
View File
@@ -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
*/