From 3431ea7205357218f12685b6672a934ac7393063 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 11 Jan 2019 01:52:17 +1100 Subject: [PATCH] stm32/main: Make thread and FS state static and exclude when not needed. Without the static qualifier these objects will be kept by the linker even if they are unused. So this patch saves some RAM when these features are unused by a board. --- ports/stm32/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/stm32/main.c b/ports/stm32/main.c index 42bebf079d..5d6cbf236e 100644 --- a/ports/stm32/main.c +++ b/ports/stm32/main.c @@ -65,8 +65,13 @@ void SystemClock_Config(void); -pyb_thread_t pyb_thread_main; -fs_user_mount_t fs_user_mount_flash; +#if MICROPY_PY_THREAD +STATIC pyb_thread_t pyb_thread_main; +#endif + +#if MICROPY_HW_ENABLE_STORAGE +STATIC fs_user_mount_t fs_user_mount_flash; +#endif void flash_error(int n) { for (int i = 0; i < n; i++) {