diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-12-28 19:00:29 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-01-07 19:33:26 -0500 |
commit | 4683036f98b319d1c36853c1a200d63c36b470ff (patch) | |
tree | 340620d721c54de9de57bbb3b514e3fcff8b1599 /src/sam3/timer.c | |
parent | b4baabe4081a3c1473e970b776a5d760bf6689e3 (diff) | |
download | kutter-4683036f98b319d1c36853c1a200d63c36b470ff.tar.gz kutter-4683036f98b319d1c36853c1a200d63c36b470ff.tar.xz kutter-4683036f98b319d1c36853c1a200d63c36b470ff.zip |
sam3: Add enable_pclock() helper function
Add a helper function to enable peripheral clocks.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/sam3/timer.c')
-rw-r--r-- | src/sam3/timer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sam3/timer.c b/src/sam3/timer.c index d5bc8c6a..987a76e8 100644 --- a/src/sam3/timer.c +++ b/src/sam3/timer.c @@ -41,7 +41,7 @@ timer_init(void) tc->TC_CCR = TC_CCR_CLKDIS; tc->TC_IDR = 0xFFFFFFFF; // Enable it - PMC->PMC_PCER0 = 1 << ID_TC0; + enable_pclock(ID_TC0); tc->TC_CMR = TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1; tc->TC_IER = TC_IER_CPAS; NVIC_SetPriority(TC0_IRQn, 1); |