aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Daede2012-10-28 02:50:46 -0500
committerThomas Daede2012-10-28 02:50:46 -0500
commit1bb0e9b9709f4cea76be12f4990c7ee1db47a6e1 (patch)
treee25724890a049e980d84719c2536aac637d947dd
parente55a9e387560924a157d60b29a3aa49300b9b456 (diff)
Add CAN support for F2 and F4 series.
All stm32 series currently released share the same bxCAN hardware, so share can.c among all the families.
-rw-r--r--lib/stm32/can.c (renamed from lib/stm32/f1/can.c)11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/stm32/f1/can.c b/lib/stm32/can.c
index fc7e0e7..0e61eca 100644
--- a/lib/stm32/f1/can.c
+++ b/lib/stm32/can.c
@@ -18,7 +18,16 @@
*/
#include <libopencm3/stm32/can.h>
-#include <libopencm3/stm32/f1/rcc.h>
+
+#if defined(STM32F1)
+# include <libopencm3/stm32/f1/rcc.h>
+#elif defined(STM32F2)
+# include <libopencm3/stm32/f2/rcc.h>
+#elif defined(STM32F4)
+# include <libopencm3/stm32/f4/rcc.h>
+#else
+# error "stm32 family not defined."
+#endif
void can_reset(u32 canport)
{