summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-04-24 21:32:02 -0700
committerKeith Packard <keithp@keithp.com>2017-04-24 22:01:38 -0700
commite0be779ac401f063b968aaac9460c972a728d309 (patch)
tree9beae35b8d3a81da3ecab8cac917d9896d5abacc /src
parent202d556241d56ec4a27f202575d6945dc09f9e03 (diff)
altos/stmf0: Not all timer configurations use AF2
Allow applications to select other configurations. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/stmf0/ao_beep_stm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/stmf0/ao_beep_stm.c b/src/stmf0/ao_beep_stm.c
index 610f4a31..15137230 100644
--- a/src/stmf0/ao_beep_stm.c
+++ b/src/stmf0/ao_beep_stm.c
@@ -25,6 +25,10 @@
#define BEEPER_TIMER 1
#endif
+#ifndef BEEPER_AFR
+#define BEEPER_AFR STM_AFR_AF2
+#endif
+
#if BEEPER_TIMER == 1
#define timer stm_tim1
#define STM_RCC_TIMER STM_RCC_APB2ENR_TIM1EN
@@ -366,7 +370,7 @@ ao_beep(uint8_t beep)
timer.egr = (1 << STM_TIM23_EGR_UG);
/* Hook the timer up to the beeper pin */
- stm_afr_set(BEEPER_PORT, BEEPER_PIN, STM_AFR_AF2);
+ stm_afr_set(BEEPER_PORT, BEEPER_PIN, BEEPER_AFR);
#endif
}
}