diff options
| author | Angus Gratton <angus@redyak.com.au> | 2024-11-06 17:14:09 +1100 |
|---|---|---|
| committer | Angus Gratton <gus@projectgus.com> | 2024-11-28 15:45:39 +1100 |
| commit | 66e699e8a538ed7c1dc2d65035e5d93643e56667 (patch) | |
| tree | bc20433f5cfa7af2caed78bd504b57109e7f17df | |
| parent | ed3c75a3af16405508f7bfa66257abd7b53b4a9d (diff) | |
esp32: Fix machine.TouchPad startup on ESP32-S2 and S3.
Closes #13178.
TouchPad confirmed working on both chips, and fixes the the ESP32-S3
reading constant max value. Was unable to reproduce the bug on ESP32-S2 but
this may be due to my test setup, and it still works with the fix.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
| -rw-r--r-- | ports/esp32/machine_touchpad.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ports/esp32/machine_touchpad.c b/ports/esp32/machine_touchpad.c index a35e7fccd..48250280b 100644 --- a/ports/esp32/machine_touchpad.c +++ b/ports/esp32/machine_touchpad.c @@ -96,9 +96,6 @@ static mp_obj_t mtp_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_ if (!initialized) { touch_pad_init(); touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); - #if TOUCH_HW_VER == 2 - touch_pad_fsm_start(); - #endif initialized = 1; } #if SOC_TOUCH_VERSION_1 @@ -107,6 +104,10 @@ static mp_obj_t mtp_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_ esp_err_t err = touch_pad_config(self->touchpad_id); #endif if (err == ESP_OK) { + #if SOC_TOUCH_VERSION_2 + touch_pad_fsm_start(); + #endif + return MP_OBJ_FROM_PTR(self); } mp_raise_ValueError(MP_ERROR_TEXT("Touch pad error")); |
