From 76700510e08007fcbb461c22e71649bfa2bf95de Mon Sep 17 00:00:00 2001 From: Fergus Noble Date: Mon, 12 Sep 2011 20:48:41 -0700 Subject: [PATCH] Ability to choose memorymap for stm_common headers with define. --- include/libopencm3/stm32_common/can.h | 2 +- include/libopencm3/stm32_common/crc.h | 2 +- include/libopencm3/stm32_common/dbgmcu.h | 2 +- include/libopencm3/stm32_common/exti.h | 2 +- include/libopencm3/stm32_common/fsmc.h | 2 +- include/libopencm3/stm32_common/iwdg.h | 2 +- include/libopencm3/stm32_common/memorymap.h | 35 +++++++++++++++++++++ include/libopencm3/stm32_common/wwdg.h | 2 +- 8 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 include/libopencm3/stm32_common/memorymap.h diff --git a/include/libopencm3/stm32_common/can.h b/include/libopencm3/stm32_common/can.h index 1aa95a17..eeac5d80 100644 --- a/include/libopencm3/stm32_common/can.h +++ b/include/libopencm3/stm32_common/can.h @@ -20,7 +20,7 @@ #ifndef LIBOPENCM3_CAN_H #define LIBOPENCM3_CAN_H -#include +#include #include /* --- Convenience macros -------------------------------------------------- */ diff --git a/include/libopencm3/stm32_common/crc.h b/include/libopencm3/stm32_common/crc.h index 5ad866e6..a5bc35a5 100644 --- a/include/libopencm3/stm32_common/crc.h +++ b/include/libopencm3/stm32_common/crc.h @@ -20,7 +20,7 @@ #ifndef LIBOPENCM3_CRC_H #define LIBOPENCM3_CRC_H -#include +#include #include /* --- CRC registers ------------------------------------------------------- */ diff --git a/include/libopencm3/stm32_common/dbgmcu.h b/include/libopencm3/stm32_common/dbgmcu.h index e753f5ed..e6771a26 100644 --- a/include/libopencm3/stm32_common/dbgmcu.h +++ b/include/libopencm3/stm32_common/dbgmcu.h @@ -20,7 +20,7 @@ #ifndef LIBOPENCM3_STM32_DBGMCU_H #define LIBOPENCM3_STM32_DBGMCU_H -#include +#include #include /* --- DBGMCU registers ---------------------------------------------------- */ diff --git a/include/libopencm3/stm32_common/exti.h b/include/libopencm3/stm32_common/exti.h index 19ab5472..caecee5d 100644 --- a/include/libopencm3/stm32_common/exti.h +++ b/include/libopencm3/stm32_common/exti.h @@ -20,7 +20,7 @@ #ifndef LIBOPENCM3_EXTI_H #define LIBOPENCM3_EXTI_H -#include +#include #include /* --- EXTI registers ------------------------------------------------------ */ diff --git a/include/libopencm3/stm32_common/fsmc.h b/include/libopencm3/stm32_common/fsmc.h index 1d318e31..5ccd1d1f 100644 --- a/include/libopencm3/stm32_common/fsmc.h +++ b/include/libopencm3/stm32_common/fsmc.h @@ -20,7 +20,7 @@ #ifndef LIBOPENCM3_FSMC_H #define LIBOPENCM3_FSMC_H -#include +#include #include /* --- Convenience macros -------------------------------------------------- */ diff --git a/include/libopencm3/stm32_common/iwdg.h b/include/libopencm3/stm32_common/iwdg.h index bf2784ab..67f29610 100644 --- a/include/libopencm3/stm32_common/iwdg.h +++ b/include/libopencm3/stm32_common/iwdg.h @@ -20,7 +20,7 @@ #ifndef LIBOPENCM3_IWDG_H #define LIBOPENCM3_IWDG_H -#include +#include #include /* --- IWDG registers ------------------------------------------------------ */ diff --git a/include/libopencm3/stm32_common/memorymap.h b/include/libopencm3/stm32_common/memorymap.h new file mode 100644 index 00000000..0d0c60fb --- /dev/null +++ b/include/libopencm3/stm32_common/memorymap.h @@ -0,0 +1,35 @@ +/* + * This file is part of the libopencm3 project. + * + * Copyright (C) 2011 Fergus Noble + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef LIBOPENCM3_MEMORYMAP_COMMON_H +#define LIBOPENCM3_MEMORYMAP_COMMON_H + +#include + +#ifdef STM32F1 +#include +#else +#ifdef STM32F1 +#include +#else +#error "stm32 family not defined." +#endif +#endif + +#endif diff --git a/include/libopencm3/stm32_common/wwdg.h b/include/libopencm3/stm32_common/wwdg.h index 552d02ed..e1787c86 100644 --- a/include/libopencm3/stm32_common/wwdg.h +++ b/include/libopencm3/stm32_common/wwdg.h @@ -20,7 +20,7 @@ #ifndef LIBOPENCM3_WWDG_H #define LIBOPENCM3_WWDG_H -#include +#include #include /* --- WWDG registers ------------------------------------------------------ */