Skip to content

Commit 6c48d73

Browse files
committed
chore: prevent old gcc version to raised an error
Fixes #2125 Signed-off-by: Frederic Pillon <[email protected]>
1 parent 6f39b41 commit 6c48d73

File tree

1 file changed

+8
-7
lines changed
  • libraries/SrcWrapper/src/stm32

1 file changed

+8
-7
lines changed

Diff for: libraries/SrcWrapper/src/stm32/clock.c

+8-7
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,17 @@ void enableClock(sourceClock_t source)
128128
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
129129
}
130130
break;
131-
case HSE_CLOCK:
131+
case HSE_CLOCK: {
132132
#if defined(RCC_HSE_BYPASS_PWR) && defined(LORAWAN_BOARD_HAS_TCXO) && (LORAWAN_BOARD_HAS_TCXO == 1)
133-
uint32_t HSEState = RCC_HSE_BYPASS_PWR;
133+
uint32_t HSEState = RCC_HSE_BYPASS_PWR;
134134
#else
135-
uint32_t HSEState = RCC_HSE_ON;
135+
uint32_t HSEState = RCC_HSE_ON;
136136
#endif
137-
__HAL_RCC_HSE_CONFIG(HSEState);
138-
if (__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) {
139-
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
140-
RCC_OscInitStruct.HSEState = HSEState;
137+
__HAL_RCC_HSE_CONFIG(HSEState);
138+
if (__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) {
139+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
140+
RCC_OscInitStruct.HSEState = HSEState;
141+
}
141142
}
142143
break;
143144
default:

0 commit comments

Comments
 (0)