Skip to content

Commit 66ad2fd

Browse files
committed
Address review comments
Remove crc
1 parent 4f87cb0 commit 66ad2fd

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

src/drivers/si7210/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ px4_add_module(
3434
MODULE drivers__si7210
3535
MAIN si7210
3636
COMPILE_FLAGS
37-
# -DDEBUG_BUILD
3837
SRCS
3938
si7210_main.cpp
4039
si7210.cpp

src/drivers/si7210/si7210.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ int SI7210::collect()
207207
perf_begin(_sample_perf);
208208

209209
_collect_phase = false;
210-
// bool si7210_notify = true;
211210

212211
uint8_t reg;
213212

@@ -325,25 +324,3 @@ SI7210::RunImpl()
325324
break;
326325
}
327326
}
328-
329-
bool SI7210::crc(const uint8_t data[], unsigned size, uint8_t checksum)
330-
{
331-
uint8_t crc_value = 0xff;
332-
333-
// calculate 8-bit checksum with polynomial 0x31 (x^8 + x^5 + x^4 + 1)
334-
for (unsigned i = 0; i < size; i++) {
335-
crc_value ^= (data[i]);
336-
337-
for (int bit = 8; bit > 0; --bit) {
338-
if (crc_value & 0x80) {
339-
crc_value = (crc_value << 1) ^ 0x31;
340-
341-
} else {
342-
crc_value = (crc_value << 1);
343-
}
344-
}
345-
}
346-
347-
// verify checksum
348-
return (crc_value == checksum);
349-
}

src/drivers/si7210/si7210.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,6 @@ class SI7210 : public Vane, public I2CSPIDriver<SI7210>
173173
*/
174174
int get_sensor_data(uint8_t otpAddr, int8_t *data);
175175

176-
/**
177-
* Calculate the CRC8 for the sensor payload data
178-
*/
179-
bool crc(const uint8_t data[], unsigned size, uint8_t checksum);
180-
181176
/**
182177
* Write a command in Sensirion specific logic
183178
*/

0 commit comments

Comments
 (0)