Skip to content

Commit

Permalink
stmhal: Use attribute to avoid inlining.
Browse files Browse the repository at this point in the history
Use MP_NOINLINE macro to avoid inlining of init_flash_fs. This helps
to keep stack usage of main() low.
  • Loading branch information
agners committed Sep 21, 2016
1 parent 7ea3fa2 commit b0a4690
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions stmhal/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit b0a4690

Please sign in to comment.