From: flabbergast Date: Thu, 3 Dec 2015 09:05:09 +0000 (+0000) Subject: Workaround for compiler warnings when console disabled. X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=b110884a6d55a7d126e59a43e6481ca51c52e5e8;p=max%2Ftmk_keyboard.git Workaround for compiler warnings when console disabled. --- diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index 4ef0b077..69209700 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -350,10 +350,11 @@ static bool command_common(uint8_t code) case KC_N: clear_keyboard(); //Prevents stuck keys. keyboard_nkro = !keyboard_nkro; - if (keyboard_nkro) + if (keyboard_nkro) { print("NKRO: on\n"); - else + } else { print("NKRO: off\n"); + } break; #endif case KC_ESC: @@ -607,10 +608,11 @@ static bool mousekey_console(uint8_t code) print("?"); return false; } - if (mousekey_param) + if (mousekey_param) { xprintf("M%d> ", mousekey_param); - else + } else { print("M>" ); + } return true; } #endif diff --git a/tmk_core/common/nodebug.h b/tmk_core/common/nodebug.h index 93309ada..6ef9f91a 100644 --- a/tmk_core/common/nodebug.h +++ b/tmk_core/common/nodebug.h @@ -18,7 +18,9 @@ along with this program. If not, see . #ifndef NODEBUG_H #define NODEBUG_H 1 +#if !defined(NO_DEBUG) #define NO_DEBUG +#endif #include "debug.h" #undef NO_DEBUG diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index 1e1b9b40..5f491aba 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -99,9 +99,9 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); #else /* NO_PRINT */ -#define xprintf -#define print -#define println +#define xprintf(s,...) +#define print(s) +#define println(s) #define print_set_sendchar(func) #define print_dec(data) #define print_decs(data) @@ -127,6 +127,7 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); #define print_val_bin_reverse8(v) #define print_val_bin_reverse16(v) #define print_val_bin_reverse32(v) +#define init_printf(s,ss) #endif /* NO_PRINT */