mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-20 22:14:29 +08:00
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:
committed by
Amar Takhar
parent
31d2a2acb1
commit
5b13baf96a
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user