aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-05-03 15:19:13 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-05-03 15:19:13 -0400
commitb600996c6a075ea7f7dca4f952a302d73329c94a (patch)
tree7d44678dfa6bc34ab20c2d5bc8bf81642d98b970
parent1f67ed8f23048c45b0a3deec232b19047966bce7 (diff)
downloadlibrambutan-b600996c6a075ea7f7dca4f952a302d73329c94a.tar.gz
librambutan-b600996c6a075ea7f7dca4f952a302d73329c94a.zip
STM32F1: adc: Tweaks for XL-density MCUs.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--libmaple/stm32f1/adc.c4
-rw-r--r--libmaple/stm32f1/include/series/adc.h4
2 files changed, 3 insertions, 5 deletions
diff --git a/libmaple/stm32f1/adc.c b/libmaple/stm32f1/adc.c
index 8242520..bb6f8ca 100644
--- a/libmaple/stm32f1/adc.c
+++ b/libmaple/stm32f1/adc.c
@@ -51,7 +51,7 @@ static adc_dev adc2 = {
/** ADC2 device. */
const adc_dev *ADC2 = &adc2;
-#ifdef STM32_HIGH_DENSITY
+#if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY)
adc_dev adc3 = {
.regs = ADC3_BASE,
.clk_id = RCC_ADC3
@@ -92,7 +92,7 @@ void adc_set_prescaler(adc_prescaler pre) {
void adc_foreach(void (*fn)(const adc_dev*)) {
fn(ADC1);
fn(ADC2);
-#ifdef STM32_HIGH_DENSITY
+#if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY)
fn(ADC3);
#endif
}
diff --git a/libmaple/stm32f1/include/series/adc.h b/libmaple/stm32f1/include/series/adc.h
index 1798e55..45a5e9d 100644
--- a/libmaple/stm32f1/include/series/adc.h
+++ b/libmaple/stm32f1/include/series/adc.h
@@ -43,7 +43,7 @@
extern const struct adc_dev *ADC1;
extern const struct adc_dev *ADC2;
-#ifdef STM32_HIGH_DENSITY
+#if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY)
extern const struct adc_dev *ADC3;
#endif
@@ -55,10 +55,8 @@ extern const struct adc_dev *ADC3;
#define ADC1_BASE ((struct adc_reg_map*)0x40012400)
/** ADC2 register map base pointer. */
#define ADC2_BASE ((struct adc_reg_map*)0x40012800)
-#ifdef STM32_HIGH_DENSITY
/** ADC3 register map base pointer. */
#define ADC3_BASE ((struct adc_reg_map*)0x40013C00)
-#endif
/*
* Register bit definitions