diff options
| author | Kevin O'Connor <kevin@koconnor.net> | 2018-11-21 20:33:44 -0500 |
|---|---|---|
| committer | Kevin O'Connor <kevin@koconnor.net> | 2018-11-21 20:44:18 -0500 |
| commit | 4bbd6310864b231f26c3c069052a610a2178a456 (patch) | |
| tree | d21b5fe6c94ce1241c4464e7bb3c85136bd9b2e8 /src/lpc176x/timer.c | |
| parent | 9ba94ded9e9c48c81ddd10e9712619882e046fa1 (diff) | |
| download | kutter-4bbd6310864b231f26c3c069052a610a2178a456.tar.gz kutter-4bbd6310864b231f26c3c069052a610a2178a456.tar.xz kutter-4bbd6310864b231f26c3c069052a610a2178a456.zip | |
lpc176x: Add an enable_peripheral_clock() helper function
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/lpc176x/timer.c')
| -rw-r--r-- | src/lpc176x/timer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lpc176x/timer.c b/src/lpc176x/timer.c index 1b966d1c..318e8bea 100644 --- a/src/lpc176x/timer.c +++ b/src/lpc176x/timer.c @@ -8,6 +8,7 @@ #include "board/irq.h" // irq_disable #include "board/misc.h" // timer_read_time #include "board/timer_irq.h" // timer_dispatch_many +#include "internal.h" // enable_peripheral_clock #include "sched.h" // DECL_INIT // Set the next irq time @@ -38,7 +39,7 @@ timer_init(void) // Disable timer LPC_TIM0->TCR = 0x02; // Setup clock and prescaler (divide sys clock by 4) - LPC_SC->PCLKSEL0 = (LPC_SC->PCLKSEL0 & ~(0x3<<2)) | (0x1<<2); + enable_peripheral_clock(PCLK_TIMER0); LPC_TIM0->PR = 3; // Enable interrupts NVIC_SetPriority(TIMER0_IRQn, 2); |
