aboutsummaryrefslogtreecommitdiffstats
path: root/src/atsamd/hard_pwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/atsamd/hard_pwm.c')
-rw-r--r--src/atsamd/hard_pwm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/atsamd/hard_pwm.c b/src/atsamd/hard_pwm.c
index dfbd0bb3..f07328ff 100644
--- a/src/atsamd/hard_pwm.c
+++ b/src/atsamd/hard_pwm.c
@@ -92,7 +92,13 @@ gpio_pwm_setup(uint8_t pin, uint32_t cycle_time, uint8_t val)
}
// Set initial value
- struct gpio_pwm g = (struct gpio_pwm) { (void*)&tcc->CCB[p->channel].reg };
+ struct gpio_pwm g = (struct gpio_pwm) {
+#if CONFIG_MACH_SAMD21
+ (void*)&tcc->CCB[p->channel].reg
+#elif CONFIG_MACH_SAMC21
+ (void*)&tcc->CCBUF[p->channel].reg
+#endif
+ };
gpio_pwm_write(g, val);
// Route output to pin