8000 Ticks ms by tannewt · Pull Request #9 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Ticks ms #9

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
Oct 13, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
atmel-samd: Minor fixes to SysTick handler, enable all interrupts fun…
…ction.
  • Loading branch information
tdicola committed Oct 13, 2016
commit 2ee52c4fde36a69f1340af7ad0db2752de99a51a
6 changes: 3 additions & 3 deletions atmel-samd/mphalport.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void SysTick_Handler(void) {
systick_ticks_ms += 1;
// Keep the counter within the range of 31 bit uint values since that's the
// max value for micropython 'small' ints.
systick_ticks_ms = systick_ticks_ms > 2147483647L ? 0 : systick_ticks_ms;
systick_ticks_ms = systick_ticks_ms > (0xFFFFFFFF >> 1) ? 0 : systick_ticks_ms;
}

// Interrupt flags that will be saved and restored during disable/Enable
Expand All @@ -237,8 +237,8 @@ void mp_hal_disable_all_interrupts(void) {

void mp_hal_enable_all_interrupts(void) {
// Enable all interrupt sources after timing critical sections.
// Restore ASF-based interrupts.
cpu_irq_restore(irq_flags);
// Restore SysTick interrupt.
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to swap these two enables so its the reverse order of disable?

// Restore ASF-based interrupts.
cpu_irq_restore(irq_flags);
}
0