2017-09-22 21:05:51 -04:00
|
|
|
SRC_SUPERVISOR = \
|
|
|
|
main.c \
|
|
|
|
supervisor/port.c \
|
|
|
|
supervisor/shared/autoreload.c \
|
2020-05-11 09:37:20 -04:00
|
|
|
supervisor/shared/background_callback.c \
|
2020-01-23 20:03:55 -05:00
|
|
|
supervisor/shared/board.c \
|
2018-10-19 21:46:22 -04:00
|
|
|
supervisor/shared/filesystem.c \
|
|
|
|
supervisor/shared/flash.c \
|
|
|
|
supervisor/shared/micropython.c \
|
2018-07-25 08:06:30 -04:00
|
|
|
supervisor/shared/rgb_led_status.c \
|
2018-12-06 17:24:20 -05:00
|
|
|
supervisor/shared/safe_mode.c \
|
2018-07-31 19:53:54 -04:00
|
|
|
supervisor/shared/stack.c \
|
2018-10-19 21:46:22 -04:00
|
|
|
supervisor/shared/status_leds.c \
|
2019-11-18 09:22:41 -05:00
|
|
|
supervisor/shared/tick.c \
|
2018-07-31 19:53:54 -04:00
|
|
|
supervisor/shared/translate.c
|
2017-09-22 21:05:51 -04:00
|
|
|
|
2018-10-19 21:46:22 -04:00
|
|
|
ifndef $(NO_USB)
|
2019-08-15 15:55:33 -04:00
|
|
|
NO_USB = $(wildcard supervisor/usb.c)
|
2018-10-19 21:46:22 -04:00
|
|
|
endif
|
|
|
|
|
2019-12-05 22:45:53 -05:00
|
|
|
ifndef INTERNAL_FLASH_FILESYSTEM
|
|
|
|
INTERNAL_FLASH_FILESYSTEM = 0
|
2019-02-18 22:44:31 -05:00
|
|
|
endif
|
2019-12-05 22:45:53 -05:00
|
|
|
CFLAGS += -DINTERNAL_FLASH_FILESYSTEM=$(INTERNAL_FLASH_FILESYSTEM)
|
|
|
|
|
|
|
|
ifndef QSPI_FLASH_FILESYSTEM
|
|
|
|
QSPI_FLASH_FILESYSTEM = 0
|
2019-02-18 22:44:31 -05:00
|
|
|
endif
|
2019-12-10 17:57:17 -05:00
|
|
|
CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM)
|
2018-10-19 21:46:22 -04:00
|
|
|
|
2019-12-05 22:45:53 -05:00
|
|
|
ifndef SPI_FLASH_FILESYSTEM
|
|
|
|
SPI_FLASH_FILESYSTEM = 0
|
2019-02-18 22:44:31 -05:00
|
|
|
endif
|
2019-12-10 17:57:17 -05:00
|
|
|
CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM)
|
2019-09-14 15:40:24 -04:00
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_BLEIO),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/bluetooth.c
|
2019-02-18 22:44:31 -05:00
|
|
|
endif
|
2018-10-19 21:46:22 -04:00
|
|
|
|
|
|
|
# Choose which flash filesystem impl to use.
|
2019-12-05 22:45:53 -05:00
|
|
|
# (Right now INTERNAL_FLASH_FILESYSTEM and (Q)SPI_FLASH_FILESYSTEM are mutually exclusive.
|
2018-10-19 21:46:22 -04:00
|
|
|
# But that might not be true in the future.)
|
|
|
|
ifdef EXTERNAL_FLASH_DEVICES
|
|
|
|
CFLAGS += -DEXTERNAL_FLASH_DEVICES=$(EXTERNAL_FLASH_DEVICES) \
|
|
|
|
-DEXTERNAL_FLASH_DEVICE_COUNT=$(EXTERNAL_FLASH_DEVICE_COUNT)
|
|
|
|
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/external_flash/external_flash.c
|
|
|
|
ifeq ($(SPI_FLASH_FILESYSTEM),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/external_flash/spi_flash.c
|
2019-02-18 22:44:31 -05:00
|
|
|
else
|
2018-10-19 21:46:22 -04:00
|
|
|
endif
|
|
|
|
ifeq ($(QSPI_FLASH_FILESYSTEM),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/qspi_flash.c supervisor/shared/external_flash/qspi_flash.c
|
|
|
|
endif
|
2017-09-22 21:05:51 -04:00
|
|
|
else
|
2019-08-18 19:23:52 -04:00
|
|
|
ifeq ($(DISABLE_FILESYSTEM),1)
|
2019-08-15 15:55:33 -04:00
|
|
|
SRC_SUPERVISOR += supervisor/stub/internal_flash.c
|
2019-10-06 21:30:26 -04:00
|
|
|
else
|
2019-08-18 19:23:52 -04:00
|
|
|
SRC_SUPERVISOR += supervisor/internal_flash.c
|
2019-08-15 15:55:33 -04:00
|
|
|
endif
|
2017-09-22 21:05:51 -04:00
|
|
|
endif
|
|
|
|
|
2018-10-19 21:46:22 -04:00
|
|
|
ifeq ($(USB),FALSE)
|
|
|
|
ifeq ($(wildcard supervisor/serial.c),)
|
|
|
|
SRC_SUPERVISOR += supervisor/stub/serial.c
|
|
|
|
else
|
|
|
|
SRC_SUPERVISOR += supervisor/serial.c
|
|
|
|
endif
|
2017-09-22 21:05:51 -04:00
|
|
|
else
|
2019-10-06 21:30:26 -04:00
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
lib/tinyusb/src/common/tusb_fifo.c \
|
|
|
|
lib/tinyusb/src/device/usbd.c \
|
|
|
|
lib/tinyusb/src/device/usbd_control.c \
|
|
|
|
lib/tinyusb/src/class/msc/msc_device.c \
|
|
|
|
lib/tinyusb/src/class/cdc/cdc_device.c \
|
|
|
|
lib/tinyusb/src/tusb.c \
|
|
|
|
supervisor/shared/serial.c \
|
|
|
|
supervisor/usb.c \
|
|
|
|
supervisor/shared/usb/usb_desc.c \
|
|
|
|
supervisor/shared/usb/usb.c \
|
|
|
|
supervisor/shared/usb/usb_msc_flash.c \
|
|
|
|
$(BUILD)/autogen_usb_descriptor.c
|
2019-07-26 14:06:27 -04:00
|
|
|
|
2020-04-21 17:15:44 -04:00
|
|
|
ifeq ($(CIRCUITPY_USB_HID), 1)
|
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
lib/tinyusb/src/class/hid/hid_device.c \
|
|
|
|
shared-bindings/usb_hid/__init__.c \
|
|
|
|
shared-bindings/usb_hid/Device.c \
|
|
|
|
shared-module/usb_hid/__init__.c \
|
|
|
|
shared-module/usb_hid/Device.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_USB_MIDI), 1)
|
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
lib/tinyusb/src/class/midi/midi_device.c \
|
|
|
|
shared-bindings/usb_midi/__init__.c \
|
|
|
|
shared-bindings/usb_midi/PortIn.c \
|
|
|
|
shared-bindings/usb_midi/PortOut.c \
|
|
|
|
shared-module/usb_midi/__init__.c \
|
|
|
|
shared-module/usb_midi/PortIn.c \
|
|
|
|
shared-module/usb_midi/PortOut.c
|
|
|
|
endif
|
|
|
|
|
2018-10-19 21:46:22 -04:00
|
|
|
CFLAGS += -DUSB_AVAILABLE
|
2017-09-22 21:05:51 -04:00
|
|
|
endif
|
|
|
|
|
2020-04-17 19:23:28 -04:00
|
|
|
SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o))
|
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_DISPLAYIO), 1)
|
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
supervisor/shared/display.c
|
|
|
|
|
|
|
|
SUPERVISOR_O += $(BUILD)/autogen_display_resources.o
|
|
|
|
endif
|
2019-11-12 16:29:35 -05:00
|
|
|
ifndef USB_INTERFACE_NAME
|
|
|
|
USB_INTERFACE_NAME = "CircuitPython"
|
|
|
|
endif
|
|
|
|
|
2020-06-15 15:52:35 -04:00
|
|
|
USB_DEVICES_COMPUTED := CDC,MSC
|
|
|
|
ifeq ($(CIRCUITPY_USB_MIDI),1)
|
|
|
|
USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO
|
|
|
|
endif
|
|
|
|
ifeq ($(CIRCUITPY_USB_HID),1)
|
|
|
|
USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID
|
|
|
|
endif
|
2020-06-24 10:44:45 -04:00
|
|
|
USB_DEVICES ?= "$(USB_DEVICES_COMPUTED)"
|
2020-06-15 15:52:35 -04:00
|
|
|
|
2019-09-03 14:44:46 -04:00
|
|
|
ifndef USB_HID_DEVICES
|
|
|
|
USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD"
|
|
|
|
endif
|
|
|
|
|
2020-07-29 04:38:55 -04:00
|
|
|
ifndef USB_HIGHSPEED
|
|
|
|
USB_HIGHSPEED = 0
|
2019-10-04 07:49:33 -04:00
|
|
|
endif
|
|
|
|
|
2019-10-01 04:00:32 -04:00
|
|
|
ifndef USB_CDC_EP_NUM_NOTIFICATION
|
|
|
|
USB_CDC_EP_NUM_NOTIFICATION = 0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef USB_CDC_EP_NUM_DATA_OUT
|
|
|
|
USB_CDC_EP_NUM_DATA_OUT = 0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef USB_CDC_EP_NUM_DATA_IN
|
|
|
|
USB_CDC_EP_NUM_DATA_IN = 0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef USB_MSC_EP_NUM_OUT
|
|
|
|
USB_MSC_EP_NUM_OUT = 0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef USB_MSC_EP_NUM_IN
|
|
|
|
USB_MSC_EP_NUM_IN = 0
|
|
|
|
endif
|
|
|
|
|
2019-10-07 07:40:44 -04:00
|
|
|
ifndef USB_HID_EP_NUM_OUT
|
|
|
|
USB_HID_EP_NUM_OUT = 0
|
|
|
|
endif
|
|
|
|
|
2019-10-01 04:00:32 -04:00
|
|
|
ifndef USB_HID_EP_NUM_IN
|
|
|
|
USB_HID_EP_NUM_IN = 0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef USB_MIDI_EP_NUM_OUT
|
|
|
|
USB_MIDI_EP_NUM_OUT = 0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef USB_MIDI_EP_NUM_IN
|
|
|
|
USB_MIDI_EP_NUM_IN = 0
|
2019-09-04 21:45:16 -04:00
|
|
|
endif
|
|
|
|
|
2019-10-08 03:26:02 -04:00
|
|
|
USB_DESCRIPTOR_ARGS = \
|
|
|
|
--manufacturer $(USB_MANUFACTURER)\
|
|
|
|
--product $(USB_PRODUCT)\
|
|
|
|
--vid $(USB_VID)\
|
|
|
|
--pid $(USB_PID)\
|
|
|
|
--serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
|
2019-11-12 16:29:35 -05:00
|
|
|
--interface_name $(USB_INTERFACE_NAME)\
|
2019-10-08 03:26:02 -04:00
|
|
|
--devices $(USB_DEVICES)\
|
|
|
|
--hid_devices $(USB_HID_DEVICES)\
|
|
|
|
--cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\
|
|
|
|
--cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\
|
|
|
|
--cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\
|
|
|
|
--msc_ep_num_out $(USB_MSC_EP_NUM_OUT)\
|
|
|
|
--msc_ep_num_in $(USB_MSC_EP_NUM_IN)\
|
|
|
|
--hid_ep_num_out $(USB_HID_EP_NUM_OUT)\
|
|
|
|
--hid_ep_num_in $(USB_HID_EP_NUM_IN)\
|
|
|
|
--midi_ep_num_out $(USB_MIDI_EP_NUM_OUT)\
|
|
|
|
--midi_ep_num_in $(USB_MIDI_EP_NUM_IN)\
|
|
|
|
--output_c_file $(BUILD)/autogen_usb_descriptor.c\
|
|
|
|
--output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h
|
|
|
|
|
|
|
|
ifeq ($(USB_RENUMBER_ENDPOINTS), 0)
|
|
|
|
USB_DESCRIPTOR_ARGS += --no-renumber_endpoints
|
2019-09-04 21:45:16 -04:00
|
|
|
endif
|
|
|
|
|
2020-07-29 04:38:55 -04:00
|
|
|
ifeq ($(USB_HIGHSPEED), 1)
|
|
|
|
USB_DESCRIPTOR_ARGS += --highspeed
|
|
|
|
endif
|
|
|
|
|
2018-07-31 19:53:54 -04:00
|
|
|
$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h
|
2018-10-19 21:46:22 -04:00
|
|
|
|
2018-11-09 03:11:43 -05:00
|
|
|
$(BUILD)/autogen_usb_descriptor.c $(BUILD)/genhdr/autogen_usb_descriptor.h: autogen_usb_descriptor.intermediate
|
|
|
|
|
|
|
|
.INTERMEDIATE: autogen_usb_descriptor.intermediate
|
|
|
|
|
|
|
|
autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile | $(HEADER_BUILD)
|
2018-10-19 21:46:22 -04:00
|
|
|
$(STEPECHO) "GEN $@"
|
|
|
|
$(Q)install -d $(BUILD)/genhdr
|
2019-10-08 03:26:02 -04:00
|
|
|
$(Q)$(PYTHON3) ../../tools/gen_usb_descriptor.py $(USB_DESCRIPTOR_ARGS)
|
2019-01-24 20:25:08 -05:00
|
|
|
|
2019-04-12 18:25:48 -04:00
|
|
|
CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf"
|
2019-01-24 20:25:08 -05:00
|
|
|
|
|
|
|
$(BUILD)/autogen_display_resources.c: ../../tools/gen_display_resources.py $(HEADER_BUILD)/qstrdefs.generated.h Makefile | $(HEADER_BUILD)
|
|
|
|
$(STEPECHO) "GEN $@"
|
|
|
|
$(Q)install -d $(BUILD)/genhdr
|
|
|
|
$(Q)$(PYTHON3) ../../tools/gen_display_resources.py \
|
|
|
|
--font $(CIRCUITPY_DISPLAY_FONT) \
|
2019-01-29 20:10:17 -05:00
|
|
|
--sample_file $(HEADER_BUILD)/qstrdefs.generated.h \
|
2019-01-24 20:25:08 -05:00
|
|
|
--output_c_file $(BUILD)/autogen_display_resources.c
|