From 583049f6209872436e38baaba0d4ba964380b2e5 Mon Sep 17 00:00:00 2001 From: TerryE Date: Mon, 23 Nov 2015 01:23:41 +0000 Subject: [PATCH] Merge Onewire changes from Master into Dev Master contained two OW changes one of which was already reimplemented in dev using the correct macros. The second was from hazarkarabay (f6d0c0c) that onewire_search() returns a device address vector even when no device is found. I've reimplemented this but using the correct index, rom_byte_number, rather than declaring a new temp index i. --- app/driver/onewire.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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