glenn20 / micropython

MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
https://micropython.org
Other
38 stars 9 forks source link

Can't import name TouchPad on Lolin S2 image #2

Closed jarodriguez-itsoft closed 2 years ago

jarodriguez-itsoft commented 2 years ago

Hi. I'm using latest image to test the ESP Now functionality (great work btw!), but I found I get an error when trying to use the TouchPad functionality. I get "ImportError: Can't import name TouchPad" when using from machine import TouchPad

Image is firmware-esp32-LOLIN_S2_MINI.bin from 13 Apr [20220413_espnow-g20-v1.18-10-ge68d28c8b]

Thanks

glenn20 commented 2 years ago

Hmmm. The espnow PR makes no changes to the config options that would affect the TouchPad.

I just checked machine_touchpad.c in the micropython master branch and the entire code is wrapped in "#if CONFIG_IDF_TARGET_ESP32" which means the touchpad is NOT compiled in on the S2 or S3 by default. I can see that there is code to suport the S2 and S3 in the machine_touchpad.c, but it is not enabled by default.

Can you verify if the TouchPad is enabled on vanilla micropython v1.18 images? It seems to have been deliberately disabled - perhaps because the S2 and S3 support is not yet mature.

glenn20 commented 2 years ago

Actually, I just checked with a v1.18 micropython image on my Feather S2. The TouchPad is also not available on the v1.18 micropython releases.

I will close this issue for now. You may want to post an issue on upstream micropython (if there is not one already) - or inquire about the status of the S2 TouchPad support on the forum. Good luck.