Merge pull request #1331 from adafruit/tannewt-patch-4

Switch SAMD51 back to -Os
This commit is contained in:
Dan Halbert 2018-11-13 14:35:32 -05:00 committed by GitHub
commit c63376c5fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -93,7 +93,7 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_C
endif
ifeq ($(CHIP_FAMILY), samd51)
CFLAGS += -O0 -DNDEBUG
CFLAGS += -Os -DNDEBUG
# TinyUSB defines
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -DCFG_TUD_CDC_RX_BUFSIZE=256 -DCFG_TUD_CDC_TX_BUFSIZE=256 -DCFG_TUD_MSC_BUFSIZE=1024
endif

View File

@ -48,6 +48,11 @@
}
#endif
// Ensure this code is compiled with -Os. Any other optimization level may change the timing of it
// and break neopixels.
#pragma GCC push_options
#pragma GCC optimize ("Os")
uint64_t next_start_tick_ms = 0;
uint32_t next_start_tick_us = 1000;
@ -183,3 +188,5 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
mp_hal_enable_all_interrupts();
}
#pragma GCC pop_options