One-Wire Component - GetDeviceCount
Posted: Mon Sep 26, 2022 2:22 pm
Hi everyone.
Just reporting an observation with GetDeviceCount in the generic One-Wire component.
I'm working on a project that can have anything from zero to many 1-wire devices hanging on the bus, so I originally used GetDeviceCount after a ScanBus to establish number of connected devices. The reported minimum however is '1' with zero targets connected.
My workaround uses BusReset to first detect presence on the bus and, if '1', to force the count variable to zero and ignore ScanBus/GetDeviceCount, though thought I'd flag this up.
Cheers,
Brendan
Just reporting an observation with GetDeviceCount in the generic One-Wire component.
I'm working on a project that can have anything from zero to many 1-wire devices hanging on the bus, so I originally used GetDeviceCount after a ScanBus to establish number of connected devices. The reported minimum however is '1' with zero targets connected.
My workaround uses BusReset to first detect presence on the bus and, if '1', to force the count variable to zero and ignore ScanBus/GetDeviceCount, though thought I'd flag this up.
Cheers,
Brendan