From 7822203b081c7b56911812c1af18c07f84451aa4 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Thu, 3 Aug 2006 21:18:17 +0000 Subject: - fix prototype in header - make sure we disable SSC before enabling PWM git-svn-id: https://svn.openpcd.org:2342/trunk@76 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpcd/firmware/src/pwm.c | 3 +++ openpcd/firmware/src/pwm.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openpcd/firmware/src/pwm.c b/openpcd/firmware/src/pwm.c index fd11e7c..9d79b61 100644 --- a/openpcd/firmware/src/pwm.c +++ b/openpcd/firmware/src/pwm.c @@ -101,6 +101,9 @@ void pwm_duty_set_percent(int channel, u_int16_t duty) void pwm_init(void) { + /* IMPORTANT: Disable PA17 (SSC TD) output */ + AT91F_PIO_CfgInput(AT91C_BASE_PIOA, AT91C_PIO_PA17); + /* Set PA0 to Peripheral A (PWM0) */ AT91F_PIO_CfgPeriph(AT91C_BASE_PIOA, AT91C_PA0_PWM0, 0); diff --git a/openpcd/firmware/src/pwm.h b/openpcd/firmware/src/pwm.h index c41d74a..8836c32 100644 --- a/openpcd/firmware/src/pwm.h +++ b/openpcd/firmware/src/pwm.h @@ -4,7 +4,7 @@ extern void pwm_freq_set(int channel, u_int32_t freq); extern void pwm_start(int channel); extern void pwm_stop(int channel); -extern void pwm_duty(int channel, u_int16_t duty); +extern void pwm_duty_set_percent(int channel, u_int16_t duty); extern void pwm_init(void); extern void pwm_fini(void); -- cgit v1.2.3