From 5a53916f0e51f02aab6d892c87310e5730abce5c Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Mon, 13 Sep 2021 16:43:35 -0400 Subject: first steps toward supporting alternate board pinouts --- watch-library/watch/watch_private.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'watch-library/watch/watch_private.c') diff --git a/watch-library/watch/watch_private.c b/watch-library/watch/watch_private.c index 8dfd10f9..dd3cba0b 100644 --- a/watch-library/watch/watch_private.c +++ b/watch-library/watch/watch_private.c @@ -93,18 +93,18 @@ void _watch_enable_tcc() { // get the LED working. Almost any period will do, tho it should be below 20000 (i.e. 50 Hz) to avoid flickering. hri_tcc_write_PER_reg(TCC0, 4096); // Set the duty cycle of all pins to 0: LED's off, buzzer not buzzing. - hri_tcc_write_CC_reg(TCC0, 1, 0); - hri_tcc_write_CC_reg(TCC0, 2, 0); - hri_tcc_write_CC_reg(TCC0, 3, 0); + hri_tcc_write_CC_reg(TCC0, WATCH_BUZZER_TCC_CHANNEL, 0); + hri_tcc_write_CC_reg(TCC0, WATCH_RED_TCC_CHANNEL, 0); + hri_tcc_write_CC_reg(TCC0, WATCH_GREEN_TCC_CHANNEL, 0); // Enable the TCC hri_tcc_set_CTRLA_ENABLE_bit(TCC0); hri_tcc_wait_for_sync(TCC0, TCC_SYNCBUSY_ENABLE); // enable LED PWM pins (the LED driver assumes if the TCC is on, the pins are enabled) gpio_set_pin_direction(RED, GPIO_DIRECTION_OUT); - gpio_set_pin_function(RED, PINMUX_PA20F_TCC0_WO6); + gpio_set_pin_function(RED, WATCH_RED_TCC_PINMUX); gpio_set_pin_direction(GREEN, GPIO_DIRECTION_OUT); - gpio_set_pin_function(GREEN, PINMUX_PA21F_TCC0_WO7); + gpio_set_pin_function(GREEN, WATCH_GREEN_TCC_PINMUX); } void _watch_disable_tcc() { -- cgit v1.2.3