STMicroelectronics / STM32CubeL4

STM32Cube MCU Full Package for the STM32L4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
259 stars 151 forks source link

Use const parameters for initialization functions #86

Closed PetteriAimonen closed 9 months ago

PetteriAimonen commented 9 months ago

The initialization functions such as HAL_GPIO_Init and HAL_RCC_OscConfig do not modify the initialization structure given as argument.

The argument should be declared as const:

 HAL_StatusTypeDef HAL_RCC_OscConfig(const RCC_OscInitTypeDef *RCC_OscInitStruct);

Then user code can declare the struct const also, which will cause it to be placed in flash memory, saving RAM memory for other uses.

ALABSTM commented 9 months ago

Duplicate of #15

ALABSTM commented 9 months ago

Hi @PetteriAimonen,

Thank you for having reported. Actually, this topic has been already tackled in issue #15 and we are progressively deploying the use of the const qualifier in our drivers for all firmware. This takes some time to be done.

You can keep on tracking progress on this topic via the above-mentioned issue. Please allow me to close this one. Thank you for your comprehension.

With regards,

PetteriAimonen commented 9 months ago

So that issue #15 is created in 2020, yet three years later this repository which has several releases since then still doesn't have the fix?