Skip to content

Commit b0a4690

Browse files
committed
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.
1 parent 7ea3fa2 commit b0a4690

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

stmhal/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ static const char fresh_readme_txt[] =
165165
"Please visit http://micropython.org/help/ for further help.\r\n"
166166
;
167167

168-
// we don't make this function static because it needs a lot of stack and we
169-
// want it to be executed without using stack within main() function
170-
void init_flash_fs(uint reset_mode) {
168+
// avoid inlining to avoid stack usage within main()
169+
MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) {
171170
// init the vfs object
172171
fs_user_mount_t *vfs = &fs_user_mount_flash;
173172
vfs->str = "/flash";

0 commit comments

Comments
 (0)