Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Esp touch alarm fix #8003

Merged
merged 2 commits into from May 22, 2023
Merged

Esp touch alarm fix #8003

merged 2 commits into from May 22, 2023

Conversation

dhalbert
Copy link
Collaborator

Two problems:

  • ESP NeoPixel fixes #5892 made pin reset set a pull-up, which is recommended by Espressif for minimal power draw (and prevents glitches on random pins). Needed to not set the pull-up to make touch waking work. Added a new capability in microcontroller/Pin.c to not reset just once. I was originally using never-reset to do this, but I can't always clear never-reset at the right time, so sometimes it sticks around and causes the pin to appear to be in use.
  • Fix ESP32 touch; rework common code a bit #6772 fixed touch on plain ESP32 and switched from TOUCH_FSM_MODE_TIMER to TOUCH_FSM_MODE_SW. SW does not work with sleep touch awakening. I had changed it to SW in Fix ESP32 touch; rework common code a bit #6772, but I don't know why, and TIMER seems to work fine on ESP32, ESP32-S2, and ESP32-S3.

Tested on Metro ESP32-S2, Feather ESP32-S3 8MB/no-psram, and Feather ESP32 V2.

ESP32 TouchAlarm wakeup does not work -- I spent several hours on it, and can't figure out why it's not working. I'll open another issue for that. ESP32 TouchIn works fine. Some of my residual changes to help that along are in this PR, because the original code was clearly wrong in some cases.

@mikeysklar you may want to test.
@rxhfcy did you encounter the original issue? You may want to test.

@dhalbert
Copy link
Collaborator Author

dhalbert commented May 19, 2023

I don't think this has to get into 8.1.0 final, so you don't have to merge even if you approve. It's been a bug since 7.2.0 or so.

... But probably safe to merge anyway.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for the fix. Happy to see skip_once_ is port specific.

@tannewt tannewt merged commit 9040ac8 into adafruit:main May 22, 2023
133 checks passed
@dhalbert dhalbert deleted the esp-touch-alarm-fix branch May 22, 2023 20:54
@mikeysklar
Copy link

Confirmed this fix works for me on the Qt Py ESP32-S2. Thank you @dhalbert for the quick solution.

`Wi-Fi: off | code.py | 8.1.0-2-g9040ac8bcWi-Fi: off | code.py | 8.1.0-2-g9040ac8bc
Wi-Fi: off | Done | 8.1.0-2-g9040ac8bcWi-Fi: off | Done | 8.1.0-2-g9040ac8bc
Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.
Pretending to deep sleep until alarm, CTRL-C or file write.
Woken up by alarm.`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TouchAlarm on Qt Py ESP32-S2 not working in SLEEP mode
3 participants