Skip to content

Commit bda3267

Browse files
committed
Save flash space
* No weak link for modules. It only impacts _os and _time and is already disabled for non-full builds. * Turn off PA00 and PA01 because they are the crystal on the Metro M0 Express. * Change ejected default to false to move it to BSS. It is set on USB connection anyway. * Set sinc_filter to const. Doesn't help flash but keeps it out of RAM.
1 parent 68eb809 commit bda3267

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
#define DEFAULT_UART_BUS_RX (&pin_PA11)
3434
#define DEFAULT_UART_BUS_TX (&pin_PA10)
3535

36+
// These pins are connected to the external crystal.
37+
#define IGNORE_PIN_PA00 1
38+
#define IGNORE_PIN_PA01 1
39+
3640
// USB is always used internally so skip the pin objects for it.
3741
#define IGNORE_PIN_PA24 1
3842
#define IGNORE_PIN_PA25 1

ports/atmel-samd/common-hal/audiobusio/PDMIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length,
326326
// higher sample rate than specified. Then after the audio is
327327
// recorded, a more expensive filter non-real-time filter could be
328328
// used to down-sample and low-pass.
329-
uint16_t sinc_filter [OVERSAMPLING] = {
329+
const uint16_t sinc_filter [OVERSAMPLING] = {
330330
0, 2, 9, 21, 39, 63, 94, 132,
331331
179, 236, 302, 379, 467, 565, 674, 792,
332332
920, 1055, 1196, 1341, 1487, 1633, 1776, 1913,

py/circuitpy_mpconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ typedef long mp_off_t;
186186
#define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD)
187187
#define MICROPY_PY_BUILTINS_POW3 (CIRCUITPY_FULL_BUILD)
188188
#define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT)
189-
#define MICROPY_MODULE_WEAK_LINKS (CIRCUITPY_FULL_BUILD)
189+
#define MICROPY_MODULE_WEAK_LINKS (0)
190190
#define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD)
191191
#define MICROPY_PY_BUILTINS_COMPLEX (CIRCUITPY_FULL_BUILD)
192192
#define MICROPY_PY_BUILTINS_FROZENSET (CIRCUITPY_FULL_BUILD)

supervisor/shared/usb/usb_msc_flash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
#define MSC_FLASH_BLOCK_SIZE 512
4141

42-
static bool ejected[1] = {true};
42+
static bool ejected[1] = {false};
4343

4444
void usb_msc_mount(void) {
4545
// Reset the ejection tracking every time we're plugged into USB. This allows for us to battery

0 commit comments

Comments
 (0)