-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix mbed::InterruptIn.mode() in NRF5x targets #7220
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
Fix mbed::InterruptIn.mode() in NRF5x targets #7220
Conversation
…ing: interruptIn always remained with pullup resistor enabled.
CLA signed, verified 👍 Thanks for the contribution, we will review it soon |
@@ -129,8 +129,18 @@ static void gpio_apply_config(uint8_t pin) | |||
cfg.hi_accuracy = false; | |||
cfg.is_watcher = false; | |||
cfg.sense = NRF_GPIOTE_POLARITY_TOGGLE; | |||
switch(m_gpio_cfg[pin].pull) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_gpio_cfg[pin].pull
should be initialized to NRF_GPIO_PIN_NOPULL
in function gpio_irq_init
below.
break; | ||
default: | ||
cfg.pull = NRF_GPIO_PIN_NOPULL; | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xc0170 I'm not up to speed on our style guide. Is this correctly formatted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed
Looks good. I've added a comment about an uninitialized variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review the comments
- Set default pull mode to PullNone in gpio_irq_init
Thanks for reviewing. I fixed the coding style with the Mbed OS Artistic Style file. |
Looks good! |
/morph build |
Build : SUCCESSBuild number : 2415 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2046 |
Test : SUCCESSBuild number : 2197 |
/morph mbed2-build |
Fix mbed::InterruptIn.mode() for NRF5x targets
Description
The interruptIn mode() didn't do anything in nrf5x targets, it always remained with a pullup resistor enabled.
We're migrating from MBed OS 3 to MBed OS 5 and found this problematic issue. The pullup or pulldown resistor should be configurable in the InterruptIn class. Currently this is for a unknown reason fixed to pullup resistor always enabled.
Tested locally on the nrf51422_xxac with GCC_ARM toolchain.
Pull request type
[x] Fix
[ ] Refactor
[ ] New Target
[ ] Feature