Skip to content

Commit 67cfd32

Browse files
kartbendkalowsk
authored andcommitted
drivers: input: esp32: fix threshold calculation
Fix a bug in the touch threshold calculation where channel_num was incorrectly used instead of channel_sens. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 3d97b76 commit 67cfd32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/input/input_esp32_touch_sensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static int esp32_touch_sensor_init(const struct device *dev)
254254
uint16_t touch_value = touch_hal_read_raw_data(channel_cfg->channel_num);
255255

256256
touch_hal_set_threshold(channel_cfg->channel_num,
257-
touch_value * (100 - channel_cfg->channel_num) / 100);
257+
touch_value * (100 - channel_cfg->channel_sens) / 100);
258258
}
259259

260260
#elif defined(CONFIG_SOC_SERIES_ESP32S2) || defined(CONFIG_SOC_SERIES_ESP32S3)

0 commit comments

Comments
 (0)