Skip to content

Commit

Permalink
drivers: sensor: fetch all channels on WSEN_ITDS sensor
Browse files Browse the repository at this point in the history
fetch all channels on WSEN_ITDS sensor

Signed-off-by: Matthias Hauser <[email protected]>
  • Loading branch information
mah-eiSmart committed Jun 28, 2023
1 parent bbec614 commit 90e858f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions drivers/sensor/wsen_itds/itds.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static int itds_attr_set(const struct device *dev, enum sensor_channel chan,
}
}

static int itds_fetch_temprature(struct itds_device_data *ddata,
static int itds_fetch_temperature(struct itds_device_data *ddata,
const struct itds_device_config *cfg)
{
uint8_t rval;
Expand All @@ -169,7 +169,7 @@ static int itds_fetch_temprature(struct itds_device_data *ddata,
return ret;
}

ddata->temprature = sys_le16_to_cpu(temp_raw);
ddata->temperature = sys_le16_to_cpu(temp_raw);

return 0;
}
Expand Down Expand Up @@ -228,7 +228,11 @@ static int itds_sample_fetch(const struct device *dev,
return itds_fetch_accel(ddata, cfg);

case SENSOR_CHAN_DIE_TEMP:
return itds_fetch_temprature(ddata, cfg);
return itds_fetch_temperature(ddata, cfg);

Check failure on line 232 in drivers/sensor/wsen_itds/itds.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

drivers/sensor/wsen_itds/itds.c:232 trailing whitespace
case SENSOR_CHAN_ALL:
return itds_fetch_accel(ddata, cfg) ||
itds_fetch_temperature(ddata, cfg);

default:
return -EINVAL;
Expand Down Expand Up @@ -276,7 +280,7 @@ static int itds_temp_channel_get(const struct device *dev,
int32_t temp_processed;
struct itds_device_data *ddata = dev->data;

temp_processed = (ddata->temprature >> 4) * ITDS_TEMP_CONST;
temp_processed = (ddata->temperature >> 4) * ITDS_TEMP_CONST;

val->val1 = ITDS_TEMP_OFFSET;
val->val2 = temp_processed;
Expand Down
2 changes: 1 addition & 1 deletion drivers/sensor/wsen_itds/itds.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct itds_device_data {
struct k_work work;
#endif
int16_t samples[ITDS_SAMPLE_SIZE];
int16_t temprature;
int16_t temperature;
uint16_t scale;
enum operation_mode op_mode;
const struct device *dev;
Expand Down

0 comments on commit 90e858f

Please sign in to comment.