From b0a46900de885644c30414caeb4d39fae493e931 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 20 Sep 2016 20:37:58 -0700 Subject: [PATCH] stmhal: Use attribute to avoid inlining. Use MP_NOINLINE macro to avoid inlining of init_flash_fs. This helps to keep stack usage of main() low. --- stmhal/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stmhal/main.c b/stmhal/main.c index 2446225034..e7fff69d9b 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -165,9 +165,8 @@ static const char fresh_readme_txt[] = "Please visit http://micropython.org/help/ for further help.\r\n" ; -// we don't make this function static because it needs a lot of stack and we -// want it to be executed without using stack within main() function -void init_flash_fs(uint reset_mode) { +// avoid inlining to avoid stack usage within main() +MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) { // init the vfs object fs_user_mount_t *vfs = &fs_user_mount_flash; vfs->str = "/flash";