add CIRCUITPY_USB_IDENTIFICATION to turn off on smallest builds

This commit is contained in:
Dan Halbert 2022-09-20 14:32:38 -04:00
parent adf15faa8f
commit c567b43441
3 changed files with 7 additions and 5 deletions

View File

@ -51,12 +51,11 @@ CIRCUITPY_ULAB = 0
CIRCUITPY_VECTORIO = 0
CIRCUITPY_ZLIB = 0
# TODO: In CircuitPython 8.0, turn this back on, after `busio.OneWire` is removed.
# We'd like a smoother transition, but we can't afford the space to have both
# `busio.OneWire` and `onewireio.OneWire` present on these tiny builds.
# Turn off a few more things that don't fit in 192kB
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
CIRCUITPY_ONEWIREIO ?= 0
CIRCUITPY_USB_IDENTIFICATION ?= 0
endif
MICROPY_PY_ASYNC_AWAIT = 0

View File

@ -447,6 +447,9 @@ CFLAGS += -DCIRCUITPY_USB_HID_ENABLED_DEFAULT=$(CIRCUITPY_USB_HID_ENABLED_DEFAUL
CIRCUITPY_USB_HOST ?= 0
CFLAGS += -DCIRCUITPY_USB_HOST=$(CIRCUITPY_USB_HOST)
CIRCUITPY_USB_IDENTIFICATION ?= $(CIRCUITPY_USB)
CFLAGS += -DCIRCUITPY_USB_IDENTIFICATION=$(CIRCUITPY_USB_IDENTIFICATION)
# MIDI is available by default, but is not turned on if there are fewer than 8 endpoints.
CIRCUITPY_USB_MIDI ?= $(CIRCUITPY_USB)
CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI)

View File

@ -39,7 +39,7 @@
#include "supervisor/shared/translate/translate.h"
#include "supervisor/shared/workflow.h"
#if CIRCUITPY_USB
#if CIRCUITPY_USB_IDENTIFICATION
#include "supervisor/usb.h"
#endif
@ -315,7 +315,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(supervisor_reset_terminal_obj, supervisor_reset_termin
//| ...
//|
STATIC mp_obj_t supervisor_set_usb_identification(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
#if CIRCUITPY_USB
#if CIRCUITPY_USB_IDENTIFICATION
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_manufacturer, MP_ARG_OBJ, {.u_rom_obj = mp_const_none} },
{ MP_QSTR_product, MP_ARG_OBJ, {.u_rom_obj = mp_const_none} },