CARME-M4 BSP  V1.5
assert.c
Go to the documentation of this file.
1 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif /* __cplusplus */
76 
77 /*----- Header-Files -------------------------------------------------------*/
78 #include <assert.h> /* Assertion handling */
79 #include <stdio.h> /* Standard input and output */
80 
81 #include <stm32f4xx.h> /* Processor STM32F407IG */
82 #include <carme.h> /* CARME Module */
83 #include <uart.h> /* CARME BSP UART port */
84 
85 /*----- Macros -------------------------------------------------------------*/
86 
87 /*----- Data types ---------------------------------------------------------*/
88 
89 /*----- Function prototypes ------------------------------------------------*/
90 
91 /*----- Data ---------------------------------------------------------------*/
92 
93 /*----- Implementation -----------------------------------------------------*/
94 #ifndef NDEBUG
95 
106 void __assert(const char *file, int line, const char *func) {
107 
108  printf("Assert failed in file %s on line %d in function %s\n", file, line,
109  func);
110 
111  while (1)
112  ;
113 }
114 
127 void __assert_func(const char *file, int line, const char *func,
128  const char *additional) {
129 
130  printf("Assert failed in file %s on line %d in function %s, additional %s\n",
131  file, line, func, additional);
132 
133  while (1)
134  ;
135 }
136 #endif /* NDEBUG */
137 
138 #ifdef USE_FULL_ASSERT
139 
150 void assert_failed(uint8_t* file, uint32_t line) {
151 
152  printf("Assert failed in file %s on line %lu\n", file, line);
153 
154  while (1)
155  ;
156 }
157 #endif /* USE_FULL_ASSERT */
158 
159 #ifdef __cplusplus
160 }
161 #endif /* __cplusplus */
162 
void __assert_func(const char *file, int line, const char *func, const char *additional)
Reports the name of the source file and the source line number where the assert error has occurred...
Definition: assert.c:127
The CARME UART Module provides a function to initialize the GPIOs for the CARME UART ports...
void __assert(const char *file, int line, const char *func)
Reports the name of the source file and the source line number where the assert error has occurred...
Definition: assert.c:106