diff --git a/os/hal/ports/STM32/STM32L4xx+/hal_lld.c b/os/hal/ports/STM32/STM32L4xx+/hal_lld.c index 580f53976..6bd608f22 100644 --- a/os/hal/ports/STM32/STM32L4xx+/hal_lld.c +++ b/os/hal/ports/STM32/STM32L4xx+/hal_lld.c @@ -371,7 +371,7 @@ static bool hal_lld_clock_check_tree(const halclkcfg_t *ccp) { } /* MSI clock.*/ - msiidx = (uint8_t)((ccp->rcc_cr & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos); + msiidx = (ccp->rcc_cr & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos; if (msiidx >= STM32_MSIRANGE_ARRAY_SIZE) { return true; }