Skip to content

sam0/timer: various fixes#11610

Merged
dylad merged 1 commit intoRIOT-OS:masterfrom
benpicco:sam0-timer_fix
Jun 6, 2019
Merged

sam0/timer: various fixes#11610
dylad merged 1 commit intoRIOT-OS:masterfrom
benpicco:sam0-timer_fix

Conversation

@benpicco
Copy link
Copy Markdown
Contributor

@benpicco benpicco commented May 29, 2019

  • The frequency parameter is unused now, so don't check it.
  • The hardware provides dedicated SET/CLR registers to do away with read-modify-write cycles, so don' t do read-modify-write on them, just write them.
  • Workaround a possible hardware bug on SAMD5x where the TC_SYNCBUSY_CTRLB bit is not immediately set after writing TC_CTRLBSET_CMD_READSYNC - loop until the bit is really set.
  • replace magic value by constant define.

@aabadie aabadie added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: drivers Area: Device drivers Area: cpu Area: CPU/MCU ports labels May 29, 2019
@PeterKietzmann
Copy link
Copy Markdown
Member

@MichelRottleuthner mind to look at this?

@benpicco benpicco changed the title sam0/timer: don't restrict timer to 1 MHz sam0/timer: various fixes Jun 5, 2019
@benpicco benpicco force-pushed the sam0-timer_fix branch 2 times, most recently from be68e85 to ece2c52 Compare June 6, 2019 12:40
@dylad dylad added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 6, 2019
This cleans up the sam0 timer driver:

 - remove the check for the unused freq parameter
 - the MCU provides dedicated SET/CLR registers to avoid
   read-modify-write, so don't do read-modify-write on them.
 - workaround a possible hardware bug on SAMD5x:
   loop until the CMD_READSYNC is really set
Copy link
Copy Markdown
Member

@dylad dylad left a comment

Choose a reason for hiding this comment

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

Tested ACK.

@dylad dylad added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines labels Jun 6, 2019
@dylad dylad merged commit a37c0cc into RIOT-OS:master Jun 6, 2019
@benpicco benpicco deleted the sam0-timer_fix branch June 6, 2019 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants