aboutsummaryrefslogtreecommitdiffstats
path: root/testhal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-03-24 09:55:13 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-03-24 09:55:13 +0000
commit42ce85ad4c1fcb3e079fa7e0fcbe7bc723a473e0 (patch)
treec16749f973614c1137bd0a6f44f78cf8d3bb271c /testhal
parentb60ed674132d7a837c503e51fbff2850aad04843 (diff)
downloadChibiOS-42ce85ad4c1fcb3e079fa7e0fcbe7bc723a473e0.tar.gz
ChibiOS-42ce85ad4c1fcb3e079fa7e0fcbe7bc723a473e0.tar.bz2
ChibiOS-42ce85ad4c1fcb3e079fa7e0fcbe7bc723a473e0.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5497 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r--testhal/STM32F37x/SDADC/main.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/testhal/STM32F37x/SDADC/main.c b/testhal/STM32F37x/SDADC/main.c
index c1739bed3..90b722183 100644
--- a/testhal/STM32F37x/SDADC/main.c
+++ b/testhal/STM32F37x/SDADC/main.c
@@ -21,7 +21,7 @@
#include "ch.h"
#include "hal.h"
-#define ADC_GRP1_NUM_CHANNELS 2
+#define ADC_GRP1_NUM_CHANNELS 1
#define ADC_GRP1_BUF_DEPTH 8
#define ADC_GRP2_NUM_CHANNELS 8
@@ -140,38 +140,33 @@ int main(void) {
chSysInit();
/*
- * Setting up analog inputs used by the demo.
- */
- palSetGroupMode(GPIOC, PAL_PORT_BIT(1) | PAL_PORT_BIT(2),
- 0, PAL_MODE_INPUT_ANALOG);
-
- /*
* Creates the blinker thread.
*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
/*
- * Activates the ADC1 driver and the temperature sensor.
+ * Activates the SDADC1 driver.
*/
- adcStart(&ADCD1, NULL);
+ adcStart(&SDADCD1, NULL);
+ adcSTM32Calibrate(&SDADCD1);
/*
* Linear conversion.
*/
- adcConvert(&ADCD1, &adcgrpcfg1, samples1, ADC_GRP1_BUF_DEPTH);
+ adcConvert(&SDADCD1, &adcgrpcfg1, samples1, ADC_GRP1_BUF_DEPTH);
chThdSleepMilliseconds(1000);
/*
* Starts an ADC continuous conversion.
*/
-// adcStartConversion(&ADCD1, &adcgrpcfg2, samples2, ADC_GRP2_BUF_DEPTH);
+// adcStartConversion(&SDADC1, &adcgrpcfg2, samples2, ADC_GRP2_BUF_DEPTH);
/*
* Normal main() thread activity, in this demo it does nothing.
*/
while (TRUE) {
if (palReadPad(GPIOA, GPIOA_WKUP_BUTTON)) {
-// adcStopConversion(&ADCD1);
+// adcStopConversion(&SDADCD1);
}
chThdSleepMilliseconds(500);
}