From ddbd0937ac45371dacaf1c31d96df75c063dc301 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 27 Aug 2020 15:28:21 +0200 Subject: Makefile: Auto-select sharp96 pins based on arch --- Makefile | 21 +++++++++++++++------ 1 file 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} -- cgit v1.2.3