Skip to content

Commit ae3d74d

Browse files
committed
[HAL][CRC] Enhance HAL code quality for MISRA-C Rule-8.13 by adding const qualifiers
1 parent 9677f4f commit ae3d74d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Inc/stm32f4xx_hal_crc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc);
147147
/** @defgroup CRC_Exported_Functions_Group2 Peripheral Control functions
148148
* @{
149149
*/
150-
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
151-
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
150+
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t const pBuffer[], uint32_t BufferLength);
151+
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t const pBuffer[], uint32_t BufferLength);
152152
/**
153153
* @}
154154
*/

Src/stm32f4xx_hal_crc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ __weak void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc)
224224
* @param BufferLength input data buffer length (number of uint32_t words).
225225
* @retval uint32_t CRC (returned value LSBs for CRC shorter than 32 bits)
226226
*/
227-
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
227+
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t const pBuffer[], uint32_t BufferLength)
228228
{
229229
uint32_t index; /* CRC input data buffer index */
230230
uint32_t temp = 0U; /* CRC output (read from hcrc->Instance->DR register) */
@@ -254,7 +254,7 @@ uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_
254254
* @param BufferLength input data buffer length (number of uint32_t words).
255255
* @retval uint32_t CRC (returned value LSBs for CRC shorter than 32 bits)
256256
*/
257-
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
257+
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t const pBuffer[], uint32_t BufferLength)
258258
{
259259
uint32_t index; /* CRC input data buffer index */
260260
uint32_t temp = 0U; /* CRC output (read from hcrc->Instance->DR register) */

0 commit comments

Comments
 (0)