aboutsummaryrefslogtreecommitdiff
path: root/src/platforms/stm32
diff options
context:
space:
mode:
Diffstat (limited to 'src/platforms/stm32')
-rw-r--r--src/platforms/stm32/cdcacm.c2
-rw-r--r--src/platforms/stm32/dfu_f1.c5
-rw-r--r--src/platforms/stm32/dfu_f4.c6
-rw-r--r--src/platforms/stm32/dfucore.c2
-rw-r--r--src/platforms/stm32/gdb_if.c2
-rw-r--r--src/platforms/stm32/gpio.h10
-rw-r--r--src/platforms/stm32/jtagtap.c2
-rw-r--r--src/platforms/stm32/traceswo.c5
-rw-r--r--src/platforms/stm32/usbuart.c2
9 files changed, 19 insertions, 17 deletions
diff --git a/src/platforms/stm32/cdcacm.c b/src/platforms/stm32/cdcacm.c
index 074b534..577925a 100644
--- a/src/platforms/stm32/cdcacm.c
+++ b/src/platforms/stm32/cdcacm.c
@@ -33,7 +33,7 @@
#include <libopencm3/usb/dfu.h>
#include <stdlib.h>
-#include "platform.h"
+#include "general.h"
#include "gdb_if.h"
#include "cdcacm.h"
#if defined(PLATFORM_HAS_TRACESWO)
diff --git a/src/platforms/stm32/dfu_f1.c b/src/platforms/stm32/dfu_f1.c
index bb1e274..abbdbe6 100644
--- a/src/platforms/stm32/dfu_f1.c
+++ b/src/platforms/stm32/dfu_f1.c
@@ -16,12 +16,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
-#include "platform.h"
+#include "general.h"
+#include "usbdfu.h"
#include <libopencm3/stm32/f1/flash.h>
#include <libopencm3/cm3/scb.h>
-#include "usbdfu.h"
#define FLASH_OBP_RDP 0x1FFFF800
#define FLASH_OBP_WRP10 0x1FFFF808
diff --git a/src/platforms/stm32/dfu_f4.c b/src/platforms/stm32/dfu_f4.c
index 1065938..2ececa0 100644
--- a/src/platforms/stm32/dfu_f4.c
+++ b/src/platforms/stm32/dfu_f4.c
@@ -16,8 +16,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
-#include "platform.h"
+#include "general.h"
+#include "usbdfu.h"
#if defined(STM32F2)
# include <libopencm3/stm32/f2/flash.h>
@@ -26,8 +26,6 @@
#endif
#include <libopencm3/cm3/scb.h>
-#include "usbdfu.h"
-
static uint32_t sector_addr[] = {
0x8000000, 0x8004000, 0x8008000, 0x800c000,
0x8010000, 0x8020000, 0x8040000, 0x8060000,
diff --git a/src/platforms/stm32/dfucore.c b/src/platforms/stm32/dfucore.c
index 77cef4e..7b733d7 100644
--- a/src/platforms/stm32/dfucore.c
+++ b/src/platforms/stm32/dfucore.c
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "platform.h"
+#include "general.h"
#include <string.h>
#if defined(STM32F1)
diff --git a/src/platforms/stm32/gdb_if.c b/src/platforms/stm32/gdb_if.c
index 6cc9084..286c66b 100644
--- a/src/platforms/stm32/gdb_if.c
+++ b/src/platforms/stm32/gdb_if.c
@@ -22,7 +22,7 @@
* Serial Debugging protocol is implemented. This implementation for STM32
* uses the USB CDC-ACM device bulk endpoints to implement the channel.
*/
-#include "platform.h"
+#include "general.h"
#include "cdcacm.h"
#include "gdb_if.h"
diff --git a/src/platforms/stm32/gpio.h b/src/platforms/stm32/gpio.h
index 035f3c9..ee8275e 100644
--- a/src/platforms/stm32/gpio.h
+++ b/src/platforms/stm32/gpio.h
@@ -20,6 +20,16 @@
#ifndef __GPIO_H
#define __GPIO_H
+#include <libopencm3/cm3/common.h>
+
+#ifndef STM32F4
+# include <libopencm3/stm32/f1/memorymap.h>
+# include <libopencm3/stm32/f1/gpio.h>
+#else
+# include <libopencm3/stm32/f4/memorymap.h>
+# include <libopencm3/stm32/f4/gpio.h>
+#endif
+
#define INLINE_GPIO
#define gpio_set_val(port, pin, val) do { \
diff --git a/src/platforms/stm32/jtagtap.c b/src/platforms/stm32/jtagtap.c
index 2d09b84..3c45a81 100644
--- a/src/platforms/stm32/jtagtap.c
+++ b/src/platforms/stm32/jtagtap.c
@@ -23,9 +23,7 @@
#include <stdio.h>
#include "general.h"
-
#include "jtagtap.h"
-#include "platform.h"
int jtagtap_init(void)
{
diff --git a/src/platforms/stm32/traceswo.c b/src/platforms/stm32/traceswo.c
index 29bae8f..a2e704d 100644
--- a/src/platforms/stm32/traceswo.c
+++ b/src/platforms/stm32/traceswo.c
@@ -32,15 +32,12 @@
* The core can then process the buffer to extract the frame.
*/
#include "general.h"
+#include "cdcacm.h"
#include <libopencm3/cm3/nvic.h>
#include <libopencm3/stm32/timer.h>
#include <libopencm3/stm32/f1/rcc.h>
-#include <string.h>
-#include "platform.h"
-#include "cdcacm.h"
-
void traceswo_init(void)
{
TRACE_TIM_CLK_EN();
diff --git a/src/platforms/stm32/usbuart.c b/src/platforms/stm32/usbuart.c
index 970a609..cce2904 100644
--- a/src/platforms/stm32/usbuart.c
+++ b/src/platforms/stm32/usbuart.c
@@ -27,7 +27,7 @@
#include <libopencm3/usb/usbd.h>
#include <libopencm3/usb/cdc.h>
-#include "platform.h"
+#include "general.h"
#include "cdcacm.h"
#define USBUART_TIMER_FREQ_HZ 1000000U /* 1us per tick */