Skip to content

Fix GPIOTE not calling ISR when button is held during boot#715

Merged
JF002 merged 3 commits intoInfiniTimeOrg:developfrom
hubmartin:gpiote-fix
Oct 9, 2021
Merged

Fix GPIOTE not calling ISR when button is held during boot#715
JF002 merged 3 commits intoInfiniTimeOrg:developfrom
hubmartin:gpiote-fix

Conversation

@hubmartin
Copy link
Contributor

@hubmartin hubmartin commented Oct 3, 2021

Should solve Issue #693

Also improved previous similar issue with power detection 9ab298c

I welcome testing and feedback

@hubmartin hubmartin changed the title Fix GPIOTE not calling IRQ when button is held during boot Fix GPIOTE not calling ISR when button is held during boot Oct 3, 2021
@Riksu9000
Copy link
Contributor

I wonder why the issue happened in the first place. If the events don't go through while the button is pressed, then why didn't releasing the button fix it?

If the nrf_gpio_cfg_sense_input() functions aren't necessary, would it make sense to remove the last one as well, so all the GPIO initializations are more similar?

@geekbozu geekbozu added the bug Something isn't working label Oct 4, 2021
@hubmartin
Copy link
Contributor Author

If the nrf_gpio_cfg_sense_input() functions aren't necessary, would it make sense to remove the last one as well, so all the GPIO initializations are more similar?

Do not fix it if ain't broken :) Maybe I could. But I guess there should be added a check for touch IRQ level in the GPIOTE ISR. So it triggers touch event reading only once and not on both IRQ gpio edges. What is your opinion?

@JF002
Copy link
Collaborator

JF002 commented Oct 9, 2021

@Riksu9000

I wonder why the issue happened in the first place. If the events don't go through while the button is pressed, then why didn't releasing the button fix it?

There is a small note in the nrf52832 datasheet saying that the pin should not be in a state that would trigger the event when enabling it:
image

iirc I had this issue with the power detection too, and that's probably why I wrote 9ab298c.

Your fix works fine for me, and it looks good to me, thanks ;)

@JF002 JF002 added this to the 1.7.0 milestone Oct 9, 2021
@JF002 JF002 merged commit 9a831a6 into InfiniTimeOrg:develop Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Touch, button & power detection doesn't work when button is hold during boot

4 participants