diff --git a/app/driver/onewire.c b/app/driver/onewire.c index 1172be07..7133bf43 100644 --- a/app/driver/onewire.c +++ b/app/driver/onewire.c @@ -407,10 +407,15 @@ uint8_t onewire_search(uint8_t pin, uint8_t *newAddr) LastFamilyDiscrepancy[pin] = 0; search_result = FALSE; } - int i; - for (i = 0; i < 8; i++) newAddr[i] = ROM_NO[pin][i]; + else + { + for (rom_byte_number = 0; rom_byte_number < 8; rom_byte_number++) + { + newAddr[rom_byte_number] = ROM_NO[pin][rom_byte_number]; + } + } return search_result; - } +} #endif