aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32F37x/ADC/main.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-03-18 10:47:25 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-03-18 10:47:25 +0000
commitf24f61dc0ee1dd8a4b538bdcbfaac870aa39816a (patch)
tree2f5c41385323a9c10ee668f58f4caeb28ecb91f4 /testhal/STM32F37x/ADC/main.c
parentde8293ab3cdfd42fa4ac7f0deb7955bc8263202d (diff)
downloadChibiOS-f24f61dc0ee1dd8a4b538bdcbfaac870aa39816a.tar.gz
ChibiOS-f24f61dc0ee1dd8a4b538bdcbfaac870aa39816a.tar.bz2
ChibiOS-f24f61dc0ee1dd8a4b538bdcbfaac870aa39816a.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5450 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F37x/ADC/main.c')
-rw-r--r--testhal/STM32F37x/ADC/main.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/testhal/STM32F37x/ADC/main.c b/testhal/STM32F37x/ADC/main.c
index 528aa8cd1..fce807084 100644
--- a/testhal/STM32F37x/ADC/main.c
+++ b/testhal/STM32F37x/ADC/main.c
@@ -61,21 +61,22 @@ static const ADCConversionGroup adcgrpcfg1 = {
ADC_GRP1_NUM_CHANNELS,
NULL,
adcerrorcallback,
- 0, /* CFGR */
- ADC_TR(0, 4095), /* TR1 */
- 0, /* CCR */
- { /* SMPR[2] */
- 0,
- 0
- },
- { /* SQR[4] */
- ADC_SQR1_SQ1_N(ADC_CHANNEL_IN7) | ADC_SQR1_SQ2_N(ADC_CHANNEL_IN8),
- 0,
- 0,
- 0
+ .u.adc = {
+ 0, /* CR1 */
+ 0, /* CR2 */
+ { /* SMPR[2] */
+ 0,
+ 0
+ },
+ { /* SQR[3] */
+ 0,
+ 0,
+ 0
+ }
}
};
+#if 0
/*
* ADC conversion group.
* Mode: Continuous, 16 samples of 8 channels, SW triggered.
@@ -104,6 +105,7 @@ static const ADCConversionGroup adcgrpcfg2 = {
0
}
};
+#endif
/*
* Red LEDs blinker thread, times are in milliseconds.
@@ -114,9 +116,9 @@ static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker");
while (TRUE) {
- palSetPad(GPIOE, GPIOE_LED10_RED);
+ palClearPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
- palClearPad(GPIOE, GPIOE_LED10_RED);
+ palSetPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
}
return 0;
@@ -162,14 +164,14 @@ int main(void) {
/*
* Starts an ADC continuous conversion.
*/
- adcStartConversion(&ADCD1, &adcgrpcfg2, samples2, ADC_GRP2_BUF_DEPTH);
+// adcStartConversion(&ADCD1, &adcgrpcfg2, samples2, ADC_GRP2_BUF_DEPTH);
/*
* Normal main() thread activity, in this demo it does nothing.
*/
while (TRUE) {
- if (palReadPad(GPIOA, GPIOA_BUTTON)) {
- adcStopConversion(&ADCD1);
+ if (palReadPad(GPIOA, GPIOA_WKUP_BUTTON)) {
+// adcStopConversion(&ADCD1);
}
chThdSleepMilliseconds(500);
}