diff --git a/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c b/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c index a01dd88cdf..6df9df438b 100644 --- a/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c +++ b/targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c @@ -1012,7 +1012,7 @@ bool oneWireFindNext (bool doReset, bool alarmOnly) } while (romByteIndex < 8); // loop until we have all ROM bytes - if (romBitIndex < (65 || lastcrc8)) + if ((romBitIndex < 65) || (lastcrc8 != 0)) { // search was unsuccessful reset the last discrepancy LastDiscrepancy = 0; diff --git a/targets/FreeRTOS_ESP32/ESP32_WROOM_32/nanoCLR/nanoFramework.Devices.OneWire/nf_devices_onewire_native_nanoFramework_Devices_OneWire_OneWireController.cpp b/targets/FreeRTOS_ESP32/ESP32_WROOM_32/nanoCLR/nanoFramework.Devices.OneWire/nf_devices_onewire_native_nanoFramework_Devices_OneWire_OneWireController.cpp index 4918457bf4..eb8929e09f 100644 --- a/targets/FreeRTOS_ESP32/ESP32_WROOM_32/nanoCLR/nanoFramework.Devices.OneWire/nf_devices_onewire_native_nanoFramework_Devices_OneWire_OneWireController.cpp +++ b/targets/FreeRTOS_ESP32/ESP32_WROOM_32/nanoCLR/nanoFramework.Devices.OneWire/nf_devices_onewire_native_nanoFramework_Devices_OneWire_OneWireController.cpp @@ -366,7 +366,7 @@ bool oneWireFindNext (bool doReset, bool alarmOnly) } while (romByteIndex < 8); // loop until we have all ROM bytes - if (romBitIndex < (65 || lastcrc8)) + if ((romBitIndex < 65) || (lastcrc8 != 0)) { // search was unsuccessful reset the last discrepancy LastDiscrepancy = 0;