From ea524d7befeb743c5316cb472f9180536ced5862 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 22 Sep 2014 10:42:20 +0900 Subject: Adhoc fix compile error of usb_usb --- common/debug.c | 12 ++++++++++++ common/debug_config.h | 2 +- common/host.h | 4 ++-- common/print.h | 3 --- common/xprintf.h | 8 ++++++++ 5 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 common/debug.c (limited to 'common') diff --git a/common/debug.c b/common/debug.c new file mode 100644 index 000000000..c4fa3a05b --- /dev/null +++ b/common/debug.c @@ -0,0 +1,12 @@ +#include +#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 e00fd1033..43e4c5c55 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 a56e6c3b0..918af69e8 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 930e84be9..779932891 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 f58bca817..59c6f2531 100644 --- a/common/xprintf.h +++ b/common/xprintf.h @@ -8,6 +8,10 @@ #include #include +#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 -- cgit v1.2.3