#include "pio.h"
#include <stdio.h>
Go to the source code of this file.
Defines |
#define | SOFTPACK_VERSION "1.5" |
#define | TRACE_LEVEL_DEBUG 5 |
#define | TRACE_LEVEL_INFO 4 |
#define | TRACE_LEVEL_WARNING 3 |
#define | TRACE_LEVEL_ERROR 2 |
#define | TRACE_LEVEL_FATAL 1 |
#define | TRACE_LEVEL_NO_TRACE 0 |
#define | TRACE_LEVEL TRACE_LEVEL_INFO |
#define | DYN_TRACES 0 |
#define | DYNTRACE 0 |
#define | TRACE_CONFIGURE_ISP(mode, baudrate, mck) |
#define | TRACE_DEBUG(...) { } |
#define | TRACE_DEBUG_WP(...) { } |
#define | TRACE_INFO(...) { printf("-I- " __VA_ARGS__); } |
#define | TRACE_INFO_WP(...) { printf(__VA_ARGS__); } |
#define | TRACE_WARNING(...) { printf("-W- " __VA_ARGS__); } |
#define | TRACE_WARNING_WP(...) { printf(__VA_ARGS__); } |
#define | TRACE_ERROR(...) { printf("-E- " __VA_ARGS__); } |
#define | TRACE_ERROR_WP(...) { printf(__VA_ARGS__); } |
#define | TRACE_FATAL(...) { printf("-F- " __VA_ARGS__); while (1); } |
#define | TRACE_FATAL_WP(...) { printf(__VA_ARGS__); while (1); } |
Functions |
void | TRACE_CONFIGURE (uint32_t dwBaudRate, uint32_t dwMCk) |
Detailed Description
- Purpose
Standard output methods for reporting debug information, warnings and errors, which can be easily be turned on/off.
- Usage
- Initialize the DBGU using TRACE_CONFIGURE() if you intend to eventually disable ALL traces; otherwise use DBGU_Configure().
- Uses the TRACE_DEBUG(), TRACE_INFO(), TRACE_WARNING(), TRACE_ERROR() TRACE_FATAL() macros to output traces throughout the program.
- Each type of trace has a level : Debug 5, Info 4, Warning 3, Error 2 and Fatal 1. Disable a group of traces by changing the value of TRACE_LEVEL during compilation; traces with a level bigger than TRACE_LEVEL are not generated. To generate no trace, use the reserved value 0.
- Trace disabling can be static or dynamic. If dynamic disabling is selected the trace level can be modified in runtime. If static disabling is selected the disabled traces are not compiled.
- traceLevels Trace level description
- TRACE_DEBUG (5): Traces whose only purpose is for debugging the program, and which do not produce meaningful information otherwise.
- TRACE_INFO (4): Informational trace about the program execution. Should enable the user to see the execution flow.
- TRACE_WARNING (3): Indicates that a minor error has happened. In most case it can be discarded safely; it may even be expected.
- TRACE_ERROR (2): Indicates an error which may not stop the program execution, but which indicates there is a problem with the code.
- TRACE_FATAL (1): Indicates a major error which prevents the program from going any further.
Definition in file trace.h.
Define Documentation
Initializes the DBGU for ISP project
- Parameters:
-
| mode | DBGU mode. |
| baudrate | DBGU baudrate. |
| mck | Master clock frequency. |
Definition at line 128 of file trace.h.
#define SOFTPACK_VERSION "1.5" |
Softpack Version
Definition at line 80 of file trace.h.
#define TRACE_CONFIGURE_ISP |
( |
|
mode, |
|
|
|
baudrate, |
|
|
|
mck | |
|
) |
| | |
#define TRACE_DEBUG |
( |
|
... |
) |
{ } |
Outputs a formatted string using 'printf' if the log level is high enough. Can be disabled by defining TRACE_LEVEL=0 during compilation.
- Parameters:
-
| ... | Additional parameters depending on formatted string. |
Definition at line 183 of file trace.h.
Function Documentation
void TRACE_CONFIGURE |
( |
uint32_t |
dwBaudRate, |
|
|
uint32_t |
dwMCk | |
|
) |
| | |
Trace level can be set at applet initialization Initializes the U(S)ART Console
- Parameters:
-
| dwBaudRate | U(S)ART baud-rate. |
| dwMCk | Master clock frequency. |
Definition at line 51 of file trace.c.