Correction of Ds18x20Name() search

Correction of Ds18x20Name() search (#11958)
This commit is contained in:
Theo Arends 2021-04-30 11:59:08 +02:00
parent 1966dbbe41
commit b1371b63cc

View File

@ -156,11 +156,10 @@ bool Ds18x20Read(uint8_t sensor, float &t) {
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) {