diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-01-15 10:12:32 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-01-28 20:02:16 -0500 |
commit | 40b5de168048e88e6ded1259a18fb2830e8c149e (patch) | |
tree | 5b729eac15b43476169d818e0d328fc6e24ef071 /src/atsamd/clock.c | |
parent | ed1334c24bc40f4baf370462496787b9ff2d703d (diff) | |
download | kutter-40b5de168048e88e6ded1259a18fb2830e8c149e.tar.gz kutter-40b5de168048e88e6ded1259a18fb2830e8c149e.tar.xz kutter-40b5de168048e88e6ded1259a18fb2830e8c149e.zip |
atsamd: Pass the power management id to enable_pclock()
Pass the power management id instead of the APBCMASK bit to the
enable_pclock() function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/atsamd/clock.c')
-rw-r--r-- | src/atsamd/clock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/atsamd/clock.c b/src/atsamd/clock.c index af4d1158..1103341a 100644 --- a/src/atsamd/clock.c +++ b/src/atsamd/clock.c @@ -36,10 +36,11 @@ route_pclock(uint32_t pclk_id, uint32_t clkgen_id) // Enable a peripheral clock and power to that peripheral void -enable_pclock(uint32_t pclk_id, uint32_t pmask) +enable_pclock(uint32_t pclk_id, uint32_t pm_id) { route_pclock(pclk_id, CLKGEN_MAIN); - PM->APBCMASK.reg |= pmask; + uint32_t pm_port = pm_id / 32, pm_bit = 1 << (pm_id % 32); + (&PM->APBAMASK.reg)[pm_port] |= pm_bit; } void |