summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-08-27 15:28:21 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-08-27 15:29:28 +0200
commitddbd0937ac45371dacaf1c31d96df75c063dc301 (patch)
tree51294030db469f4ab8971f2910b390b08603a374
parent774aa577b04b3db0db53bbdfd25d1349752f2c50 (diff)
Makefile: Auto-select sharp96 pins based on arch
-rw-r--r--Makefile21
1 files changed, 15 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 98779b1..bcbff7b 100644
--- a/Makefile
+++ b/Makefile
@@ -123,12 +123,21 @@ endif
ifneq ($(findstring sharp96,${drivers}), )
CXX_TARGETS += src/driver/sharp96.cc
- sharp96_power_pin ?= p4_2
- sharp96_en_pin ?= p4_3
- sharp96_cs_pin ?= p2_4
- sharp96_power_pin ?= p1_2
- sharp96_en_pin ?= p6_2
- sharp96_cs_pin ?= p1_3
+ ifeq (${arch}, msp430fr5969lp)
+ sharp96_power_pin ?= p4_2
+ sharp96_en_pin ?= p4_3
+ sharp96_cs_pin ?= p2_4
+ endif
+ ifeq (${arch}, msp430fr5994lp)
+ sharp96_power_pin ?= p1_2
+ sharp96_en_pin ?= p6_2
+ sharp96_cs_pin ?= p1_3
+ endif
+ ifeq (${arch}, msp430fr5994lp-256k)
+ sharp96_power_pin ?= p1_2
+ sharp96_en_pin ?= p6_2
+ sharp96_cs_pin ?= p1_3
+ endif
COMMON_FLAGS += -DDRIVER_SHARP6
COMMON_FLAGS += -DSHARP96_POWER_PIN=GPIO::${sharp96_power_pin}
COMMON_FLAGS += -DSHARP96_EN_PIN=GPIO::${sharp96_en_pin}