X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Fvariable_trace.c;h=713747cfc2040a0ee33a210326f92ca0bb6f6fc1;hb=a25dd58bc56b0c4010673723ac44eaff914979bb;hp=dfa37bdef528168f20741d236585e35c61763c08;hpb=f519b94be7086852f2afe4ec248786b47968f7ff;p=qmk_firmware.git
diff --git a/quantum/variable_trace.c b/quantum/variable_trace.c
index dfa37bdef..713747cfc 100644
--- a/quantum/variable_trace.c
+++ b/quantum/variable_trace.c
@@ -1,3 +1,19 @@
+/* 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 .
+ */
+
#include "variable_trace.h"
#include
#include
@@ -12,7 +28,9 @@
#define NUM_TRACED_VARIABLES 1
-#define MAX_TRACE_SIZE 4
+#ifndef MAX_VARIABLE_TRACE_SIZE
+ #define MAX_VARIABLE_TRACE_SIZE 4
+#endif
typedef struct {
const char* name;
@@ -20,7 +38,7 @@ typedef struct {
unsigned size;
const char* func;
int line;
- uint8_t last_value[MAX_TRACE_SIZE];
+ uint8_t last_value[MAX_VARIABLE_TRACE_SIZE];
} traced_variable_t;
@@ -28,13 +46,13 @@ static traced_variable_t traced_variables[NUM_TRACED_VARIABLES];
void add_traced_variable(const char* name, void* addr, unsigned size, const char* func, int line) {
verify_traced_variables(func, line);
- if (size > MAX_TRACE_SIZE) {
+ if (size > MAX_VARIABLE_TRACE_SIZE) {
#if defined(__AVR__)
xprintf("Traced variable \"%S\" exceeds the maximum size %d\n", name, size);
#else
xprintf("Traced variable \"%s\" exceeds the maximum size %d\n", name, size);
#endif
- size = MAX_TRACE_SIZE;
+ size = MAX_VARIABLE_TRACE_SIZE;
}
int index = -1;
for (int i = 0; i < NUM_TRACED_VARIABLES; i++) {