Skip to content

enable CIRCUITPY_BLEIO_HCI on non-nRF boards where it will fit #3560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion devices/ble_hci/common-hal/_bleio/Adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include "shared-bindings/_bleio/Address.h"
#include "shared-bindings/_bleio/Characteristic.h"
#include "shared-bindings/_bleio/Service.h"
#include "shared-bindings/nvm/ByteArray.h"
#include "shared-bindings/_bleio/Connection.h"
#include "shared-bindings/_bleio/ScanEntry.h"
#include "shared-bindings/time/__init__.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <stdbool.h>
// for __packed
#include <string.h>
#include <sys/cdefs.h>

#define BT_EATT_PSM 0x27
#define BT_ATT_DEFAULT_LE_MTU 23
Expand Down
7 changes: 6 additions & 1 deletion devices/ble_hci/common-hal/_bleio/hci_include/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_

#include <stdbool.h>
#include <string.h>
// for __packed
#include <sys/cdefs.h>

#include "addr.h"

// ESP32S2 build environment defines this already.
#ifndef BIT
#define BIT(n) (1UL << (n))
#endif

/* Special own address types for LL privacy (used in adv & scan parameters) */
#define BT_HCI_OWN_ADDR_RPA_OR_PUBLIC 0x02
Expand Down
2 changes: 1 addition & 1 deletion mpy-cross/mpy-cross.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ LDFLAGS += -static -static-libgcc -static-libstdc++
endif

# source files
SRC_C = \
SRC_C += \
main.c \
gccollect.c \
supervisor/stub/safe_mode.c \
Expand Down
8 changes: 4 additions & 4 deletions ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ LONGINT_IMPL = MPZ

# Not needed.
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_AUDIOMP3 = 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_RGBMATRIX = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_PS2IO = 0
CIRCUITPY_AUDIOMP3 = 0

CIRCUITPY_RGBMATRIX = 0
CIRCUITPY_ULAB = 0

# Override optimization to keep binary small
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51

# Support _bleio via the on-board ESP32 module.
CIRCUITPY_BLEIO = 1
CIRCUITPY_BLEIO_HCI = 1

QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LONGINT_IMPL = MPZ
# Disable modules that are unusable on this special-purpose board.
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_BLEIO = 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_GAMEPAD = 0
Expand Down
3 changes: 3 additions & 0 deletions ports/atmel-samd/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ ifndef CIRCUITPY_TOUCHIO_USE_NATIVE
CIRCUITPY_TOUCHIO_USE_NATIVE = 1
endif

# No room for HCI _bleio on SAMD21.
CIRCUITPY_BLEIO_HCI = 0

CIRCUITPY_SDCARDIO ?= 0

# Not enough RAM for framebuffers
Expand Down
2 changes: 1 addition & 1 deletion ports/cxd56/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE))

SRC_S = supervisor/cpu.s

SRC_C = \
SRC_C += \
background.c \
fatfs_port.c \
mphalport.c \
Expand Down
1 change: 1 addition & 0 deletions ports/litex/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CIRCUITPY_ANALOGIO = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_BITBANGIO = 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_BOARD = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_COUNTIO = 0
Expand Down
2 changes: 1 addition & 1 deletion ports/mimxrt10xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ SRC_SDK := \

SRC_SDK := $(addprefix sdk/devices/$(CHIP_FAMILY)/, $(SRC_SDK))

SRC_C = \
SRC_C += \
background.c \
boards/$(BOARD)/board.c \
boards/$(BOARD)/flash_config.c \
Expand Down
3 changes: 3 additions & 0 deletions ports/nrf/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ CIRCUITPY_AUDIOCORE ?= 1
CIRCUITPY_AUDIOMIXER ?= 1
CIRCUITPY_AUDIOPWMIO ?= 1

# Native BLEIO is not compatible with HCI _bleio.
CIRCUITPY_BLEIO_HCI = 0

CIRCUITPY_BLEIO ?= 1

# No I2CPeripheral implementation
Expand Down
1 change: 1 addition & 0 deletions ports/stm/boards/thunderpack/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE

CIRCUITPY_NVM = 1
CIRCUITPY_BLEIO_HCI = 0

MCU_SERIES = F4
MCU_VARIANT = STM32F411xE
Expand Down
2 changes: 1 addition & 1 deletion ports/unix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ SRC_MOD += modjni.c
endif

# source files
SRC_C = \
SRC_C += \
main.c \
gccollect.c \
unix_mphal.c \
Expand Down
10 changes: 5 additions & 5 deletions py/circuitpy_mpconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3)
CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO)

# Explicitly enabled for boards that support _bleio.
CIRCUITPY_BLEIO ?= 0
CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO)

# _bleio can be supported on most any board via HCI
CIRCUITPY_BLEIO_HCI ?= 0
CIRCUITPY_BLEIO_HCI ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_BLEIO_HCI=$(CIRCUITPY_BLEIO_HCI)

# Explicitly enabled for boards that support _bleio.
CIRCUITPY_BLEIO ?= $(CIRCUITPY_BLEIO_HCI)
CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO)

CIRCUITPY_BOARD ?= 1
CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD)

Expand Down