mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-24 06:47:17 +00:00
Correction of tasmota/xsns_05_ds18x20.ino Ds18x20Name() search.
sizeof(ds18x20_chipids) calculates number of chipids, e.g. 4 chipids + 0 entry it will return 5. So the 1st checked chipid must start at ds18x20_chipids[4], not at ds18x20_chipids[5].
This commit is contained in:
parent
1ba8c0d16c
commit
65e1ceec83
@ -420,11 +420,10 @@ bool Ds18x20Read(uint8_t sensor) {
|
||||
|
||||
void Ds18x20Name(uint8_t sensor) {
|
||||
uint8_t index = sizeof(ds18x20_chipids);
|
||||
while (index) {
|
||||
while (--index) {
|
||||
if (ds18x20_sensor[ds18x20_sensor[sensor].index].address[0] == ds18x20_chipids[index]) {
|
||||
break;
|
||||
}
|
||||
index--;
|
||||
}
|
||||
GetTextIndexed(DS18X20Data.name, sizeof(DS18X20Data.name), index, kDs18x20Types);
|
||||
if (DS18X20Data.sensors > 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user