Skip to content

Commit ed1b308

Browse files
committed
chore: add a volatile keyword to keep a error check in OSInitHook
OSInitHook has a error check to make sure the M4F FPU is in correct mode. As such the FPU in STM32G4 M4F is in correct state on reset and this check will always pass. However making sure the error check stays active in the final binary could help catch issues in some other platforms
1 parent c306bc7 commit ed1b308

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Ports/ARM-Cortex-M/ARMv7-M/os_cpu_c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void OSIdleTaskHook (void)
114114
void OSInitHook (void)
115115
{
116116
#if (OS_CPU_ARM_FP_EN > 0u)
117-
CPU_INT32U reg_val;
117+
volatile CPU_INT32U reg_val;
118118
#endif
119119
/* 8-byte align the ISR stack. */
120120
OS_CPU_ExceptStkBase = (CPU_STK *)(OSCfg_ISRStkBasePtr + OSCfg_ISRStkSize);

0 commit comments

Comments
 (0)