-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I have a board with multiple different one wire parts on the same bus. The driver here doesn't properly identify the DS2408. It just counts how many DS2408s are detected and then assumes that the first two found are the first two one wire devices that respond.
The for loop only gets looped through as many times as there are DS2408s detected, but if the DS2408 is the fourth one wire device to respond, it incorrectly saves the address for the first device.
From DS2408.cpp
uint8_t DS2408::find(Devices* devices) {
uint8_t count = 0;
Device device;
while(this->search(device)) {
if(device[0] == DS2408_FAMILY) {
Serial.println("Count!!");
count++;
}
}
this->reset_search();
delay(250);
*devices = (Devices) malloc(count*sizeof(Device));
for (int index = 0; index < count; index++)
this->search((*devices)[index]);
return count;
}
Metadata
Metadata
Assignees
Labels
No labels