Skip to content

Commit bfaf54d

Browse files
authored
Merge pull request #9207 from tannewt/squeeze_in_max
Switch to -Os for all 4MB builds
2 parents 94afcaa + 5fa40cc commit bfaf54d

File tree

49 files changed

+343
-285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+343
-285
lines changed

lib/tinyusb

Submodule tinyusb updated 377 files

main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ STATIC void stop_mp(void) {
236236

237237
background_callback_reset();
238238

239-
#if CIRCUITPY_USB
239+
#if CIRCUITPY_TINYUSB
240240
usb_background();
241241
#endif
242242

@@ -466,7 +466,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) {
466466

467467
start_mp(safe_mode);
468468

469-
#if CIRCUITPY_USB
469+
#if CIRCUITPY_USB_DEVICE
470470
usb_setup_with_vm();
471471
#endif
472472

@@ -845,7 +845,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
845845

846846
start_mp(safe_mode);
847847

848-
#if CIRCUITPY_USB
848+
#if CIRCUITPY_USB_DEVICE
849849
// Set up default USB values after boot.py VM starts but before running boot.py.
850850
usb_set_defaults();
851851
#endif
@@ -930,7 +930,7 @@ STATIC int run_repl(safe_mode_t safe_mode) {
930930

931931
start_mp(safe_mode);
932932

933-
#if CIRCUITPY_USB
933+
#if CIRCUITPY_USB_DEVICE
934934
usb_setup_with_vm();
935935
#endif
936936

@@ -1078,7 +1078,7 @@ int __attribute__((used)) main(void) {
10781078
// By default our internal flash is readonly to local python code and
10791079
// writable over USB. Set it here so that safemode.py or boot.py can change it.
10801080
filesystem_set_internal_concurrent_write_protection(true);
1081-
filesystem_set_internal_writable_by_usb(CIRCUITPY_USB == 1);
1081+
filesystem_set_internal_writable_by_usb(CIRCUITPY_USB_DEVICE == 1);
10821082

10831083
#if CIRCUITPY_SAFEMODE_PY
10841084
// Run safemode.py if we ARE in safe mode.

ports/atmel-samd/common-hal/microcontroller/Pin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void reset_all_pins(void) {
5252
uint32_t pin_mask[PORT_COUNT] = PORT_OUT_IMPLEMENTED;
5353

5454
// Do not full reset USB lines.
55-
#if CIRCUITPY_USB
55+
#if CIRCUITPY_USB_DEVICE
5656
pin_mask[0] &= ~(PORT_PA24 | PORT_PA25);
5757
#endif
5858

ports/espressif/Makefile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,22 +260,34 @@ LIBS += -lm
260260
endif
261261

262262
# TinyUSB defines
263-
ifeq ($(CIRCUITPY_USB),1)
264-
ifeq ($(IDF_TARGET),esp32s2)
263+
# Always add these because we might be doing host.
264+
ifeq ($(IDF_TARGET),esp32)
265+
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32
266+
else ifeq ($(IDF_TARGET),esp32c3)
267+
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32C3
268+
else ifeq ($(IDF_TARGET),esp32c6)
269+
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32C6
270+
else ifeq ($(IDF_TARGET),esp32h2)
271+
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32H2
272+
else ifeq ($(IDF_TARGET),esp32s2)
265273
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32S2
266274
else ifeq ($(IDF_TARGET),esp32s3)
267275
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32S3
268276
endif
277+
ifeq ($(CIRCUITPY_TINYUSB),1)
269278
CFLAGS += \
270279
-DCFG_TUSB_OS=OPT_OS_FREERTOS \
280+
-DCFG_TUD_TASK_QUEUE_SZ=32
281+
endif
282+
ifeq ($(CIRCUITPY_USB_DEVICE),1)
283+
CFLAGS += \
271284
-DCFG_TUD_CDC_RX_BUFSIZE=1024 \
272285
-DCFG_TUD_CDC_TX_BUFSIZE=1024 \
273286
-DCFG_TUD_MSC_BUFSIZE=4096 \
274287
-DCFG_TUD_MIDI_RX_BUFSIZE=128 \
275288
-DCFG_TUD_MIDI_TX_BUFSIZE=128 \
276289
-DCFG_TUD_VENDOR_RX_BUFSIZE=128 \
277-
-DCFG_TUD_VENDOR_TX_BUFSIZE=128 \
278-
-DCFG_TUD_TASK_QUEUE_SZ=32
290+
-DCFG_TUD_VENDOR_TX_BUFSIZE=128
279291
endif
280292

281293
######################################
@@ -303,7 +315,7 @@ ifneq ($(CIRCUITPY_TOUCHIO_USE_NATIVE),0)
303315
SRC_C += peripherals/touch.c
304316
endif
305317

306-
ifneq ($(CIRCUITPY_USB),0)
318+
ifneq ($(CIRCUITPY_USB_DEVICE),0)
307319
SRC_C += lib/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c
308320
endif
309321

@@ -390,7 +402,7 @@ TARGET_SDKCONFIG = esp-idf-config/sdkconfig-$(IDF_TARGET).defaults
390402
ifeq ($(CIRCUITPY_ESP_FLASH_SIZE), 2MB)
391403
FLASH_SIZE_SDKCONFIG ?= esp-idf-config/sdkconfig-flash-$(CIRCUITPY_ESP_FLASH_SIZE)-no-ota-no-uf2.defaults
392404
else
393-
UF2_BOOTLOADER ?= $(CIRCUITPY_USB)
405+
UF2_BOOTLOADER ?= $(CIRCUITPY_USB_DEVICE)
394406
ifeq ($(UF2_BOOTLOADER), 1)
395407
FLASH_SIZE_SDKCONFIG ?= esp-idf-config/sdkconfig-flash-$(CIRCUITPY_ESP_FLASH_SIZE).defaults
396408
else
@@ -503,7 +515,7 @@ endif
503515
ifneq ($(CIRCUITPY_PARALLELDISPLAYBUS),0)
504516
ESP_IDF_COMPONENTS_LINK += esp_lcd
505517
endif
506-
ifneq ($(CIRCUITPY_USB),0)
518+
ifneq ($(CIRCUITPY_USB_DEVICE),0)
507519
ESP_IDF_COMPONENTS_LINK += usb
508520
endif
509521

ports/espressif/boards/adafruit_esp32s3_camera/mpconfigboard.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,3 @@ CIRCUITPY_ONEWIREIO = 0
2626
CIRCUITPY_PARALLELDISPLAYBUS = 0
2727
CIRCUITPY_RGBMATRIX = 0
2828
CIRCUITPY_ROTARYIO = 0
29-
30-
OPTIMIZATION_FLAGS = -Os

ports/espressif/boards/adafruit_feather_esp32s3_reverse_tft/mpconfigboard.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@ CIRCUITPY_ESP_PSRAM_FREQ = 80m
1616

1717
CIRCUITPY_ESPCAMERA = 0
1818
CIRCUITPY_PARALLELDISPLAYBUS = 0
19-
20-
OPTIMIZATION_FLAGS = -Os

ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ CIRCUITPY_ESP_FLASH_MODE = qio
1010
CIRCUITPY_ESP_FLASH_FREQ = 80m
1111
CIRCUITPY_ESP_FLASH_SIZE = 4MB
1212

13-
OPTIMIZATION_FLAGS = -Os
1413
CIRCUITPY_ESPCAMERA = 0
1514
CIRCUITPY_PARALLELDISPLAYBUS = 0
1615

ports/espressif/boards/adafruit_qtpy_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ CIRCUITPY_ESP_PSRAM_SIZE = 2MB
1313
CIRCUITPY_ESP_PSRAM_MODE = qio
1414
CIRCUITPY_ESP_PSRAM_FREQ = 80m
1515

16-
OPTIMIZATION_FLAGS = -Os
1716
CIRCUITPY_ESPCAMERA = 0
1817
# Not enough pins.
1918
CIRCUITPY_PARALLELDISPLAYBUS = 0

ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ CIRCUITPY_ESPCAMERA = 0
1818
CIRCUITPY_BITMAPFILTER = 0
1919
CIRCUITPY_CODEOP = 0
2020
CIRCUITPY_PARALLELDISPLAYBUS = 0
21-
22-
OPTIMIZATION_FLAGS = -Os

ports/espressif/boards/heltec_esp32s3_wifi_lora_v3/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ IDF_TARGET = esp32s3
1313

1414
# This board doesn't have USB by default, it
1515
# instead uses a CP2102 USB-to-Serial chip
16-
CIRCUITPY_USB = 0
16+
CIRCUITPY_USB_DEVICE = 0
1717
CIRCUITPY_ESP_USB_SERIAL_JTAG = 0
1818

1919
CIRCUITPY_ESP_FLASH_MODE = qio

0 commit comments

Comments
 (0)