We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6a76b60 + ee48e4b commit 9143268Copy full SHA for 9143268
ports/esp32s2/peripherals/touch.c
@@ -46,8 +46,13 @@ void peripherals_touch_init(const touch_pad_t touchpad) {
46
if (!touch_inited) {
47
touch_pad_init();
48
touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER);
49
+ }
50
+ // touch_pad_config() must be done before touch_pad_fsm_start() the first time.
51
+ // Otherwise the calibration is wrong and we get maximum raw values if there is
52
+ // a trace of any significant length on the pin.
53
+ touch_pad_config(touchpad);
54
+ if (!touch_inited) {
55
touch_pad_fsm_start();
56
touch_inited = true;
57
}
- touch_pad_config(touchpad);
58
0 commit comments