From c35e3e859645176459a7a9e74f1a7b3658d2832a Mon Sep 17 00:00:00 2001 From: Scott Jaderholm Date: Sun, 14 Sep 2014 21:37:20 -0700 Subject: [PATCH 1/3] usb_usb: Remove mention of merged usb_hid branch --- converter/usb_usb/README | 1 - 1 file changed, 1 deletion(-) diff --git a/converter/usb_usb/README b/converter/usb_usb/README index d0547cde90..70839dcfa8 100644 --- a/converter/usb_usb/README +++ b/converter/usb_usb/README @@ -14,7 +14,6 @@ Build firmware -------------- $ git clone git://github.com/tmk/tmk_keyboard.git $ cd tmk_keyboard - $ git checkout usb_hid $ git submodule init $ git submodule update From a59dea558ee4a19d941534f1006957a96aac7ce9 Mon Sep 17 00:00:00 2001 From: Scott Jaderholm Date: Sun, 14 Sep 2014 21:38:10 -0700 Subject: [PATCH 2/3] usb_usb: Remove mention of downloading LUFA --- converter/usb_usb/README | 3 --- 1 file changed, 3 deletions(-) diff --git a/converter/usb_usb/README b/converter/usb_usb/README index 70839dcfa8..a489371107 100644 --- a/converter/usb_usb/README +++ b/converter/usb_usb/README @@ -16,9 +16,6 @@ Build firmware $ cd tmk_keyboard $ git submodule init $ git submodule update - -and download LUFA and unzip under protocol/lufa and edit LUFA_PATH in protocol/lufa.mk. Then, - $ cd converter/usb_usb $ make From ea524d7befeb743c5316cb472f9180536ced5862 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 22 Sep 2014 10:42:20 +0900 Subject: [PATCH 3/3] Adhoc fix compile error of usb_usb --- common.mk | 1 + common/debug.c | 12 ++++++++++++ common/debug_config.h | 2 +- common/host.h | 4 ++-- common/print.h | 3 --- common/xprintf.h | 8 ++++++++ converter/usb_usb/config.h | 1 + converter/usb_usb/main.cpp | 1 - .../usb_hid/arduino-1.0.1/cores/arduino/WString.h | 2 +- protocol/usb_hid/override_wiring.c | 1 + protocol/usb_hid/parser.cpp | 2 -- 11 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 common/debug.c diff --git a/common.mk b/common.mk index 62ac0ff787..1cffc3cc22 100644 --- a/common.mk +++ b/common.mk @@ -9,6 +9,7 @@ SRC += $(COMMON_DIR)/host.c \ $(COMMON_DIR)/keymap.c \ $(COMMON_DIR)/timer.c \ $(COMMON_DIR)/print.c \ + $(COMMON_DIR)/debug.c \ $(COMMON_DIR)/bootloader.c \ $(COMMON_DIR)/suspend.c \ $(COMMON_DIR)/xprintf.S \ 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 +#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 #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 diff --git a/converter/usb_usb/config.h b/converter/usb_usb/config.h index ecf4ed9b19..d614973f7e 100644 --- a/converter/usb_usb/config.h +++ b/converter/usb_usb/config.h @@ -33,6 +33,7 @@ along with this program. If not, see . #define MATRIX_ROWS 32 #define MATRIX_COLS 8 +#define USE_LEGACY_KEYMAP /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/converter/usb_usb/main.cpp b/converter/usb_usb/main.cpp index 46c728e9b5..20b7af66a2 100644 --- a/converter/usb_usb/main.cpp +++ b/converter/usb_usb/main.cpp @@ -59,7 +59,6 @@ int main(void) LED_TX_INIT; LED_TX_ON; - print_enable = true; debug_enable = true; debug_matrix = true; debug_keyboard = true; diff --git a/protocol/usb_hid/arduino-1.0.1/cores/arduino/WString.h b/protocol/usb_hid/arduino-1.0.1/cores/arduino/WString.h index d76d2a33d4..947325e5f5 100644 --- a/protocol/usb_hid/arduino-1.0.1/cores/arduino/WString.h +++ b/protocol/usb_hid/arduino-1.0.1/cores/arduino/WString.h @@ -35,7 +35,7 @@ // -std=c++0x class __FlashStringHelper; -#define F(string_literal) (reinterpret_cast<__FlashStringHelper *>(PSTR(string_literal))) +#define F(string_literal) (reinterpret_cast(PSTR(string_literal))) // An inherited class for holding the result of a concatenation. These // result objects are assumed to be writable by subsequent concatenations. diff --git a/protocol/usb_hid/override_wiring.c b/protocol/usb_hid/override_wiring.c index 3b3f5e3028..1e9a94ce26 100644 --- a/protocol/usb_hid/override_wiring.c +++ b/protocol/usb_hid/override_wiring.c @@ -1,6 +1,7 @@ /* * To keep Timer0 for common/timer.c override arduino/wiring.c. */ +#define __DELAY_BACKWARD_COMPATIBLE__ #include #include "common/timer.h" #include "Arduino.h" diff --git a/protocol/usb_hid/parser.cpp b/protocol/usb_hid/parser.cpp index 66e949518e..28151f9d59 100644 --- a/protocol/usb_hid/parser.cpp +++ b/protocol/usb_hid/parser.cpp @@ -1,5 +1,3 @@ -#include - #include "parser.h" #include "usb_hid.h"