sharandac / My-TTGO-Watch

A GUI named hedge for smartwatch like devices based on ESP32. Currently support for T-Watch2020 (V1,V2,V3), T-Watch2021, M5Paper, M5Core2 and native Linux support for testing.
GNU General Public License v2.0
537 stars 246 forks source link

gpio: GPIO wakeup only supports level mode, but edge mode set. gpio_num:39 #386

Closed dlarue closed 1 year ago

dlarue commented 1 year ago

Build tool used:

used Hardware:

Description of problem: on screen sleep this error is sent out the serial port: E (94242) gpio: GPIO wakeup only supports level mode, but edge mode set. gpio_num:39

Additional information and things you've tried: in file: src/hardware/touch.cpp line 146 - attachInterrupt( TOUCH_INT, &touch_irq, FALLING ); I don't know if it should be set to some threshold value or what but it would seem the issue lies here.

GDV0 commented 1 year ago

Hi dlarue, There is a fix I found in the "My-TTGO-Watch-experimental" github branch. image

Just replace GPIO_INTR_POSEDGE with GPIO_INTR_HIGHLEVEL on line 418 of motion.cpp file ( located in function bma_standby). This prevents to have "gpio: GPIO wakeup only supports level mode, but edge mode set. gpio_num:39"

dlarue commented 1 year ago

Have you tried it because I get an error that GPIO_INTR_HIGHLEVEL is not defined.

src/hardware/motion.cpp:418:59: error: 'GPIO_INTR_HIGHLEVEL' was not declared in this scope gpio_wakeup_enable ( (gpio_num_t)BMA423_INT1, GPIO_INTR_HIGHLEVEL ); //DJL

GDV0 commented 1 year ago

Oops ! Sorry, I've made a typo. the right name is GPIO_INTR_HIGH_LEVEL

dlarue commented 1 year ago

That was it, it did compile and will see if it has any effect on runtime. Thanks. It's been a while since I've worked on this and thought I'd done something similar if not the same with replacing all pin 39 references to LEVEL triggered but it had no effect on runtime. Will try this one liner none the less.