reduce false positive chirp sensor detection (#22736)

This commit is contained in:
Ryan Castellucci 2024-12-30 09:21:11 +00:00 committed by GitHub
parent dc531de02b
commit 5f95b33220
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -240,6 +240,8 @@ bool ChirpScan()
delay(2);
chirp_sensor[chirp_found_sensors].version = ChirpReadVersion(address);
if (chirp_sensor[chirp_found_sensors].version > 0) {
// try to confirm by reading the address
if (address != I2cRead8(address, CHIRP_GET_ADDRESS)) { continue; }
I2cSetActiveFound(address, "CHIRP");
if (chirp_found_sensors<CHIRP_MAX_SENSOR_COUNT) {
chirp_sensor[chirp_found_sensors].address = address; // push next sensor, as long as there is space in the array