Merge pull request #4021 from dhalbert/esp32-s2-touch-init-order
ESP32-S2: Initialize touch in proper order
This commit is contained in:
commit
914326872f
|
@ -46,8 +46,13 @@ void peripherals_touch_init(const touch_pad_t touchpad) {
|
||||||
if (!touch_inited) {
|
if (!touch_inited) {
|
||||||
touch_pad_init();
|
touch_pad_init();
|
||||||
touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER);
|
touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER);
|
||||||
|
}
|
||||||
|
// touch_pad_config() must be done before touch_pad_fsm_start() the first time.
|
||||||
|
// Otherwise the calibration is wrong and we get maximum raw values if there is
|
||||||
|
// a trace of any significant length on the pin.
|
||||||
|
touch_pad_config(touchpad);
|
||||||
|
if (!touch_inited) {
|
||||||
touch_pad_fsm_start();
|
touch_pad_fsm_start();
|
||||||
touch_inited = true;
|
touch_inited = true;
|
||||||
}
|
}
|
||||||
touch_pad_config(touchpad);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue