From 371ef2afb5b7045d8293dd5a393a7783b025f8a8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 20 Aug 2013 14:49:49 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6191 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32F0xx/PWM-ICU/.project | 2 +- testhal/STM32F0xx/PWM-ICU/chconf.h | 8 ++++---- testhal/STM32F0xx/PWM-ICU/main.c | 18 +++++++++--------- testhal/STM32F0xx/PWM-ICU/mcuconf.h | 4 ++-- testhal/STM32F0xx/PWM-ICU/readme.txt | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) (limited to 'testhal/STM32F0xx/PWM-ICU') diff --git a/testhal/STM32F0xx/PWM-ICU/.project b/testhal/STM32F0xx/PWM-ICU/.project index 60ef1bb65..021a42109 100644 --- a/testhal/STM32F0xx/PWM-ICU/.project +++ b/testhal/STM32F0xx/PWM-ICU/.project @@ -27,7 +27,7 @@ board 2 - CHIBIOS/boards/ST_STM32F0_DISCOVERY + CHIBIOS/os/hal/boards/ST_STM32F0_DISCOVERY os diff --git a/testhal/STM32F0xx/PWM-ICU/chconf.h b/testhal/STM32F0xx/PWM-ICU/chconf.h index 9864162ac..045129dac 100644 --- a/testhal/STM32F0xx/PWM-ICU/chconf.h +++ b/testhal/STM32F0xx/PWM-ICU/chconf.h @@ -41,7 +41,7 @@ * setting also defines the system tick time unit. */ #if !defined(CH_CFG_ST_FREQUENCY) || defined(__DOXYGEN__) -#define CH_CFG_ST_FREQUENCY 1000 +#define CH_CFG_ST_FREQUENCY 10000 #endif /** @@ -62,7 +62,7 @@ * this value. */ #if !defined(CH_CFG_TIMEDELTA) || defined(__DOXYGEN__) -#define CH_CFG_TIMEDELTA 0 +#define CH_CFG_TIMEDELTA 2 #endif /** @@ -357,7 +357,7 @@ * @note The default is @p FALSE. */ #if !defined(CH_DBG_STATISTICS) || defined(__DOXYGEN__) -#define CH_DBG_STATISTICS TRUE +#define CH_DBG_STATISTICS FALSE #endif /** @@ -441,7 +441,7 @@ * tickless mode. */ #if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) -#define CH_DBG_THREADS_PROFILING TRUE +#define CH_DBG_THREADS_PROFILING FALSE #endif /** @} */ 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); diff --git a/testhal/STM32F0xx/PWM-ICU/mcuconf.h b/testhal/STM32F0xx/PWM-ICU/mcuconf.h index 37a863b4d..a8c5744c1 100644 --- a/testhal/STM32F0xx/PWM-ICU/mcuconf.h +++ b/testhal/STM32F0xx/PWM-ICU/mcuconf.h @@ -110,8 +110,8 @@ * PWM driver system settings. */ #define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 TRUE +#define STM32_PWM_USE_TIM1 TRUE +#define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM3 FALSE #define STM32_PWM_TIM1_IRQ_PRIORITY 3 #define STM32_PWM_TIM2_IRQ_PRIORITY 3 diff --git a/testhal/STM32F0xx/PWM-ICU/readme.txt b/testhal/STM32F0xx/PWM-ICU/readme.txt index eccb291d3..a0c549b3b 100644 --- a/testhal/STM32F0xx/PWM-ICU/readme.txt +++ b/testhal/STM32F0xx/PWM-ICU/readme.txt @@ -12,7 +12,7 @@ The application demonstrates the use of the STM32F0xx PWM-ICU drivers. ** Board Setup ** -- Connect PA15 and PC6 together. +- Connect PA8 and PA6 together. ** Build Procedure ** -- cgit v1.2.3