Skip to content
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 ChibiOS timer overflow for 16-bit system clock devices. #8078

Merged
merged 1 commit into from
Feb 15, 2020

Conversation

tzarc
Copy link
Member

@tzarc tzarc commented Feb 4, 2020

Description

When running a high SysTick frequency on 16-bit devices, the "simplified" timer implementation on the original PR #7597 was not tested thoroughly enough and was incorrectly ignoring overflows.

This PR support for overflow when running on 16-bit devices.
It also updates timer_expired and timer_expired32 to be defines, as when compiling for debug mode, the linker has already stripped out the inline functions.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@drashna drashna requested a review from a team February 5, 2020 02:31
@drashna
Copy link
Member

drashna commented Feb 5, 2020

Tested on Planck EZ (STM32F303), seems to work fine.

@zvecr
Copy link
Member

zvecr commented Feb 5, 2020

Tested on Planck EZ (STM32F303), seems to work fine.

@drashna Did you change the ChibiOS config to use another timer than TIM2? (Just working out which pathways have been tested)

@drashna
Copy link
Member

drashna commented Feb 5, 2020

Nope, but I can/will test that. Though, the EZ is using PWM on TIM3

@tzarc
Copy link
Member Author

tzarc commented Feb 5, 2020

To add fuel to the fire, was already using TIM21 on my L082.

@tzarc
Copy link
Member Author

tzarc commented Feb 8, 2020

Rebased to fix conflicts.

@tzarc tzarc changed the title Fix ChibiOS timer overflow for 16-bit SysTick devices. Fix ChibiOS timer overflow for 16-bit system clock devices. Feb 9, 2020
@tzarc tzarc force-pushed the future_16bit_systick branch from ce36a9c to 2cf89ed Compare February 15, 2020 05:28
Copy link
Member

@noroadsleft noroadsleft left a comment

Choose a reason for hiding this comment

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

__attribute__ ((weak)) ✔️

@noroadsleft noroadsleft merged commit b65d3f3 into qmk:future Feb 15, 2020
@noroadsleft noroadsleft added the breaking_change Changes that need to wait for a version increment label Feb 17, 2020
noroadsleft pushed a commit to noroadsleft/qmk_firmware that referenced this pull request Feb 21, 2020
@tzarc tzarc deleted the future_16bit_systick branch February 29, 2020 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking_change Changes that need to wait for a version increment bug core needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants