diff options
| author | Fred Sundvik <fsundvik@gmail.com> | 2016-11-06 22:44:43 +0200 |
|---|---|---|
| committer | Fred Sundvik <fsundvik@gmail.com> | 2016-11-06 22:44:43 +0200 |
| commit | 0ba3e523a7c124e4ce54dfd043dc32e72ad3233b (patch) | |
| tree | 515031fe4d93e9841296d2a1adfe64817a75e6c1 /quantum/variable_trace.h | |
| parent | a377017c95b826d83ac7a46ef176d39a58294b44 (diff) | |
| download | qmk_firmware-0ba3e523a7c124e4ce54dfd043dc32e72ad3233b.tar.gz qmk_firmware-0ba3e523a7c124e4ce54dfd043dc32e72ad3233b.zip | |
Add documentation for the variable tracing
Diffstat (limited to 'quantum/variable_trace.h')
| -rw-r--r-- | quantum/variable_trace.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/quantum/variable_trace.h b/quantum/variable_trace.h index 9899816f6..46bd82786 100644 --- a/quantum/variable_trace.h +++ b/quantum/variable_trace.h | |||
| @@ -1,13 +1,22 @@ | |||
| 1 | #ifndef VARIABLE_TRACE_H | 1 | #ifndef VARIABLE_TRACE_H |
| 2 | #define VARIABLE_TRACE_H | 2 | #define VARIABLE_TRACE_H |
| 3 | 3 | ||
| 4 | // For more information about the variable tracing see the readme. | ||
| 5 | |||
| 4 | #include "print.h" | 6 | #include "print.h" |
| 5 | 7 | ||
| 6 | #ifdef NUM_TRACED_VARIABLES | 8 | #ifdef NUM_TRACED_VARIABLES |
| 7 | 9 | ||
| 10 | // Start tracing a variable at the memory address addr | ||
| 11 | // The name can be anything and is used only for reporting | ||
| 12 | // The size should usually be the same size as the variable you are interested in | ||
| 8 | #define ADD_TRACED_VARIABLE(name, addr, size) \ | 13 | #define ADD_TRACED_VARIABLE(name, addr, size) \ |
| 9 | add_traced_variable(PSTR(name), (void*)addr, size, PSTR(__FILE__), __LINE__) | 14 | add_traced_variable(PSTR(name), (void*)addr, size, PSTR(__FILE__), __LINE__) |
| 15 | |||
| 16 | // Stop tracing the variable with the given name | ||
| 10 | #define REMOVE_TRACED_VARIABLE(name) remove_traced_variable(PSTR(name), PSTR(__FILE__), __LINE__) | 17 | #define REMOVE_TRACED_VARIABLE(name) remove_traced_variable(PSTR(name), PSTR(__FILE__), __LINE__) |
| 18 | |||
| 19 | // Call to get messages when the variable has been changed | ||
| 11 | #define VERIFY_TRACED_VARIABLES() verify_traced_variables(PSTR(__FILE__), __LINE__) | 20 | #define VERIFY_TRACED_VARIABLES() verify_traced_variables(PSTR(__FILE__), __LINE__) |
| 12 | 21 | ||
| 13 | #else | 22 | #else |
