bsps/stm32h7: Resolve HAL const warning

HAL init functions take a non-const reference parameter. Explicitly cast
away the constness to remove the warning.
This commit is contained in:
Kinsey Moore
2024-09-06 01:15:21 +00:00
committed by Amar Takhar
parent 31d2a2acb1
commit 5b13baf96a
2 changed files with 12 additions and 4 deletions
+11 -3
View File
@@ -55,7 +55,10 @@ void stm32h7_init_oscillator(void)
{
HAL_StatusTypeDef status;
status = HAL_RCC_OscConfig(&stm32h7_config_oscillator);
status = HAL_RCC_OscConfig(RTEMS_DECONST(
RCC_OscInitTypeDef *,
&stm32h7_config_oscillator
));
if (status != HAL_OK) {
bsp_reset(RTEMS_FATAL_SOURCE_BSP, 0);
}
@@ -66,7 +69,7 @@ void stm32h7_init_clocks(void)
HAL_StatusTypeDef status;
status = HAL_RCC_ClockConfig(
&stm32h7_config_clocks,
RTEMS_DECONST( RCC_ClkInitTypeDef *, &stm32h7_config_clocks ),
stm32h7_config_flash_latency
);
if (status != HAL_OK) {
@@ -78,7 +81,12 @@ void stm32h7_init_peripheral_clocks(void)
{
HAL_StatusTypeDef status;
status = HAL_RCCEx_PeriphCLKConfig(&stm32h7_config_peripheral_clocks);
status = HAL_RCCEx_PeriphCLKConfig(
RTEMS_DECONST(
RCC_PeriphCLKInitTypeDef *,
&stm32h7_config_peripheral_clocks
)
);
if (status != HAL_OK) {
bsp_reset(RTEMS_FATAL_SOURCE_BSP, 0);
}
+1 -1
View File
@@ -272,7 +272,7 @@ void stm32h7_gpio_init(const stm32h7_gpio_config *config)
index = stm32h7_get_module_index(config->regs);
stm32h7_clk_enable(index);
HAL_GPIO_Init(config->regs, &config->config);
HAL_GPIO_Init(config->regs, RTEMS_DECONST( GPIO_InitTypeDef *, &config->config ));
}
void stm32h7_uart_polled_write(rtems_termios_device_context *base, char c)