Skip to content

Commit

Permalink
feat: support stm32 assert
Browse files Browse the repository at this point in the history
Fixes #2375.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
  • Loading branch information
fpistm committed May 28, 2024
1 parent 73f7d29 commit 000dad7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cores/arduino/stm32/stm32_assert.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32_ASSERT_H
#define STM32_ASSERT_H

/*
* Header file required by LL layer but as USE_HAL_DRIVER is defined
* assert definitions are provided by stm32yyxx_hal_conf_default
*/

#endif /* STM32_ASSERT_H */
14 changes: 14 additions & 0 deletions libraries/SrcWrapper/src/stm32/stm32_def.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ WEAK void _Error_Handler(const char *msg, int val)
}
#endif

#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
WEAK void assert_failed(uint8_t *file, uint32_t line)
{
_Error_Handler((const char *)file, line);
}
#endif /* USE_FULL_ASSERT */

#ifdef __cplusplus
}
#endif

0 comments on commit 000dad7

Please sign in to comment.