Skip to content

Commit

Permalink
stm32/main: Make thread and FS state static and exclude when not needed.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dpgeorge committed Jan 10, 2019
1 parent 5b66c7b commit 3431ea7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ports/stm32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 3431ea7

Please sign in to comment.