summaryrefslogtreecommitdiff
path: root/examples/make.mk
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-09-11 11:35:51 +0700
committerhathach <[email protected]>2023-09-11 11:35:51 +0700
commitab9585401b9964407cbf2bc7bffdf762353817f9 (patch)
treecf1c6a73a24ac2a6142a0ea4503633eaa150a67a /examples/make.mk
parente32c1e08bd701b5dda7d081b10ba3262e2061326 (diff)
wrap up build cmake & make support for max3421, to enable the Host driver, 'MAX3421_HOST=1' must be added as part of make/cmake command
Diffstat (limited to 'examples/make.mk')
-rw-r--r--examples/make.mk13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/make.mk b/examples/make.mk
index a590e34f7..8fe4a3486 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -73,7 +73,6 @@ ifeq ($(FAMILY),)
else
# Include Family and Board specific defs
include $(TOP)/$(FAMILY_PATH)/family.mk
-
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
endif
@@ -84,9 +83,6 @@ CROSS_COMPILE ?= arm-none-eabi-
ifeq ($(TOOLCHAIN),iar)
CC := iccarm
-endif
-
-ifeq ($(CC),iccarm)
USE_IAR = 1
endif
@@ -105,13 +101,12 @@ endif
#-------------- Source files and compiler flags --------------
# tinyusb makefile
include $(TOP)/src/tinyusb.mk
+SRC_C += $(TINYUSB_SRC_C)
# Include all source C in family & board folder
SRC_C += hw/bsp/board.c
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(BOARD_PATH)/*.c))
-SRC_C += $(TINYUSB_SRC_C)
-
INC += \
$(TOP)/$(FAMILY_PATH) \
$(TOP)/src \
@@ -119,6 +114,12 @@ INC += \
BOARD_UPPER = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$(subst -,_,$(BOARD))))))))))))))))))))))))))))
CFLAGS += -DBOARD_$(BOARD_UPPER)
+# use max3421 as host controller
+ifeq (${MAX3421_HOST},1)
+ SRC_C += src/portable/analog/max3421/hcd_max3421.c
+ CFLAGS += -DCFG_TUH_MAX3421=1
+endif
+
# Log level is mapped to TUSB DEBUG option
ifneq ($(LOG),)
CMAKE_DEFSYM += -DLOG=$(LOG)