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

GPIO_LEVEL interrupts broken on ESP32 #4

Open
Harvie opened this issue Apr 15, 2020 · 3 comments
Open

GPIO_LEVEL interrupts broken on ESP32 #4

Harvie opened this issue Apr 15, 2020 · 3 comments

Comments

@Harvie
Copy link

Harvie commented Apr 15, 2020

Hello, i am working on esp32 and tried to use this:

mgos_gpio_set_int_handler(MY_INTERRUPT_PIN, MGOS_GPIO_INT_LEVEL_LO, my_cb, NULL);

but callback is never called. when i use this, the callback is called properly:

mgos_gpio_set_int_handler(MY_INTERRUPT_PIN, MGOS_GPIO_INT_EDGE_NEG, my_cb, NULL);

Is there reason for this? I think that negative edge should trigger LEVEL_LO as well.. Am i right?

Problem with edge trigger is that when i miss the edge while interrupts are disabled, it will not get triggered afterwards while pin is still low. So i need to trigger on low-level instead, but it's broken :-/

@rojer
Copy link
Contributor

rojer commented Apr 15, 2020

i seem to recall that there is a hardware problem that has to do with different kinds of interrupts on the same GPIO block.
never used level interrupts myself, only edge.

@rojer
Copy link
Contributor

rojer commented Apr 15, 2020

check out section 3.14 of this document.

@Harvie
Copy link
Author

Harvie commented Apr 15, 2020

It is working using direct ISR method, when i change

mgos_gpio_set_int_handler(MY_INTERRUPT_PIN, MGOS_GPIO_INT_LEVEL_LO, my_cb, NULL);

to

mgos_gpio_set_int_handler_isr(MY_INTERRUPT_PIN, MGOS_GPIO_INT_LEVEL_LO, my_cb, NULL);

Which means the underlying layers are working properly and bug is in mongoose.

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

No branches or pull requests

2 participants