aboutsummaryrefslogtreecommitdiff
path: root/stm/Makefile
diff options
context:
space:
mode:
authorDave Hylands2014-02-19 22:28:36 -0800
committerDave Hylands2014-02-23 11:26:22 -0800
commitee31f71d39207309b924ac99a7de2d847cb4bbfd (patch)
treea7d5022579bbe988c2dac79c7a99c56557ef8b52 /stm/Makefile
parent790eed6f93dc12df40715ad1062b5ce01badcbd9 (diff)
Add EXTI support
Revamp usrsw to use new exti code. Add user switch callback function.
Diffstat (limited to 'stm/Makefile')
-rw-r--r--stm/Makefile20
1 files changed, 16 insertions, 4 deletions
diff --git a/stm/Makefile b/stm/Makefile
index 991645b6c..0a479afc6 100644
--- a/stm/Makefile
+++ b/stm/Makefile
@@ -67,13 +67,14 @@ SRC_C = \
audio.c \
sdcard.c \
i2c.c \
- usrsw.c \
adc.c \
rtc.c \
file.c \
pin.c \
pin_named_pins.c \
pin_map.c \
+ exti.c \
+ usrsw.c \
# pybwlan.c \
SRC_S = \
@@ -185,10 +186,21 @@ MAKE_PINS = boards/make-pins.py
BOARD_PINS = boards/$(BOARD)/pins.csv
AF_FILE = boards/stm32f4xx-af.csv
PREFIX_FILE = boards/stm32f4xx-prefix.c
-
-$(BUILD)/pins_$(BOARD).c: $(MAKE_PINS) $(BOARD_PINS) $(AF_FILE) $(PREFIX_FILE)
+GEN_PINS_SRC = $(BUILD)/pins_$(BOARD).c
+GEN_PINS_HDR = $(BUILD)/pins.h
+
+# Making OBJ use an order-only depenedency on the generated pins.h file
+# has the side effect of making the pins.h file before we actually compile
+# any of the objects. The normal dependency generation will deal with the
+# case when pins.h is modified. But when it doesn't exist, we don't know
+# which source files might need it.
+$(OBJ): | $(BUILD)/pins.h
+
+# Use a pattern rule here so that make will only call make-pins.py once to make
+# both pins_$(BOARD).c and pins.h
+$(BUILD)/%_$(BOARD).c $(BUILD)/%.h: boards/$(BOARD)/%.csv $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE)
$(ECHO) "Create $@"
- $(Q)python $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) > $@
+ $(Q)python $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) > $(GEN_PINS_SRC)
$(BUILD)/pins_$(BOARD).o: $(BUILD)/pins_$(BOARD).c
$(call compile_c)