diff options
Diffstat (limited to 'demos/ARMCM3-STM32F100-DISCOVERY/main.c')
-rw-r--r-- | demos/ARMCM3-STM32F100-DISCOVERY/main.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/main.c b/demos/ARMCM3-STM32F100-DISCOVERY/main.c index c4a222680..ff9c4ec70 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY/main.c +++ b/demos/ARMCM3-STM32F100-DISCOVERY/main.c @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -62,6 +63,8 @@ static const ADCConversionGroup adcgrpcfg = { * the active state is a logic one.
*/
static PWMConfig pwmcfg = {
+ 10000, /* 10KHz PWM clock frequency. */
+ 10000, /* PWM period 1S (in ticks). */
pwmpcb,
{
{PWM_OUTPUT_DISABLED, NULL},
@@ -70,9 +73,10 @@ static PWMConfig pwmcfg = { {PWM_OUTPUT_ACTIVE_HIGH, NULL}
},
/* HW dependent part.*/
- PWM_COMPUTE_PSC(STM32_TIMCLK1, 10000), /* 10KHz PWM clock frequency. */
- PWM_COMPUTE_ARR(10000, 1000000000), /* PWM period 1S (in nS). */
+ 0,
+#if STM32_PWM_USE_ADVANCED
0
+#endif
};
/*
@@ -114,7 +118,7 @@ void adccb(ADCDriver *adcp, adcsample_t *buffer, size_t n) { (void) buffer; (void) n;
/* Note, only in the ADC_COMPLETE state because the ADC driver fires an
intermediate callback when the buffer is half full.*/
- if (adcp->ad_state == ADC_COMPLETE) {
+ if (adcp->state == ADC_COMPLETE) {
adcsample_t avg_ch1, avg_ch2;
/* Calculates the average values from the ADC samples.*/
|