diff options
author | IBNobody <ibnobody@gmail.com> | 2016-04-17 12:54:32 -0500 |
---|---|---|
committer | IBNobody <ibnobody@gmail.com> | 2016-04-17 12:54:32 -0500 |
commit | d5b72e7bde5ede25f7d5699b50b7d9eb6f31ba92 (patch) | |
tree | 906fb97e49f1db6e3ddbbbca07cb3ff930d187d6 /tmk_core/common | |
parent | c940e87235c9fe26f5c7451464af54a493270a68 (diff) | |
download | qmk_firmware-d5b72e7bde5ede25f7d5699b50b7d9eb6f31ba92.tar.gz qmk_firmware-d5b72e7bde5ede25f7d5699b50b7d9eb6f31ba92.zip |
Fixed many compiler warnings related to print being disabled
Diffstat (limited to 'tmk_core/common')
-rw-r--r-- | tmk_core/common/action.c | 8 | ||||
-rw-r--r-- | tmk_core/common/action_layer.c | 12 | ||||
-rw-r--r-- | tmk_core/common/action_macro.c | 8 | ||||
-rw-r--r-- | tmk_core/common/action_tapping.c | 11 | ||||
-rw-r--r-- | tmk_core/common/command.c | 25 | ||||
-rw-r--r-- | tmk_core/common/print.h | 12 |
6 files changed, 42 insertions, 34 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index f9e6c17dc..0162fbd63 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c | |||
@@ -27,11 +27,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
27 | #include "action_util.h" | 27 | #include "action_util.h" |
28 | #include "action.h" | 28 | #include "action.h" |
29 | 29 | ||
30 | #ifdef DEBUG_ACTION | 30 | //#ifdef DEBUG_ACTION |
31 | #include "debug.h" | 31 | #include "debug.h" |
32 | #else | 32 | //#else |
33 | #include "nodebug.h" | 33 | //#include "nodebug.h" |
34 | #endif | 34 | //#endif |
35 | 35 | ||
36 | 36 | ||
37 | void action_exec(keyevent_t event) | 37 | void action_exec(keyevent_t event) |
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index e817c0d51..845fbbb21 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c | |||
@@ -4,14 +4,14 @@ | |||
4 | #include "util.h" | 4 | #include "util.h" |
5 | #include "action_layer.h" | 5 | #include "action_layer.h" |
6 | 6 | ||
7 | #ifdef DEBUG_ACTION | 7 | //#ifdef DEBUG_ACTION |
8 | #include "debug.h" | 8 | #include "debug.h" |
9 | #else | 9 | //#else |
10 | #include "nodebug.h" | 10 | //#include "nodebug.h" |
11 | #endif | 11 | //#endif |
12 | 12 | ||
13 | 13 | ||
14 | /* | 14 | /* |
15 | * Default Layer State | 15 | * Default Layer State |
16 | */ | 16 | */ |
17 | uint32_t default_layer_state = 0; | 17 | uint32_t default_layer_state = 0; |
@@ -52,7 +52,7 @@ void default_layer_xor(uint32_t state) | |||
52 | 52 | ||
53 | 53 | ||
54 | #ifndef NO_ACTION_LAYER | 54 | #ifndef NO_ACTION_LAYER |
55 | /* | 55 | /* |
56 | * Keymap Layer State | 56 | * Keymap Layer State |
57 | */ | 57 | */ |
58 | uint32_t layer_state = 0; | 58 | uint32_t layer_state = 0; |
diff --git a/tmk_core/common/action_macro.c b/tmk_core/common/action_macro.c index 7726b1190..cc78c8232 100644 --- a/tmk_core/common/action_macro.c +++ b/tmk_core/common/action_macro.c | |||
@@ -19,11 +19,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
19 | #include "action_macro.h" | 19 | #include "action_macro.h" |
20 | #include "wait.h" | 20 | #include "wait.h" |
21 | 21 | ||
22 | #ifdef DEBUG_ACTION | 22 | //#ifdef DEBUG_ACTION |
23 | #include "debug.h" | 23 | #include "debug.h" |
24 | #else | 24 | //#else |
25 | #include "nodebug.h" | 25 | //#include "nodebug.h" |
26 | #endif | 26 | //#endif |
27 | 27 | ||
28 | 28 | ||
29 | #ifndef NO_ACTION_MACRO | 29 | #ifndef NO_ACTION_MACRO |
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c index 826c23309..6b6fa1dfe 100644 --- a/tmk_core/common/action_tapping.c +++ b/tmk_core/common/action_tapping.c | |||
@@ -6,11 +6,11 @@ | |||
6 | #include "keycode.h" | 6 | #include "keycode.h" |
7 | #include "timer.h" | 7 | #include "timer.h" |
8 | 8 | ||
9 | #ifdef DEBUG_ACTION | 9 | //#ifdef DEBUG_ACTION |
10 | #include "debug.h" | 10 | #include "debug.h" |
11 | #else | 11 | //#else |
12 | #include "nodebug.h" | 12 | //#include "nodebug.h" |
13 | #endif | 13 | //#endif |
14 | 14 | ||
15 | #ifndef NO_ACTION_TAPPING | 15 | #ifndef NO_ACTION_TAPPING |
16 | 16 | ||
@@ -139,7 +139,7 @@ bool process_tapping(keyrecord_t *keyp) | |||
139 | if (event.pressed) { | 139 | if (event.pressed) { |
140 | tapping_key.tap.interrupted = true; | 140 | tapping_key.tap.interrupted = true; |
141 | } | 141 | } |
142 | // enqueue | 142 | // enqueue |
143 | return false; | 143 | return false; |
144 | } | 144 | } |
145 | } | 145 | } |
@@ -324,6 +324,7 @@ bool waiting_buffer_typed(keyevent_t event) | |||
324 | return false; | 324 | return false; |
325 | } | 325 | } |
326 | 326 | ||
327 | __attribute__((unused)) | ||
327 | bool waiting_buffer_has_anykey_pressed(void) | 328 | bool waiting_buffer_has_anykey_pressed(void) |
328 | { | 329 | { |
329 | for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { | 330 | for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { |
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index b4cd3ca56..7572b9597 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c | |||
@@ -122,7 +122,7 @@ static void command_common_help(void) | |||
122 | STR(MAGIC_KEY_VERSION ) ": Version\n" | 122 | STR(MAGIC_KEY_VERSION ) ": Version\n" |
123 | STR(MAGIC_KEY_STATUS ) ": Status\n" | 123 | STR(MAGIC_KEY_STATUS ) ": Status\n" |
124 | STR(MAGIC_KEY_CONSOLE ) ": Activate Console Mode\n" | 124 | STR(MAGIC_KEY_CONSOLE ) ": Activate Console Mode\n" |
125 | 125 | ||
126 | #if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM | 126 | #if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM |
127 | STR(MAGIC_KEY_LAYER0 ) ": Switch to Layer 0\n" | 127 | STR(MAGIC_KEY_LAYER0 ) ": Switch to Layer 0\n" |
128 | STR(MAGIC_KEY_LAYER1 ) ": Switch to Layer 1\n" | 128 | STR(MAGIC_KEY_LAYER1 ) ": Switch to Layer 1\n" |
@@ -136,11 +136,11 @@ static void command_common_help(void) | |||
136 | STR(MAGIC_KEY_LAYER9 ) ": Switch to Layer 9\n" | 136 | STR(MAGIC_KEY_LAYER9 ) ": Switch to Layer 9\n" |
137 | #endif | 137 | #endif |
138 | 138 | ||
139 | #if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS | 139 | #if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS |
140 | "F1-F10: Switch to Layer 0-9 (F10 = L0)\n" | 140 | "F1-F10: Switch to Layer 0-9 (F10 = L0)\n" |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | #if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS | 143 | #if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS |
144 | "0-9: Switch to Layer 0-9\n" | 144 | "0-9: Switch to Layer 0-9\n" |
145 | #endif | 145 | #endif |
146 | 146 | ||
@@ -251,6 +251,7 @@ static void print_status(void) | |||
251 | #ifdef BOOTMAGIC_ENABLE | 251 | #ifdef BOOTMAGIC_ENABLE |
252 | static void print_eeconfig(void) | 252 | static void print_eeconfig(void) |
253 | { | 253 | { |
254 | #ifndef NO_PRINT | ||
254 | print("default_layer: "); print_dec(eeconfig_read_default_layer()); print("\n"); | 255 | print("default_layer: "); print_dec(eeconfig_read_default_layer()); print("\n"); |
255 | 256 | ||
256 | debug_config_t dc; | 257 | debug_config_t dc; |
@@ -279,9 +280,12 @@ static void print_eeconfig(void) | |||
279 | print("backlight_config.raw: "); print_hex8(bc.raw); print("\n"); | 280 | print("backlight_config.raw: "); print_hex8(bc.raw); print("\n"); |
280 | print(".enable: "); print_dec(bc.enable); print("\n"); | 281 | print(".enable: "); print_dec(bc.enable); print("\n"); |
281 | print(".level: "); print_dec(bc.level); print("\n"); | 282 | print(".level: "); print_dec(bc.level); print("\n"); |
282 | #endif | 283 | #endif /* BACKLIGHT_ENABLE */ |
284 | |||
285 | #endif /* !NO_PRINT */ | ||
286 | |||
283 | } | 287 | } |
284 | #endif | 288 | #endif /* BOOTMAGIC_ENABLE */ |
285 | 289 | ||
286 | static bool command_common(uint8_t code) | 290 | static bool command_common(uint8_t code) |
287 | { | 291 | { |
@@ -305,7 +309,7 @@ static bool command_common(uint8_t code) | |||
305 | #ifdef BOOTMAGIC_ENABLE | 309 | #ifdef BOOTMAGIC_ENABLE |
306 | 310 | ||
307 | // print stored eeprom config | 311 | // print stored eeprom config |
308 | case MAGIC_KC(MAGIC_KEY_EEPROM): | 312 | case MAGIC_KC(MAGIC_KEY_EEPROM): |
309 | print("eeconfig:\n"); | 313 | print("eeconfig:\n"); |
310 | print_eeconfig(); | 314 | print_eeconfig(); |
311 | break; | 315 | break; |
@@ -369,7 +373,7 @@ static bool command_common(uint8_t code) | |||
369 | break; | 373 | break; |
370 | 374 | ||
371 | // debug matrix toggle | 375 | // debug matrix toggle |
372 | case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX): | 376 | case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX): |
373 | debug_matrix = !debug_matrix; | 377 | debug_matrix = !debug_matrix; |
374 | if (debug_matrix) { | 378 | if (debug_matrix) { |
375 | print("\nmatrix: on\n"); | 379 | print("\nmatrix: on\n"); |
@@ -380,7 +384,7 @@ static bool command_common(uint8_t code) | |||
380 | break; | 384 | break; |
381 | 385 | ||
382 | // debug keyboard toggle | 386 | // debug keyboard toggle |
383 | case MAGIC_KC(MAGIC_KEY_DEBUG_KBD): | 387 | case MAGIC_KC(MAGIC_KEY_DEBUG_KBD): |
384 | debug_keyboard = !debug_keyboard; | 388 | debug_keyboard = !debug_keyboard; |
385 | if (debug_keyboard) { | 389 | if (debug_keyboard) { |
386 | print("\nkeyboard: on\n"); | 390 | print("\nkeyboard: on\n"); |
@@ -551,6 +555,7 @@ static uint8_t mousekey_param = 0; | |||
551 | 555 | ||
552 | static void mousekey_param_print(void) | 556 | static void mousekey_param_print(void) |
553 | { | 557 | { |
558 | #ifndef NO_PRINT | ||
554 | print("\n\t- Values -\n"); | 559 | print("\n\t- Values -\n"); |
555 | print("1: delay(*10ms): "); pdec(mk_delay); print("\n"); | 560 | print("1: delay(*10ms): "); pdec(mk_delay); print("\n"); |
556 | print("2: interval(ms): "); pdec(mk_interval); print("\n"); | 561 | print("2: interval(ms): "); pdec(mk_interval); print("\n"); |
@@ -558,6 +563,8 @@ static void mousekey_param_print(void) | |||
558 | print("4: time_to_max: "); pdec(mk_time_to_max); print("\n"); | 563 | print("4: time_to_max: "); pdec(mk_time_to_max); print("\n"); |
559 | print("5: wheel_max_speed: "); pdec(mk_wheel_max_speed); print("\n"); | 564 | print("5: wheel_max_speed: "); pdec(mk_wheel_max_speed); print("\n"); |
560 | print("6: wheel_time_to_max: "); pdec(mk_wheel_time_to_max); print("\n"); | 565 | print("6: wheel_time_to_max: "); pdec(mk_wheel_time_to_max); print("\n"); |
566 | #endif /* !NO_PRINT */ | ||
567 | |||
561 | } | 568 | } |
562 | 569 | ||
563 | //#define PRINT_SET_VAL(v) print(#v " = "); print_dec(v); print("\n"); | 570 | //#define PRINT_SET_VAL(v) print(#v " = "); print_dec(v); print("\n"); |
@@ -677,7 +684,7 @@ static void mousekey_console_help(void) | |||
677 | "pgdown: -10\n" | 684 | "pgdown: -10\n" |
678 | "\n" | 685 | "\n" |
679 | "speed = delta * max_speed * (repeat / time_to_max)\n"); | 686 | "speed = delta * max_speed * (repeat / time_to_max)\n"); |
680 | xprintf("where delta: cursor=%d, wheel=%d\n" | 687 | xprintf("where delta: cursor=%d, wheel=%d\n" |
681 | "See http://en.wikipedia.org/wiki/Mouse_keys\n", MOUSEKEY_MOVE_DELTA, MOUSEKEY_WHEEL_DELTA); | 688 | "See http://en.wikipedia.org/wiki/Mouse_keys\n", MOUSEKEY_MOVE_DELTA, MOUSEKEY_WHEEL_DELTA); |
682 | } | 689 | } |
683 | 690 | ||
diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index c0e9e1430..4f3dde65a 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h | |||
@@ -2,17 +2,17 @@ | |||
2 | /* Very basic print functions, intended to be used with usb_debug_only.c | 2 | /* Very basic print functions, intended to be used with usb_debug_only.c |
3 | * http://www.pjrc.com/teensy/ | 3 | * http://www.pjrc.com/teensy/ |
4 | * Copyright (c) 2008 PJRC.COM, LLC | 4 | * Copyright (c) 2008 PJRC.COM, LLC |
5 | * | 5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | * of this software and associated documentation files (the "Software"), to deal | 7 | * of this software and associated documentation files (the "Software"), to deal |
8 | * in the Software without restriction, including without limitation the rights | 8 | * in the Software without restriction, including without limitation the rights |
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 | * copies of the Software, and to permit persons to whom the Software is | 10 | * copies of the Software, and to permit persons to whom the Software is |
11 | * furnished to do so, subject to the following conditions: | 11 | * furnished to do so, subject to the following conditions: |
12 | * | 12 | * |
13 | * The above copyright notice and this permission notice shall be included in | 13 | * The above copyright notice and this permission notice shall be included in |
14 | * all copies or substantial portions of the Software. | 14 | * all copies or substantial portions of the Software. |
15 | * | 15 | * |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
@@ -91,9 +91,9 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); | |||
91 | 91 | ||
92 | #else /* NO_PRINT */ | 92 | #else /* NO_PRINT */ |
93 | 93 | ||
94 | #define xprintf | 94 | #define xprintf(fmt, ...) |
95 | #define print | 95 | #define print(s) |
96 | #define println | 96 | #define println(s) |
97 | #define print_set_sendchar(func) | 97 | #define print_set_sendchar(func) |
98 | #define print_dec(data) | 98 | #define print_dec(data) |
99 | #define print_decs(data) | 99 | #define print_decs(data) |