[HAL][SAI] Add 'const' qualifier to comply to MISRA-C rule 8.13
diff --git a/Inc/stm32f4xx_hal_sai.h b/Inc/stm32f4xx_hal_sai.h
index 6c23f93..368316d 100644
--- a/Inc/stm32f4xx_hal_sai.h
+++ b/Inc/stm32f4xx_hal_sai.h
@@ -748,8 +748,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/stm32f4xx_hal_sai_ex.h b/Inc/stm32f4xx_hal_sai_ex.h
index c6fdd56..75ba6d2 100644
--- a/Inc/stm32f4xx_hal_sai_ex.h
+++ b/Inc/stm32f4xx_hal_sai_ex.h
@@ -71,8 +71,8 @@
*/
/* Extended features functions ************************************************/
-void SAI_BlockSynchroConfig(SAI_HandleTypeDef *hsai);
-uint32_t SAI_GetInputClock(SAI_HandleTypeDef *hsai);
+void SAI_BlockSynchroConfig(const SAI_HandleTypeDef *hsai);
+uint32_t SAI_GetInputClock(const SAI_HandleTypeDef *hsai);
/**
* @}
*/
diff --git a/Src/stm32f4xx_hal_sai.c b/Src/stm32f4xx_hal_sai.c
index 19e3748..fa1c336 100644
--- a/Src/stm32f4xx_hal_sai.c
+++ b/Src/stm32f4xx_hal_sai.c
@@ -260,7 +260,7 @@
* @{
*/
static void SAI_FillFifo(SAI_HandleTypeDef *hsai);
-static uint32_t SAI_InterruptFlag(SAI_HandleTypeDef *hsai, uint32_t mode);
+static uint32_t SAI_InterruptFlag(const SAI_HandleTypeDef *hsai, uint32_t mode);
static HAL_StatusTypeDef SAI_InitI2S(SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot);
static HAL_StatusTypeDef SAI_InitPCM(SAI_HandleTypeDef *hsai, uint32_t protocol, uint32_t datasize, uint32_t nbslot);
@@ -1909,7 +1909,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;
}
@@ -1920,7 +1920,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;
}
@@ -2138,7 +2138,7 @@
* @param mode SAI_MODE_DMA or SAI_MODE_IT
* @retval the list of the IT flag to enable
*/
-static uint32_t SAI_InterruptFlag(SAI_HandleTypeDef *hsai, uint32_t mode)
+static uint32_t SAI_InterruptFlag(const SAI_HandleTypeDef *hsai, uint32_t mode)
{
uint32_t tmpIT = SAI_IT_OVRUDR;
diff --git a/Src/stm32f4xx_hal_sai_ex.c b/Src/stm32f4xx_hal_sai_ex.c
index 78a73f8..2d5e8c4 100644
--- a/Src/stm32f4xx_hal_sai_ex.c
+++ b/Src/stm32f4xx_hal_sai_ex.c
@@ -95,7 +95,7 @@
* the configuration information for SAI module.
* @retval SAI Clock Input
*/
-void SAI_BlockSynchroConfig(SAI_HandleTypeDef *hsai)
+void SAI_BlockSynchroConfig(const SAI_HandleTypeDef *hsai)
{
uint32_t tmpregisterGCR;
@@ -158,7 +158,7 @@
* the configuration information for SAI module.
* @retval SAI Clock Input
*/
-uint32_t SAI_GetInputClock(SAI_HandleTypeDef *hsai)
+uint32_t SAI_GetInputClock(const SAI_HandleTypeDef *hsai)
{
/* This variable used to store the SAI_CK_x (value in Hz) */
uint32_t saiclocksource = 0U;