Skip to content

Commit 28d9654

Browse files
committed
bricks: PB_LIB_BTSTACK as string variable
The PB_LIB_BTSTACK library has to be compiled with different sources if it is being used to drive a classic module vs. a dual or LE module. Per PR feedback, adjust the PB_LIB_BTSTACK variable to signal which state we are in, rather than using separate PB_LIB_BTSTACK and PB_LIB_BTSTACK_CLASSIC variables.
1 parent 5360a0d commit 28d9654

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

bricks/_common/arm_none_eabi.mk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ $(error failed)
5252
endif
5353
endif
5454
endif
55-
ifeq ($(or $(PB_LIB_BTSTACK),$(PB_LIB_BTSTACK_CLASSIC)),1)
55+
ifneq ($(strip $(PB_LIB_BTSTACK)),)
5656
ifeq ("$(wildcard $(PBTOP)/lib/btstack/README.md)","")
5757
$(info GIT cloning btstack submodule)
5858
$(info $(shell cd $(PBTOP) && git submodule update --checkout --init lib/btstack))
@@ -124,7 +124,7 @@ endif
124124
ifeq ($(PB_LIB_BLE5STACK),1)
125125
INC += -I$(PBTOP)/lib/ble5stack/central
126126
endif
127-
ifeq ($(or $(PB_LIB_BTSTACK),$(PB_LIB_BTSTACK_CLASSIC)),1)
127+
ifneq ($(strip $(PB_LIB_BTSTACK)),)
128128
INC += -I$(PBTOP)/lib/btstack/chipset/cc256x
129129
INC += -I$(PBTOP)/lib/btstack/src
130130
endif
@@ -509,11 +509,11 @@ ifeq ($(PB_LIB_BLE5STACK),1)
509509
OBJ += $(addprefix $(BUILD)/, $(BLE5STACK_SRC_C:.c=.o))
510510
endif
511511

512-
ifeq ($(PB_LIB_BTSTACK_CLASSIC),1)
512+
ifeq ($(PB_LIB_BTSTACK),classic)
513513
OBJ += $(addprefix $(BUILD)/, $(BTSTACK_SRC_C:.c=.o))
514514
endif
515515

516-
ifeq ($(PB_LIB_BTSTACK),1)
516+
ifeq ($(PB_LIB_BTSTACK),lowenergy)
517517
OBJ += $(addprefix $(BUILD)/, $(BTSTACK_SRC_C:.c=.o))
518518
OBJ += $(addprefix $(BUILD)/, $(BTSTACK_BLE_SRC_C:.c=.o))
519519
endif
@@ -571,9 +571,9 @@ TARGETS := $(BUILD)/firmware.zip
571571

572572
all: $(TARGETS)
573573

574-
# handle BTStack .gatt files
574+
# handle BTStack .gatt files (only for BLE / lowenergy)
575575

576-
ifeq ($(PB_LIB_BTSTACK),1)
576+
ifeq ($(PB_LIB_BTSTACK),lowenergy)
577577

578578
GATT_FILES := $(addprefix lib/pbio/drv/bluetooth/,\
579579
pybricks_service.gatt \

bricks/essentialhub/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PB_MCU_EXT_OSC_HZ = 16000000
99
PB_LIB_STM32_HAL = 1
1010
PB_LIB_LSM6DS3TR_C = 1
1111
PB_LIB_BLUENRG = 0
12-
PB_LIB_BTSTACK = 1
12+
PB_LIB_BTSTACK = lowenergy
1313
PB_LIB_STM32_USB_DEVICE = 1
1414
TEXT0_ADDR = 0x8008000
1515
DFU_VID = 0x0694

bricks/ev3/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ PBIO_PLATFORM = ev3
22
PB_MCU_FAMILY = TIAM1808
33

44
PB_LIB_UMM_MALLOC = 1
5-
PB_LIB_BTSTACK_CLASSIC = 1
5+
PB_LIB_BTSTACK = classic
66

77
include ../_common/arm_none_eabi.mk

bricks/primehub/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PB_MCU_EXT_OSC_HZ = 16000000
99
PB_LIB_STM32_HAL = 1
1010
PB_LIB_LSM6DS3TR_C = 1
1111
PB_LIB_BLUENRG = 0
12-
PB_LIB_BTSTACK = 1
12+
PB_LIB_BTSTACK = lowenergy
1313
PB_LIB_STM32_USB_DEVICE = 1
1414
TEXT0_ADDR = 0x8008000
1515
DFU_VID = 0x0694

0 commit comments

Comments
 (0)