Skip to content

Commit f5f2c9f

Browse files
committed
Move global variables assignment in the mount function
1 parent 445c75d commit f5f2c9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stm32h7/littlefs_shim.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ const struct lfs_config cfg = {
9393
int lfsshim_mount(lfs_t *lfs, SD_HandleTypeDef *hsd, uint32_t first_block_offset) {
9494
memset(lfs, 0, sizeof(lfs_t));
9595

96+
lfsshim_hsd = hsd;
97+
lfsshim_first_block_offset = first_block_offset;
98+
9699
if (lfs_mount(lfs, &cfg) != 0) {
97100
return W_IO_ERROR;
98101
}
99102

100-
lfsshim_hsd = hsd;
101-
lfsshim_first_block_offset = first_block_offset;
102-
103103
return 0; // success
104104
}

0 commit comments

Comments
 (0)