|
1 | | -/** |
2 | | - ****************************************************************************** |
3 | | - * @file stm32_assert.h |
4 | | - * @author MCD Application Team |
5 | | - * @brief STM32 assert template file. |
6 | | - * This file should be copied to the application folder and renamed |
7 | | - * to stm32_assert.h. |
8 | | - ****************************************************************************** |
9 | | - * @attention |
10 | | - * |
11 | | - * Copyright (c) 2022 STMicroelectronics. |
12 | | - * All rights reserved. |
13 | | - * |
14 | | - * This software is licensed under terms that can be found in the LICENSE file |
15 | | - * in the root directory of this software component. |
16 | | - * If no LICENSE file comes with this software, it is provided AS-IS. |
17 | | - * |
18 | | - ****************************************************************************** |
19 | | - */ |
20 | | - |
21 | | -/* Define to prevent recursive inclusion -------------------------------------*/ |
22 | | -#ifndef STM32_ASSERT_H |
23 | | -#define STM32_ASSERT_H |
24 | | - |
25 | | -#ifdef __cplusplus |
26 | | -extern "C" { |
27 | | -#endif |
28 | | - |
29 | | -/* Includes ------------------------------------------------------------------*/ |
30 | | -/* Exported types ------------------------------------------------------------*/ |
31 | | -/* Exported constants --------------------------------------------------------*/ |
32 | | -/* Exported macros -----------------------------------------------------------*/ |
33 | | -#ifdef USE_FULL_ASSERT |
34 | | -/** |
35 | | - * @brief The assert_param macro is used for function's parameters check. |
36 | | - * @param expr If expr is false, it calls assert_failed function |
37 | | - * which reports the name of the source file and the source |
38 | | - * line number of the call that failed. |
39 | | - * If expr is true, it returns no value. |
40 | | - * @retval None |
41 | | - */ |
42 | | -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) |
43 | | -/* Exported functions ------------------------------------------------------- */ |
44 | | -void assert_failed(uint8_t *file, uint32_t line); |
45 | | -#else |
46 | | -#define assert_param(expr) ((void)0U) |
47 | | -#endif /* USE_FULL_ASSERT */ |
48 | | - |
49 | | -#ifdef __cplusplus |
50 | | -} |
51 | | -#endif |
52 | | - |
53 | | -#endif /* STM32_ASSERT_H */ |
| 1 | +/** |
| 2 | + ****************************************************************************** |
| 3 | + * @file stm32_assert.h |
| 4 | + * @author MCD Application Team |
| 5 | + * @brief STM32 assert template file. |
| 6 | + * This file should be copied to the application folder and renamed |
| 7 | + * to stm32_assert.h. |
| 8 | + ****************************************************************************** |
| 9 | + * @attention |
| 10 | + * |
| 11 | + * Copyright (c) 2022 STMicroelectronics. |
| 12 | + * All rights reserved. |
| 13 | + * |
| 14 | + * This software is licensed under terms that can be found in the LICENSE file |
| 15 | + * in the root directory of this software component. |
| 16 | + * If no LICENSE file comes with this software, it is provided AS-IS. |
| 17 | + * |
| 18 | + ****************************************************************************** |
| 19 | + */ |
| 20 | + |
| 21 | +/* Define to prevent recursive inclusion -------------------------------------*/ |
| 22 | +#ifndef STM32_ASSERT_H |
| 23 | +#define STM32_ASSERT_H |
| 24 | + |
| 25 | +#ifdef __cplusplus |
| 26 | +extern "C" { |
| 27 | +#endif |
| 28 | + |
| 29 | +/* Includes ------------------------------------------------------------------*/ |
| 30 | +/* Exported types ------------------------------------------------------------*/ |
| 31 | +/* Exported constants --------------------------------------------------------*/ |
| 32 | +/* Exported macros -----------------------------------------------------------*/ |
| 33 | +#ifdef USE_FULL_ASSERT |
| 34 | +/** |
| 35 | + * @brief The assert_param macro is used for function's parameters check. |
| 36 | + * @param expr If expr is false, it calls assert_failed function |
| 37 | + * which reports the name of the source file and the source |
| 38 | + * line number of the call that failed. |
| 39 | + * If expr is true, it returns no value. |
| 40 | + * @retval None |
| 41 | + */ |
| 42 | +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) |
| 43 | +/* Exported functions ------------------------------------------------------- */ |
| 44 | +void assert_failed(uint8_t *file, uint32_t line); |
| 45 | +#else |
| 46 | +#define assert_param(expr) ((void)0U) |
| 47 | +#endif /* USE_FULL_ASSERT */ |
| 48 | + |
| 49 | +#ifdef __cplusplus |
| 50 | +} |
| 51 | +#endif |
| 52 | + |
| 53 | +#endif /* STM32_ASSERT_H */ |
0 commit comments