mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
ds18b20: add additional check for no devices found
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
parent
092f84437f
commit
1483ab6a88
@ -144,7 +144,7 @@ ds18b20_context ds18b20_init(unsigned int uart)
|
||||
rv = mraa_uart_ow_rom_search(dev->ow, 0, id);
|
||||
}
|
||||
|
||||
if (!dev->numDevices)
|
||||
if (!dev->numDevices || !dev->devices)
|
||||
{
|
||||
printf("%s: no DS18B20 devices found on bus\n", __FUNCTION__);
|
||||
ds18b20_close(dev);
|
||||
|
Loading…
x
Reference in New Issue
Block a user