Skip to content

Commit bf4392f

Browse files
gmarullcarlescufi
authored andcommitted
drivers: sensor: examplesensor: use gpio_pin_get_dt
Use the recently introduced GPIO API that allows obtaining pin state using the gpio_dt_spec struct. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 4520f6a commit bf4392f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/sensor/examplesensor/examplesensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static int examplesensor_sample_fetch(const struct device *dev,
2626
const struct examplesensor_config *config = dev->config;
2727
struct examplesensor_data *data = dev->data;
2828

29-
data->state = gpio_pin_get(config->input.port, config->input.pin);
29+
data->state = gpio_pin_get_dt(&config->input);
3030

3131
return 0;
3232
}

0 commit comments

Comments
 (0)