forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility to control variable trace from make
- Loading branch information
1 parent
f519b94
commit a377017
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef VARIABLE_TRACE_H | ||
#define VARIABLE_TRACE_H | ||
|
||
#include "print.h" | ||
|
||
#ifdef NUM_TRACED_VARIABLES | ||
|
||
#define ADD_TRACED_VARIABLE(name, addr, size) \ | ||
add_traced_variable(PSTR(name), (void*)addr, size, PSTR(__FILE__), __LINE__) | ||
#define REMOVE_TRACED_VARIABLE(name) remove_traced_variable(PSTR(name), PSTR(__FILE__), __LINE__) | ||
#define VERIFY_TRACED_VARIABLES() verify_traced_variables(PSTR(__FILE__), __LINE__) | ||
|
||
#else | ||
|
||
#define ADD_TRACED_VARIABLE(name, addr, size) | ||
#define REMOVE_TRACED_VARIABLE(name) | ||
#define VERIFY_TRACED_VARIABLES() | ||
|
||
#endif | ||
|
||
// Don't call directly, use the macros instead | ||
void add_traced_variable(const char* name, void* addr, unsigned size, const char* func, int line); | ||
void remove_traced_variable(const char* name, const char* func, int line); | ||
void verify_traced_variables(const char* func, int line); | ||
#endif |