aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/pwm.c
diff options
context:
space:
mode:
authorPerry Hung <iperry@gmail.com>2010-10-12 20:58:48 -0400
committerPerry Hung <iperry@gmail.com>2010-10-12 20:59:46 -0400
commitaa7a43efce35fa41d57f9858ee41be0c33e84709 (patch)
treed1ed6a43df75776dd35ee1ca8513bc5f7be47ce2 /wirish/pwm.c
parentfccf017f3a5aa7182080c1ed062ab46773a8f34a (diff)
downloadlibrambutan-aa7a43efce35fa41d57f9858ee41be0c33e84709.tar.gz
librambutan-aa7a43efce35fa41d57f9858ee41be0c33e84709.zip
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
Diffstat (limited to 'wirish/pwm.c')
-rw-r--r--wirish/pwm.c4
1 files changed, 2 insertions, 2 deletions
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;
}