[HAL][SAI] HAL code quality enhancement for MISRA-C Rule-8.13 by adding const qualifiers
diff --git a/Inc/stm32l4xx_hal_sai.h b/Inc/stm32l4xx_hal_sai.h index b36604a..f17bef0 100644 --- a/Inc/stm32l4xx_hal_sai.h +++ b/Inc/stm32l4xx_hal_sai.h
@@ -832,8 +832,8 @@ * @{ */ /* Peripheral State functions ************************************************/ -HAL_SAI_StateTypeDef HAL_SAI_GetState(SAI_HandleTypeDef *hsai); -uint32_t HAL_SAI_GetError(SAI_HandleTypeDef *hsai); +HAL_SAI_StateTypeDef HAL_SAI_GetState(const SAI_HandleTypeDef *hsai); +uint32_t HAL_SAI_GetError(const SAI_HandleTypeDef *hsai); /** * @} */
diff --git a/Inc/stm32l4xx_hal_sai_ex.h b/Inc/stm32l4xx_hal_sai_ex.h index cbd6e38..10fcc9e 100644 --- a/Inc/stm32l4xx_hal_sai_ex.h +++ b/Inc/stm32l4xx_hal_sai_ex.h
@@ -72,7 +72,8 @@ /** @addtogroup SAIEx_Exported_Functions_Group1 Peripheral Control functions * @{ */ -HAL_StatusTypeDef HAL_SAIEx_ConfigPdmMicDelay(SAI_HandleTypeDef *hsai, SAIEx_PdmMicDelayParamTypeDef *pdmMicDelay); +HAL_StatusTypeDef HAL_SAIEx_ConfigPdmMicDelay(const SAI_HandleTypeDef *hsai, + const SAIEx_PdmMicDelayParamTypeDef *pdmMicDelay); /** * @} */
diff --git a/Src/stm32l4xx_hal_sai.c b/Src/stm32l4xx_hal_sai.c index f13aac6..46f9abb 100644 --- a/Src/stm32l4xx_hal_sai.c +++ b/Src/stm32l4xx_hal_sai.c
@@ -2159,7 +2159,7 @@ * the configuration information for SAI module. * @retval HAL state */ -HAL_SAI_StateTypeDef HAL_SAI_GetState(SAI_HandleTypeDef *hsai) +HAL_SAI_StateTypeDef HAL_SAI_GetState(const SAI_HandleTypeDef *hsai) { return hsai->State; } @@ -2170,7 +2170,7 @@ * the configuration information for the specified SAI Block. * @retval SAI Error Code */ -uint32_t HAL_SAI_GetError(SAI_HandleTypeDef *hsai) +uint32_t HAL_SAI_GetError(const SAI_HandleTypeDef *hsai) { return hsai->ErrorCode; }
diff --git a/Src/stm32l4xx_hal_sai_ex.c b/Src/stm32l4xx_hal_sai_ex.c index 9c9e0ae..5abdfac 100644 --- a/Src/stm32l4xx_hal_sai_ex.c +++ b/Src/stm32l4xx_hal_sai_ex.c
@@ -75,7 +75,8 @@ * @param pdmMicDelay Microphone delays configuration. * @retval HAL status */ -HAL_StatusTypeDef HAL_SAIEx_ConfigPdmMicDelay(SAI_HandleTypeDef *hsai, SAIEx_PdmMicDelayParamTypeDef *pdmMicDelay) +HAL_StatusTypeDef HAL_SAIEx_ConfigPdmMicDelay(const SAI_HandleTypeDef *hsai, + const SAIEx_PdmMicDelayParamTypeDef *pdmMicDelay) { HAL_StatusTypeDef status = HAL_OK; uint32_t offset;