Skip to content

Commit edfe6d5

Browse files
committed
[src] [components] avoid compiler optimize
1 parent 848c3ff commit edfe6d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void rt_components_board_init(void)
9292
rt_kprintf(":%d done\n", result);
9393
}
9494
#else
95-
const init_fn_t *fn_ptr;
95+
volatile const init_fn_t *fn_ptr;
9696

9797
for (fn_ptr = &__rt_init_rti_board_start; fn_ptr < &__rt_init_rti_board_end; fn_ptr++)
9898
{
@@ -118,7 +118,7 @@ void rt_components_init(void)
118118
rt_kprintf(":%d done\n", result);
119119
}
120120
#else
121-
const init_fn_t *fn_ptr;
121+
volatile const init_fn_t *fn_ptr;
122122

123123
for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++)
124124
{

0 commit comments

Comments
 (0)