]> git.donarmstrong.com Git - tmk_firmware.git/commitdiff
Adhoc fix compile error of usb_usb
authortmk <nobody@nowhere>
Mon, 22 Sep 2014 01:42:20 +0000 (10:42 +0900)
committertmk <nobody@nowhere>
Mon, 22 Sep 2014 01:42:20 +0000 (10:42 +0900)
common.mk
common/debug.c [new file with mode: 0644]
common/debug_config.h
common/host.h
common/print.h
common/xprintf.h
converter/usb_usb/config.h
converter/usb_usb/main.cpp
protocol/usb_hid/arduino-1.0.1/cores/arduino/WString.h
protocol/usb_hid/override_wiring.c
protocol/usb_hid/parser.cpp

index 62ac0ff787e9dba800cb8a0375b9bc69001de43e..1cffc3cc22c5d7b46adf24267a50c2d612f3b115 100644 (file)
--- 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 (file)
index 0000000..c4fa3a0
--- /dev/null
@@ -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,
+};
+
index e00fd10336768d2e8a0d289c6fe9aedcfdd7d8d4..43e4c5c554248dd349ad07adc808b5be48293114 100644 (file)
@@ -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)
index a56e6c3b04f05d115eb8d408213c7fbc86f6b445..918af69e8f41242083912519d9486b16f758572a 100644 (file)
@@ -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 */
index 930e84be99d555871aec946f27cf2c49f909eb76..7799328910eb96d93096c9d210c3ebbb6f03e402 100644 (file)
 
 // 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 */
index f58bca817be791356cc11b2aed9a16841e03618d..59c6f253123957e4aa7527c0bdc5b47d392563ef 100644 (file)
@@ -8,6 +8,10 @@
 #include <inttypes.h>\r
 #include <avr/pgmspace.h>\r
 \r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
 extern void (*xfunc_out)(uint8_t);\r
 #define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func)\r
 \r
@@ -99,5 +103,9 @@ char xatoi(char **str, long *ret);
     Pointer to return value\r
 */\r
 \r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
 #endif\r
 \r
index ecf4ed9b191dcce3aaf62d2fcd39a4a0d5c979b1..d614973f7ebf4a4c3821d6e4e8f3bb2ed5114399 100644 (file)
@@ -33,6 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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))) 
index 46c728e9b56318744f5a72c4550c9541d97dbc81..20b7af66a25a56b61f2db2f320a9383e3a872aaf 100644 (file)
@@ -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;
index d76d2a33d4489b91784482e79f173234cb03b6a8..947325e5f5d4ee8f8ff15959af59eb7464667d3d 100644 (file)
@@ -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<const __FlashStringHelper *>(PSTR(string_literal)))
 
 // An inherited class for holding the result of a concatenation.  These
 // result objects are assumed to be writable by subsequent concatenations.
index 3b3f5e30283f9b25372c169e39d70434aa262743..1e9a94ce266d8608e024304a2a9e03fcd80ea042 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * To keep Timer0 for common/timer.c override arduino/wiring.c.
  */
+#define __DELAY_BACKWARD_COMPATIBLE__
 #include <util/delay.h>
 #include "common/timer.h"
 #include "Arduino.h"
index 66e949518e04cbcbf4c39bcb068ab8b53d2521d2..28151f9d59369e5192129f249bc892db62c3a8f1 100644 (file)
@@ -1,5 +1,3 @@
-#include <cstring.h>
-
 #include "parser.h"
 #include "usb_hid.h"