aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2014-09-22 10:42:20 +0900
committertmk <nobody@nowhere>2014-09-22 10:42:20 +0900
commitea524d7befeb743c5316cb472f9180536ced5862 (patch)
tree1be232413b52bcac278d25be074c5394f069c283
parentb9e265368fde73daff069788dcb58c8230d01b32 (diff)
downloadqmk_firmware-ea524d7befeb743c5316cb472f9180536ced5862.tar.gz
qmk_firmware-ea524d7befeb743c5316cb472f9180536ced5862.zip
Adhoc fix compile error of usb_usb
-rw-r--r--common.mk1
-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
-rw-r--r--converter/usb_usb/config.h1
-rw-r--r--converter/usb_usb/main.cpp1
-rw-r--r--protocol/usb_hid/arduino-1.0.1/cores/arduino/WString.h2
-rw-r--r--protocol/usb_hid/override_wiring.c1
-rw-r--r--protocol/usb_hid/parser.cpp2
11 files changed, 27 insertions, 10 deletions
diff --git a/common.mk b/common.mk
index 62ac0ff78..1cffc3cc2 100644
--- a/common.mk
+++ b/common.mk
@@ -9,6 +9,7 @@ SRC += $(COMMON_DIR)/host.c \
9 $(COMMON_DIR)/keymap.c \ 9 $(COMMON_DIR)/keymap.c \
10 $(COMMON_DIR)/timer.c \ 10 $(COMMON_DIR)/timer.c \
11 $(COMMON_DIR)/print.c \ 11 $(COMMON_DIR)/print.c \
12 $(COMMON_DIR)/debug.c \
12 $(COMMON_DIR)/bootloader.c \ 13 $(COMMON_DIR)/bootloader.c \
13 $(COMMON_DIR)/suspend.c \ 14 $(COMMON_DIR)/suspend.c \
14 $(COMMON_DIR)/xprintf.S \ 15 $(COMMON_DIR)/xprintf.S \
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 @@
1#include <stdbool.h>
2#include "debug.h"
3
4
5//debug_config_t debug_config = { .enable = false, .matrix = false };
6debug_config_t debug_config = {
7 .enable = false,
8 .matrix = false,
9 .keyboard = false,
10 .mouse = false,
11};
12
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 {
36 uint8_t reserved:4; 36 uint8_t reserved:4;
37 }; 37 };
38} debug_config_t; 38} debug_config_t;
39debug_config_t debug_config; 39extern debug_config_t debug_config;
40 40
41/* for backward compatibility */ 41/* for backward compatibility */
42#define debug_enable (debug_config.enable) 42#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" {
32extern bool keyboard_nkro; 32extern bool keyboard_nkro;
33#endif 33#endif
34 34
35uint8_t keyboard_idle; 35extern uint8_t keyboard_idle;
36uint8_t keyboard_protocol; 36extern uint8_t keyboard_protocol;
37 37
38 38
39/* host driver */ 39/* 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 @@
34 34
35// this macro allows you to write print("some text") and 35// this macro allows you to write print("some text") and
36// the string is automatically placed into flash memory :) 36// the string is automatically placed into flash memory :)
37// TODO: avoid collision with arduino/Print.h
38#ifndef __cplusplus
39#define print(s) print_P(PSTR(s)) 37#define print(s) print_P(PSTR(s))
40#endif
41#define println(s) print_P(PSTR(s "\n")) 38#define println(s) print_P(PSTR(s "\n"))
42 39
43/* for old name */ 40/* 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 @@
8#include <inttypes.h> 8#include <inttypes.h>
9#include <avr/pgmspace.h> 9#include <avr/pgmspace.h>
10 10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
11extern void (*xfunc_out)(uint8_t); 15extern void (*xfunc_out)(uint8_t);
12#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func) 16#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func)
13 17
@@ -99,5 +103,9 @@ char xatoi(char **str, long *ret);
99 Pointer to return value 103 Pointer to return value
100*/ 104*/
101 105
106#ifdef __cplusplus
107}
108#endif
109
102#endif 110#endif
103 111
diff --git a/converter/usb_usb/config.h b/converter/usb_usb/config.h
index ecf4ed9b1..d614973f7 100644
--- a/converter/usb_usb/config.h
+++ b/converter/usb_usb/config.h
@@ -33,6 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33#define MATRIX_ROWS 32 33#define MATRIX_ROWS 32
34#define MATRIX_COLS 8 34#define MATRIX_COLS 8
35 35
36#define USE_LEGACY_KEYMAP
36 37
37/* key combination for command */ 38/* key combination for command */
38#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) 39#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 46c728e9b..20b7af66a 100644
--- a/converter/usb_usb/main.cpp
+++ b/converter/usb_usb/main.cpp
@@ -59,7 +59,6 @@ int main(void)
59 LED_TX_INIT; 59 LED_TX_INIT;
60 LED_TX_ON; 60 LED_TX_ON;
61 61
62 print_enable = true;
63 debug_enable = true; 62 debug_enable = true;
64 debug_matrix = true; 63 debug_matrix = true;
65 debug_keyboard = true; 64 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 d76d2a33d..947325e5f 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 @@
35// -std=c++0x 35// -std=c++0x
36 36
37class __FlashStringHelper; 37class __FlashStringHelper;
38#define F(string_literal) (reinterpret_cast<__FlashStringHelper *>(PSTR(string_literal))) 38#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
39 39
40// An inherited class for holding the result of a concatenation. These 40// An inherited class for holding the result of a concatenation. These
41// result objects are assumed to be writable by subsequent concatenations. 41// 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 3b3f5e302..1e9a94ce2 100644
--- a/protocol/usb_hid/override_wiring.c
+++ b/protocol/usb_hid/override_wiring.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * To keep Timer0 for common/timer.c override arduino/wiring.c. 2 * To keep Timer0 for common/timer.c override arduino/wiring.c.
3 */ 3 */
4#define __DELAY_BACKWARD_COMPATIBLE__
4#include <util/delay.h> 5#include <util/delay.h>
5#include "common/timer.h" 6#include "common/timer.h"
6#include "Arduino.h" 7#include "Arduino.h"
diff --git a/protocol/usb_hid/parser.cpp b/protocol/usb_hid/parser.cpp
index 66e949518..28151f9d5 100644
--- a/protocol/usb_hid/parser.cpp
+++ b/protocol/usb_hid/parser.cpp
@@ -1,5 +1,3 @@
1#include <cstring.h>
2
3#include "parser.h" 1#include "parser.h"
4#include "usb_hid.h" 2#include "usb_hid.h"
5 3