Closed photonthunder closed 4 years ago
Unassigning because I have just about zero experience with the Atmel SAM families.
This discussion can be expanded to SAML21 as its also have 9 generic clock module. Personally, I think moving all those init into clock.c is a good idea. And user should only modify the periph_conf.h file to obtain the desired behaviour regarding clock management without overwrite clock.c
Submitted PR #7315 to try and move this forward. Once it is accepted then we can expand it to SAML21.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.
The samd21 has 9 generic clock generators that can be tied to different clock sources and then tweaked for the users needs. Currently these are setup in clock.c, timer.c, rtt.c, and rtc.c. Wanted to open a discussion about cleaning this up. I recommend we pull all generic clock generator code back into clock.c and setup a specific clock generator for a specific clock. For example:
Then in timer.c/rtt.c/rtc.c and so forth you just check that the clock is on then use it:
See PR #7130 for motivation for this issue.
Thoughts, input?