Skip to content

[LPC15XX] Fixed µs_ticker implementation #2193

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

Merged
merged 3 commits into from
Jul 22, 2016
Merged

[LPC15XX] Fixed µs_ticker implementation #2193

merged 3 commits into from
Jul 22, 2016

Conversation

neilt6
Copy link
Contributor

@neilt6 neilt6 commented Jul 19, 2016

Re-wrote µs_ticker implementation to use SCT3 instead of RIT in order to fix a serious rollover bug at 1:11:34 (#1699).

neilt6 added 2 commits July 19, 2016 10:24
Re-wrote µs_ticker implementation to use SCT3 instead of RIT in order to
fix a serious rollover bug at 1:11:34.
Modified SCT3 match register critical section for compatibility with GCC toolchain.
@neilt6
Copy link
Contributor Author

neilt6 commented Jul 19, 2016

In regards to the Travis CI failure, it would seem that the GCC toolchain only implements void __disable_irq() and not int __disable_irq(). The integer version returns whether or not interrupts were already disabled, preventing nested critical section calls from re-enabling interrupts too soon. This is a problem that exists throughout the mbed library, and should really be investigated at some point.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 20, 2016

In regards to the Travis CI failure, it would seem that the GCC toolchain only implements void __disable_irq() and not int __disable_irq(). The integer version returns whether or not interrupts were already disabled, preventing nested critical section calls from re-enabling interrupts too soon. This is a problem that exists throughout the mbed library, and should really be investigated at some point.

We added core_util_critical_section_enter/exit that shall be used

Replaced __disable_irq() and __enable_irq() with core_util_critical_section_enter() and core_util_critical_section_exit().
@neilt6
Copy link
Contributor Author

neilt6 commented Jul 20, 2016

@0xc0170 - I was not aware of this, PR has been updated.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 21, 2016

LGTM

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 21, 2016

cc @toyowata

@toyowata
Copy link
Contributor

@neilt6 Thank you very much for this PR. The code looks good to me.
I have tested this with few example projects using Ticker with PwmOut and could not see any problem at all.

@0xc0170 0xc0170 merged commit 781fda0 into ARMmbed:master Jul 22, 2016
@neilt6 neilt6 deleted the lpc15xx-ticker-fix branch July 22, 2016 14:48
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

Successfully merging this pull request may close these issues.

3 participants