aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-01-20 19:07:07 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-01-20 19:07:07 +0000
commit1664a6573e8b8c6caf4104c1e4e298a34e8c8271 (patch)
treeaa91cc5d71733a9c25680ff3dc131c8efdb73ba9 /testhal/STM32
parentc904e6588a049d5e00aaf084a24037786a5182d6 (diff)
downloadChibiOS-1664a6573e8b8c6caf4104c1e4e298a34e8c8271.tar.gz
ChibiOS-1664a6573e8b8c6caf4104c1e4e298a34e8c8271.tar.bz2
ChibiOS-1664a6573e8b8c6caf4104c1e4e298a34e8c8271.zip
Fixed bug 3160306.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2663 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32')
-rw-r--r--testhal/STM32/ADC/main.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/testhal/STM32/ADC/main.c b/testhal/STM32/ADC/main.c
index c0ce8c664..6e765476b 100644
--- a/testhal/STM32/ADC/main.c
+++ b/testhal/STM32/ADC/main.c
@@ -23,11 +23,6 @@
#define ADC_GRP1_NUM_CHANNELS 8
#define ADC_GRP1_BUF_DEPTH 16
-/*
- * ADC configuration, empty for STM32, nothing to configure.
- */
-static const ADCConfig adccfg = {};
-
static adcsample_t samples[ADC_GRP1_NUM_CHANNELS * ADC_GRP1_BUF_DEPTH];
/*
@@ -47,7 +42,7 @@ static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
/*
* ADC conversion group.
- * Mode: Streaming, continuous, 16 samples of 8 channels, SW triggered.
+ * Mode: Streaming, continuous, 16 samples of 8 channels, SW triggered.
* Channels: IN10, IN11, IN10, IN11, IN10, IN11, Sensor, VRef.
*/
static const ADCConversionGroup adcgrpcfg = {
@@ -59,10 +54,10 @@ static const ADCConversionGroup adcgrpcfg = {
0,
0,
ADC_SQR1_NUM_CH(ADC_GRP1_NUM_CHANNELS),
- ADC_SQR2_SQ7_N(ADC_CHANNEL_SENSOR) | ADC_SQR2_SQ6_N(ADC_CHANNEL_VREFINT),
- ADC_SQR3_SQ5_N(ADC_CHANNEL_IN11) | ADC_SQR3_SQ4_N(ADC_CHANNEL_IN10) |
- ADC_SQR3_SQ3_N(ADC_CHANNEL_IN11) | ADC_SQR3_SQ2_N(ADC_CHANNEL_IN10) |
- ADC_SQR3_SQ1_N(ADC_CHANNEL_IN11) | ADC_SQR3_SQ0_N(ADC_CHANNEL_IN10)
+ ADC_SQR2_SQ8_N(ADC_CHANNEL_SENSOR) | ADC_SQR2_SQ7_N(ADC_CHANNEL_VREFINT),
+ ADC_SQR3_SQ6_N(ADC_CHANNEL_IN11) | ADC_SQR3_SQ5_N(ADC_CHANNEL_IN10) |
+ ADC_SQR3_SQ4_N(ADC_CHANNEL_IN11) | ADC_SQR3_SQ3_N(ADC_CHANNEL_IN10) |
+ ADC_SQR3_SQ2_N(ADC_CHANNEL_IN11) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN10)
};
/*
@@ -97,7 +92,7 @@ int main(void) {
chSysInit();
/*
- * Setting up analog inputs used by the demo.
+ * Setting up analog inputs used by the demo.
*/
palSetGroupMode(GPIOC, PAL_PORT_BIT(0) | PAL_PORT_BIT(1),
PAL_MODE_INPUT_ANALOG);
@@ -110,7 +105,7 @@ int main(void) {
/*
* Starts an ADC continuous conversion.
*/
- adcStart(&ADCD1, &adccfg);
+ adcStart(&ADCD1, NULL);
adcStartConversion(&ADCD1, &adcgrpcfg, samples, ADC_GRP1_BUF_DEPTH);
/*