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

EFM32 IRQ handling fix #6984

Merged
merged 1 commit into from May 29, 2018

Conversation

Projects
None yet
6 participants
@stevew817
Contributor

stevew817 commented May 22, 2018

Description

  • IRQ handling got updated previously to a non-functional state when both callbacks were registered (it'd fire a fall callback for both rise and fall events). With this update, that faulty behaviour is corrected. Due to delays between the detection of the edge and the handling of the interrupt (and the fact that information about which edge you received on the pin is not stored anywhere), there is no way to be absolutely sure which edge got triggered on the pin. Therefore, we make a best-guess effort by looking at the pin state at the time of IRQ handling, and fire a callback as if that was the end state of the event. This will usually work out fine, except in cases were the signal is toggling faster than the IRQ handler's response time. In that case, a user won't get both callbacks (as expected for a pulse), but only the last event.
  • Stripped some dead code.

This supersedes PR #6976 to avoid reverting back to code we know is faulty (does not detect short pulses). @DBS06

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change
EFM32 IRQ handling fix
* IRQ handling got updated previously to a non-functional state when both callbacks were registered (it'd fire a fall callback for both rise and fall events). With this update, that faulty behaviour is corrected. Due to delays between the detection of the edge and the handling of the interrupt (and the fact that information about which edge you received on the pin is not stored anywhere), there is no way to be absolutely sure which edge got triggered on the pin. Therefore, we make a best-guess effort by looking at the pin state at the time of IRQ handling, and fire a callback as if that was the end state of the event. This will usually work out fine, except in cases were the signal is toggling faster than the IRQ handler's response time. In that case, a user won't get both callbacks (as expected for a pulse), but only the last event.
* Stripped some dead code.
@DBS06

This comment has been minimized.

DBS06 commented May 23, 2018

Nice done!

@0xc0170 0xc0170 added the needs: CI label May 23, 2018

@amq

This comment has been minimized.

Contributor

amq commented May 24, 2018

My issue also remains solved, while both rise and fall work correctly.

@stevew817

This comment has been minimized.

Contributor

stevew817 commented May 24, 2018

Thanks for the rapid feedback @amq !

@0xc0170

This comment has been minimized.

Member

0xc0170 commented May 26, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented May 26, 2018

Build : SUCCESS

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

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.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels May 28, 2018

@cmonr cmonr merged commit 88d863a into ARMmbed:master May 29, 2018

13 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, 847 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9580 cycles (+137 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B (+0.00%)
Details
travis-ci/tools Local tools testing has passed
Details

@cmonr cmonr removed the ready for merge label May 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment