summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/debug.c12
-rw-r--r--common/debug_config.h2
-rw-r--r--common/host.h4
-rw-r--r--common/print.h3
-rw-r--r--common/xprintf.h8
5 files changed, 23 insertions, 6 deletions
diff --git a/common/debug.c b/common/debug.c
new file mode 100644
index 0000000000..c4fa3a05b4
--- /dev/null
+++ b/common/debug.c
@@ -0,0 +1,12 @@
+#include <stdbool.h>
+#include "debug.h"
+
+
+//debug_config_t debug_config = { .enable = false, .matrix = false };
+debug_config_t debug_config = {
+ .enable = false,
+ .matrix = false,
+ .keyboard = false,
+ .mouse = false,
+};
+
diff --git a/common/debug_config.h b/common/debug_config.h
index e00fd10336..43e4c5c554 100644
--- a/common/debug_config.h
+++ b/common/debug_config.h
@@ -36,7 +36,7 @@ typedef union {
uint8_t reserved:4;
};
} debug_config_t;
-debug_config_t debug_config;
+extern debug_config_t debug_config;
/* for backward compatibility */
#define debug_enable (debug_config.enable)
diff --git a/common/host.h b/common/host.h
index a56e6c3b04..918af69e8f 100644
--- a/common/host.h
+++ b/common/host.h
@@ -32,8 +32,8 @@ extern "C" {
extern bool keyboard_nkro;
#endif
-uint8_t keyboard_idle;
-uint8_t keyboard_protocol;
+extern uint8_t keyboard_idle;
+extern uint8_t keyboard_protocol;
/* host driver */
diff --git a/common/print.h b/common/print.h
index 930e84be99..7799328910 100644
--- a/common/print.h
+++ b/common/print.h
@@ -34,10 +34,7 @@
// this macro allows you to write print("some text") and
// the string is automatically placed into flash memory :)
-// TODO: avoid collision with arduino/Print.h
-#ifndef __cplusplus
#define print(s) print_P(PSTR(s))
-#endif
#define println(s) print_P(PSTR(s "\n"))
/* for old name */
diff --git a/common/xprintf.h b/common/xprintf.h
index f58bca817b..59c6f25312 100644
--- a/common/xprintf.h
+++ b/common/xprintf.h
@@ -8,6 +8,10 @@
#include <inttypes.h>
#include <avr/pgmspace.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern void (*xfunc_out)(uint8_t);
#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func)
@@ -99,5 +103,9 @@ char xatoi(char **str, long *ret);
Pointer to return value
*/
+#ifdef __cplusplus
+}
+#endif
+
#endif