aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32F0xx/PWM-ICU/main.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-20 14:49:49 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-20 14:49:49 +0000
commit371ef2afb5b7045d8293dd5a393a7783b025f8a8 (patch)
treed28a31a6d32d6d02cead54a8438556235635f0d6 /testhal/STM32F0xx/PWM-ICU/main.c
parent8d0dc4bfd67857f376a2aa67424e9e8697342025 (diff)
downloadChibiOS-371ef2afb5b7045d8293dd5a393a7783b025f8a8.tar.gz
ChibiOS-371ef2afb5b7045d8293dd5a393a7783b025f8a8.tar.bz2
ChibiOS-371ef2afb5b7045d8293dd5a393a7783b025f8a8.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6191 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F0xx/PWM-ICU/main.c')
-rw-r--r--testhal/STM32F0xx/PWM-ICU/main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/testhal/STM32F0xx/PWM-ICU/main.c b/testhal/STM32F0xx/PWM-ICU/main.c
index 9de2c2eea..fa4c4de8c 100644
--- a/testhal/STM32F0xx/PWM-ICU/main.c
+++ b/testhal/STM32F0xx/PWM-ICU/main.c
@@ -90,11 +90,11 @@ int main(void) {
/*
* Initializes the PWM driver 2 and ICU driver 3.
* GPIOA6 is the ICU input (CH1).
- * GPIOA15 is the PWM output (CH1).
+ * GPIOA8 is the PWM output (CH1).
* The two pins have to be externally connected together.
*/
- pwmStart(&PWMD2, &pwmcfg);
- palSetPadMode(GPIOA, 15, PAL_MODE_ALTERNATE(2));
+ pwmStart(&PWMD1, &pwmcfg);
+ palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(2));
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(1));
icuEnable(&ICUD3);
@@ -103,33 +103,33 @@ int main(void) {
/*
* Starts the PWM channel 0 using 75% duty cycle.
*/
- pwmEnableChannel(&PWMD2, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD2, 7500));
+ pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 50% duty cycle.
*/
- pwmEnableChannel(&PWMD2, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD2, 5000));
+ pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 5000));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 25% duty cycle.
*/
- pwmEnableChannel(&PWMD2, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD2, 2500));
+ pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 2500));
chThdSleepMilliseconds(5000);
/*
* Changes PWM period to half second the duty cycle becomes 50%
* implicitly.
*/
- pwmChangePeriod(&PWMD2, 5000);
+ pwmChangePeriod(&PWMD1, 5000);
chThdSleepMilliseconds(5000);
/*
* Disables channel 0 and stops the drivers.
*/
- pwmDisableChannel(&PWMD2, 0);
- pwmStop(&PWMD2);
+ pwmDisableChannel(&PWMD1, 0);
+ pwmStop(&PWMD1);
icuDisable(&ICUD3);
icuStop(&ICUD3);
palClearPad(GPIOC, GPIOC_LED3);