TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
tm_stm32f4_swo.h
1 
30 #ifndef TM_SWO_H
31 #define TM_SWO_H 100
32 
33 /* C++ detection */
34 #ifdef __cplusplus
35 extern C {
36 #endif
37 
113 #include "stm32f4xx.h"
114 #include "defines.h"
115 #include "stdio.h"
116 #include "tm_stm32f4_stdio.h"
117 
127 #ifndef SWO_DEBUG_ENABLED
128 #define SWO_DEBUG_ENABLED 1
129 #endif
130 
131 #if SWO_DEBUG_ENABLED == 1
132  /* FILE struct for working with stream */
133  extern FILE TM_SWO_File;
134 #endif
135 
155 #if SWO_DEBUG_ENABLED == 1
156  /* Debugging enabled, initialize functionality */
157  extern void TM_SWO_Init(void);
158 #else
159  /* Do nothing here, compiler will throw out this statement because it is empty */
160  #define TM_SWO_Init()
161 #endif
162 
174 #if SWO_DEBUG_ENABLED == 1
175  /* Format and output data to the SWO output with stream */
176  #define TM_SWO_Printf(args...) { fprintf(&TM_SWO_File, ## args); }
177 #else
178  /* Do nothing here, compiler will throw out this statement because it is empty */
179  #define TM_SWO_Printf(args...)
180 #endif
181 
182 
195 /* C++ detection */
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif
void TM_SWO_Init(void)
Initializes SWO debug output.