Skip to content

Commit

Permalink
chore: prevent old gcc version to raised an error
Browse files Browse the repository at this point in the history
Fixes #2125

Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Sep 12, 2023
1 parent 6f39b41 commit 6c48d73
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions libraries/SrcWrapper/src/stm32/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,17 @@ void enableClock(sourceClock_t source)
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
}
break;
case HSE_CLOCK:
case HSE_CLOCK: {
#if defined(RCC_HSE_BYPASS_PWR) && defined(LORAWAN_BOARD_HAS_TCXO) && (LORAWAN_BOARD_HAS_TCXO == 1)
uint32_t HSEState = RCC_HSE_BYPASS_PWR;
uint32_t HSEState = RCC_HSE_BYPASS_PWR;
#else
uint32_t HSEState = RCC_HSE_ON;
uint32_t HSEState = RCC_HSE_ON;
#endif
__HAL_RCC_HSE_CONFIG(HSEState);
if (__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) {
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = HSEState;
__HAL_RCC_HSE_CONFIG(HSEState);
if (__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) {
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = HSEState;
}
}
break;
default:
Expand Down

0 comments on commit 6c48d73

Please sign in to comment.