X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Fvariable_trace.h;h=dacc13858d229c2c9829e1ff5dadb0fecb299125;hb=64aef1f4c9296dc63d5e7b27102a276f84389a26;hp=9899816f6cb1d8fbf439be1d7c94f040b021ff11;hpb=a377017c95b826d83ac7a46ef176d39a58294b44;p=qmk_firmware.git diff --git a/quantum/variable_trace.h b/quantum/variable_trace.h index 9899816f6..dacc13858 100644 --- a/quantum/variable_trace.h +++ b/quantum/variable_trace.h @@ -1,13 +1,38 @@ +/* Copyright 2016 Fred Sundvik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef VARIABLE_TRACE_H #define VARIABLE_TRACE_H +// For more information about the variable tracing see the readme. + #include "print.h" #ifdef NUM_TRACED_VARIABLES +// Start tracing a variable at the memory address addr +// The name can be anything and is used only for reporting +// The size should usually be the same size as the variable you are interested in #define ADD_TRACED_VARIABLE(name, addr, size) \ add_traced_variable(PSTR(name), (void*)addr, size, PSTR(__FILE__), __LINE__) + +// Stop tracing the variable with the given name #define REMOVE_TRACED_VARIABLE(name) remove_traced_variable(PSTR(name), PSTR(__FILE__), __LINE__) + +// Call to get messages when the variable has been changed #define VERIFY_TRACED_VARIABLES() verify_traced_variables(PSTR(__FILE__), __LINE__) #else