diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-21 19:10:46 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-21 19:10:46 +0000 |
commit | 2018975c3ebca410dd2f8b9a35fe510f4996fa77 (patch) | |
tree | cf9903d6a6613bff75531ccdf57043d455c5e39c /demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c | |
parent | a15011815ccc25e75f553edbf90a4687310e3bf8 (diff) | |
download | ChibiOS-2018975c3ebca410dd2f8b9a35fe510f4996fa77.tar.gz ChibiOS-2018975c3ebca410dd2f8b9a35fe510f4996fa77.tar.bz2 ChibiOS-2018975c3ebca410dd2f8b9a35fe510f4996fa77.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2415 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c')
-rw-r--r-- | demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c b/demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c index 0dbcc8354..c413e7986 100644 --- a/demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c +++ b/demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c @@ -46,7 +46,7 @@ static const ADCConversionGroup adcgrpcfg = { ADC_GRP1_NUM_CHANNELS,
adccb,
0,
- ADC_CR2_EXTSEL_SWSTART | ADC_CR2_TSVREFE,
+ ADC_CR2_EXTSEL_SWSTART | ADC_CR2_TSVREFE | ADC_CR2_CONT,
0,
0,
ADC_SQR1_NUM_CH(ADC_GRP1_NUM_CHANNELS),
@@ -181,8 +181,10 @@ int main(int argc, char **argv) { /*
* Initializes the ADC driver 1.
+ * The pin PC0 on the port GPIOC is programmed as analog input.
*/
adcStart(&ADCD1, &adccfg);
+ palSetGroupMode(GPIOC, PAL_PORT_BIT(0), PAL_MODE_INPUT_ANALOG);
/*
* Initializes the PWM driver 1, re-routes the TIM3 outputs, programs the
@@ -206,7 +208,7 @@ int main(int argc, char **argv) { * sleeping in a loop and check the button state.
*/
while (TRUE) {
- if (palReadPad(IOPORT1, GPIOA_BUTTON))
+ if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
chThdSleepMilliseconds(500);
}
|