aboutsummaryrefslogtreecommitdiffstats
path: root/wirish
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-06-03 21:00:14 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-06-03 22:44:43 -0400
commitb52f574dd6ec75157aebc48f1504832c0dd1c281 (patch)
tree0880c917ae222ded920b8c392b54b86fb3b0d7d3 /wirish
parenteaf34012efe105c5c7e9654c5cc0e988e4bbd719 (diff)
downloadlibrambutan-b52f574dd6ec75157aebc48f1504832c0dd1c281.tar.gz
librambutan-b52f574dd6ec75157aebc48f1504832c0dd1c281.zip
STM32F2: Add SYSCFG support.
Turn it on at init() time on F2. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'wirish')
-rw-r--r--wirish/boards.cpp10
-rw-r--r--wirish/boards_private.h1
-rw-r--r--wirish/stm32f2/boards_setup.cpp6
3 files changed, 16 insertions, 1 deletions
diff --git a/wirish/boards.cpp b/wirish/boards.cpp
index 7616245..471325f 100644
--- a/wirish/boards.cpp
+++ b/wirish/boards.cpp
@@ -71,10 +71,18 @@ void init(void) {
setup_adcs();
setup_timers();
wirish::priv::board_setup_usb();
+ wirish::priv::series_init();
boardInit();
}
-/* Provide a default boardInit(). */
+/* Provide a default no-op series_init() */
+namespace wirish {
+ namespace priv {
+ __weak void series_init(void) {}
+ }
+}
+
+/* Provide a default no-op boardInit(). */
__weak void boardInit(void) {
}
diff --git a/wirish/boards_private.h b/wirish/boards_private.h
index cdac844..4607913 100644
--- a/wirish/boards_private.h
+++ b/wirish/boards_private.h
@@ -59,6 +59,7 @@ namespace wirish {
void board_setup_clock_prescalers(void);
void board_setup_gpio(void);
void board_setup_usb(void);
+ void series_init(void);
}
}
diff --git a/wirish/stm32f2/boards_setup.cpp b/wirish/stm32f2/boards_setup.cpp
index 9832bb7..d1ceac0 100644
--- a/wirish/stm32f2/boards_setup.cpp
+++ b/wirish/stm32f2/boards_setup.cpp
@@ -37,6 +37,7 @@
#include "boards_private.h"
#include <libmaple/gpio.h>
+#include <libmaple/syscfg.h>
#include <wirish/wirish_types.h>
// PLL configuration for 25 MHz external oscillator --> 120 MHz SYSCLK.
@@ -85,5 +86,10 @@ namespace wirish {
// Nothing to do.
}
+ void series_init(void) {
+ // We need SYSCFG for external interrupts
+ syscfg_init();
+ }
+
}
}