aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-03-31 12:35:42 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-03-31 12:35:42 +0000
commit91e4dee81eef472b69d7b5fe321d8c16b4a0ac59 (patch)
treed83dcdad84d5f3395533dbb9c05f92e7bfd3c05c /demos
parenta58a524d4c7e58d03a0fa3698f09fb17985a70bc (diff)
downloadChibiOS-91e4dee81eef472b69d7b5fe321d8c16b4a0ac59.tar.gz
ChibiOS-91e4dee81eef472b69d7b5fe321d8c16b4a0ac59.tar.bz2
ChibiOS-91e4dee81eef472b69d7b5fe321d8c16b4a0ac59.zip
Generic improvements to the GPT driver organization.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2854 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ARMCM3-STM32F100-DISCOVERY/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/demos/ARMCM3-STM32F100-DISCOVERY/main.c b/demos/ARMCM3-STM32F100-DISCOVERY/main.c
index d638b5926..bc7e5f632 100644
--- a/demos/ARMCM3-STM32F100-DISCOVERY/main.c
+++ b/demos/ARMCM3-STM32F100-DISCOVERY/main.c
@@ -63,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},
@@ -71,8 +73,6 @@ 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
};
@@ -115,7 +115,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.*/