From aa7a43efce35fa41d57f9858ee41be0c33e84709 Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Tue, 12 Oct 2010 20:58:48 -0400 Subject: Add selective enabling of channels for pwm channels pinMode(PWM) turns the channel on, other modes should turn it off Fixes bug with conflicting timer for spi1 and timer. This is not well-tested. Conflicts: libmaple/timers.c --- wirish/pwm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wirish/pwm.c') diff --git a/wirish/pwm.c b/wirish/pwm.c index 2f555ab..0bf27aa 100644 --- a/wirish/pwm.c +++ b/wirish/pwm.c @@ -38,9 +38,9 @@ void pwmWrite(uint8 pin, uint16 duty_cycle) { return; } - ccr = PIN_MAP[pin].timer_channel; + ccr = (TimerCCR)(PIN_MAP[pin].timer_channel); - if (ccr == TIMER_INVALID) { + if (ccr == (TimerCCR)TIMER_INVALID) { return; } -- cgit v1.2.3