From 05b889457e541c28cc2849d8324d45a52faf814a Mon Sep 17 00:00:00 2001 From: Marco Krahl Date: Thu, 15 Apr 2021 07:23:08 +0200 Subject: [PATCH] 1wire: Removes duplicate device information Removes the family identifier from the device configuration, since the device family is already part of the rom code and the underlying logic does know how to extract this information. include/nuttx/1wire drivers/sensors stm32f103-minimim Signed-off-by: Marco Krahl --- drivers/sensors/ds18b20.c | 3 +-- include/nuttx/1wire/1wire_master.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/sensors/ds18b20.c b/drivers/sensors/ds18b20.c index fdb521d767..8716a17eae 100644 --- a/drivers/sensors/ds18b20.c +++ b/drivers/sensors/ds18b20.c @@ -286,7 +286,7 @@ static int ds18b20_isalarm(FAR struct onewire_master_s *master, alarm.romcode = config->romcode; alarm.isalarm = false; - ret = onewire_search(master, config->family, true, ds18b20_alarm_cb, + ret = onewire_search(master, DS18B20_DEVICE_FAMILY, true, ds18b20_alarm_cb, &alarm); if (ret > 0) { @@ -935,7 +935,6 @@ int ds18b20_register(int devno, FAR struct onewire_master_s *onewire, priv->master = onewire; priv->config.romcode = romcode; - priv->config.family = DS18B20_DEVICE_FAMILY; priv->reg.res = DS18B20_RES_CONV(DS18B20_RESMAX); priv->reg.alarm.thigh = DS18B20_TALARM_MAX; priv->reg.alarm.tlow = DS18B20_TALARM_MIN; diff --git a/include/nuttx/1wire/1wire_master.h b/include/nuttx/1wire/1wire_master.h index 77187e2f93..c4fd342748 100644 --- a/include/nuttx/1wire/1wire_master.h +++ b/include/nuttx/1wire/1wire_master.h @@ -39,7 +39,6 @@ struct onewire_master_s; struct onewire_config_s { - uint8_t family; /* Device family identifier */ uint64_t romcode; /* Unique device identifier */ };