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

Merged
merged 2 commits into from Jun 21, 2018

Conversation

Projects
None yet
5 participants
@melvinvdb

melvinvdb commented Jun 14, 2018

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

Melvin van den berg
Fixed broken InterruptIn.mode() in NRF5x target which didn't do anyth…
…ing: interruptIn always remained with pullup resistor enabled.
@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jun 14, 2018

CLA signed, verified 👍 Thanks for the contribution, we will review it soon

@0xc0170 0xc0170 requested a review from marcuschangarm Jun 14, 2018

@@ -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) {

This comment has been minimized.

@marcuschangarm

marcuschangarm Jun 18, 2018

Contributor

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;

This comment has been minimized.

@marcuschangarm

marcuschangarm Jun 18, 2018

Contributor

@0xc0170 I'm not up to speed on our style guide. Is this correctly formatted?

This comment has been minimized.

@0xc0170

0xc0170 Jun 19, 2018

Member

Should be fixed

@marcuschangarm

This comment has been minimized.

Contributor

marcuschangarm commented Jun 18, 2018

Looks good. I've added a comment about an uninitialized variable.

@0xc0170

Please review the comments

@0xc0170 0xc0170 added needs: work and removed needs: review labels Jun 19, 2018

Melvin van den berg
- Fixed coding style
- Set default pull mode to PullNone in gpio_irq_init
@melvinvdb

This comment has been minimized.

melvinvdb commented Jun 19, 2018

Thanks for reviewing. I fixed the coding style with the Mbed OS Artistic Style file.

@marcuschangarm

This comment has been minimized.

Contributor

marcuschangarm commented Jun 19, 2018

Looks good!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jun 21, 2018

/morph build

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Jun 21, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Jun 21, 2018

Build : SUCCESS

Build number : 2415
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7220/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jun 21, 2018

/morph mbed2-build

@cmonr cmonr added ready for merge and removed needs: CI labels Jun 21, 2018

@cmonr cmonr merged commit 0b8f467 into ARMmbed:master Jun 21, 2018

14 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 925 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9703 cycles (-427 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment