/**
* @brief Reports the name of the source file and the source line number where
* the assert error has occurred.
* User can add his own implementation to report the file name and line number.
* ex: printf("Wrong parameters value: file %s on line %d
", file, line)
* @retval void None
* @par Required preconditions:
* None
* @par Called functions:
* None
*/
#ifdef FULL_ASSERT
void assert_failed(u8 *file, u16 line)
#else
void assert_failed(void)
#endif
{
/* Add your own code to manage an assert error */
/* Infinite loop */
while (1)
{
}
}
在main函数下面加入这些代码:
/**
* @brief Reports the name of the source file and the source line number where
* the assert error has occurred.
* User can add his own implementation to report the file name and line number.
* ex: printf("Wrong parameters value: file %s on line %d ", file, line)
* @retval void None
* @par Required preconditions:
* None
* @par Called functions:
* None
*/
#ifdef FULL_ASSERT
void assert_failed(u8 *file, u16 line)
#else
void assert_failed(void)
#endif
{
/* Add your own code to manage an assert error */
/* Infinite loop */
while (1)
{
}
}
一周热门 更多>