From 695f0dc4baa1bf682eec0226dc5632a9200174f1 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 31 Aug 2010 15:21:09 -0400 Subject: MCU-specific, not BOARD-specific --- Makefile | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1a905e8..862d5b1 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,20 @@ BOARD ?= maple MEMORY_TARGET ?= flash +# USB ID for DFU upload +VENDOR_ID := 1EAF +PRODUCT_ID := 0003 + +# Guess the MCU based on the BOARD (can be overridden ) +ifeq ($(BOARD), maple) + MCU := STM32F103RB + PRODUCT_ID := 0003 +endif +ifeq ($(BOARD), maple-native) + MCU := STM32F103ZE + PRODUCT_ID := 0003 +endif + # Useful paths SRCROOT := $(dir) BUILD_PATH = build @@ -11,8 +25,8 @@ LIBMAPLE_PATH := libmaple # Useful variables GLOBAL_CFLAGS := -Os -g -mcpu=cortex-m3 -mthumb -march=armv7-m -nostdlib \ -ffunction-sections -fdata-sections -Wl,--gc-sections \ - -DBOARD_$(BOARD) -GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall -DBOARD_$(BOARD) + -DBOARD_$(BOARD) -DMCU_$(MCU) +GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall -DBOARD_$(BOARD) -DMCU_$(MCU) LDDIR := support/ld @@ -24,10 +38,6 @@ LDFLAGS = -T$(LDDIR)/$(LDSCRIPT) -L$(LDDIR) \ include support/make/build-rules.mk include support/make/build-templates.mk -# Maple USB id -VENDOR_ID := 1EAF -PRODUCT_ID := 0003 - # Some target specific things ifeq ($(MEMORY_TARGET), ram) VECT_BASE_ADDR := VECT_TAB_RAM -- cgit v1.2.3