]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Workaround for compiler warnings when console disabled.
authorflabbergast <s3+flabbergast@sdfeu.org>
Thu, 3 Dec 2015 09:05:09 +0000 (09:05 +0000)
committerflabbergast <s3+flabbergast@sdfeu.org>
Thu, 3 Dec 2015 09:05:09 +0000 (09:05 +0000)
tmk_core/common/command.c
tmk_core/common/nodebug.h
tmk_core/common/print.h

index 4ef0b077d6e63ce594ec69d7078088b5a7332f4e..6920970020cc3f0a8ec72e645940b39132074362 100644 (file)
@@ -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
index 93309ada4761f356ee82b7bba2b3871ad7a236dc..6ef9f91a2857fd441cebf07d49eae19d36145ba7 100644 (file)
@@ -18,7 +18,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef NODEBUG_H
 #define NODEBUG_H 1
 
+#if !defined(NO_DEBUG)
 #define NO_DEBUG
+#endif
 #include "debug.h"
 #undef NO_DEBUG
 
index 1e1b9b402a68748f14e7bf06c292a7a3877fe12e..5f491abac96f348aa6a2d0a2e8816509e67135e2 100644 (file)
@@ -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 */