]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Fixed many compiler warnings related to print being disabled
authorIBNobody <ibnobody@gmail.com>
Sun, 17 Apr 2016 17:54:32 +0000 (12:54 -0500)
committerIBNobody <ibnobody@gmail.com>
Sun, 17 Apr 2016 17:54:32 +0000 (12:54 -0500)
quantum/keymap_common.c
tmk_core/common/action.c
tmk_core/common/action_layer.c
tmk_core/common/action_macro.c
tmk_core/common/action_tapping.c
tmk_core/common/command.c
tmk_core/common/print.h
tmk_core/protocol/lufa/lufa.c

index 61a51aedb43e46cafaddb030870b7359a0add532..ce1d007f3a5f411ec890ffd90f29dab6eaf4b1fa 100644 (file)
@@ -26,6 +26,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "backlight.h"
 #include "keymap_midi.h"
 #include "bootloader.h"
+#include "eeconfig.h"
 
 extern keymap_config_t keymap_config;
 
index f9e6c17dc3bd9c37044f322424107ca15ec65563..0162fbd632ea3ccadc62a5940340c719dda4b0c5 100644 (file)
@@ -27,11 +27,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "action_util.h"
 #include "action.h"
 
-#ifdef DEBUG_ACTION
+//#ifdef DEBUG_ACTION
 #include "debug.h"
-#else
-#include "nodebug.h"
-#endif
+//#else
+//#include "nodebug.h"
+//#endif
 
 
 void action_exec(keyevent_t event)
index e817c0d515220649db7576f777e9def4cacd1953..845fbbb2108feead5e35f417a60ba10da771cbc4 100644 (file)
@@ -4,14 +4,14 @@
 #include "util.h"
 #include "action_layer.h"
 
-#ifdef DEBUG_ACTION
+//#ifdef DEBUG_ACTION
 #include "debug.h"
-#else
-#include "nodebug.h"
-#endif
+//#else
+//#include "nodebug.h"
+//#endif
 
 
-/* 
+/*
  * Default Layer State
  */
 uint32_t default_layer_state = 0;
@@ -52,7 +52,7 @@ void default_layer_xor(uint32_t state)
 
 
 #ifndef NO_ACTION_LAYER
-/* 
+/*
  * Keymap Layer State
  */
 uint32_t layer_state = 0;
index 7726b1190769a869d7e3a711e6b077fcfab91ebe..cc78c82327917667f3efff059dd8c28877b070cc 100644 (file)
@@ -19,11 +19,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "action_macro.h"
 #include "wait.h"
 
-#ifdef DEBUG_ACTION
+//#ifdef DEBUG_ACTION
 #include "debug.h"
-#else
-#include "nodebug.h"
-#endif
+//#else
+//#include "nodebug.h"
+//#endif
 
 
 #ifndef NO_ACTION_MACRO
index 826c2330966a00050565b1358e6ee43f0baa0814..6b6fa1dfe212badfd585dec1e54a1d91ef99702a 100644 (file)
@@ -6,11 +6,11 @@
 #include "keycode.h"
 #include "timer.h"
 
-#ifdef DEBUG_ACTION
+//#ifdef DEBUG_ACTION
 #include "debug.h"
-#else
-#include "nodebug.h"
-#endif
+//#else
+//#include "nodebug.h"
+//#endif
 
 #ifndef NO_ACTION_TAPPING
 
@@ -139,7 +139,7 @@ bool process_tapping(keyrecord_t *keyp)
                     if (event.pressed) {
                         tapping_key.tap.interrupted = true;
                     }
-                    // enqueue 
+                    // enqueue
                     return false;
                 }
             }
@@ -324,6 +324,7 @@ bool waiting_buffer_typed(keyevent_t event)
     return false;
 }
 
+__attribute__((unused))
 bool waiting_buffer_has_anykey_pressed(void)
 {
     for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) {
index b4cd3ca56b9dc87e6dd342dfbc7d4652b13ba80e..7572b959797b33de6990bab1a3ef0967f53a29a1 100644 (file)
@@ -122,7 +122,7 @@ static void command_common_help(void)
                STR(MAGIC_KEY_VERSION     ) ":  Version\n"
                STR(MAGIC_KEY_STATUS      ) ":  Status\n"
                STR(MAGIC_KEY_CONSOLE     ) ":  Activate Console Mode\n"
-               
+
 #if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
                STR(MAGIC_KEY_LAYER0      ) ":  Switch to Layer 0\n"
                STR(MAGIC_KEY_LAYER1      ) ":  Switch to Layer 1\n"
@@ -136,11 +136,11 @@ static void command_common_help(void)
                STR(MAGIC_KEY_LAYER9      ) ":  Switch to Layer 9\n"
 #endif
 
-#if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS                                                  
+#if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
                                            "F1-F10:    Switch to Layer 0-9 (F10 = L0)\n"
 #endif
 
-#if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS                                                  
+#if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
                                            "0-9:       Switch to Layer 0-9\n"
 #endif
 
@@ -251,6 +251,7 @@ static void print_status(void)
 #ifdef BOOTMAGIC_ENABLE
 static void print_eeconfig(void)
 {
+#ifndef NO_PRINT
     print("default_layer: "); print_dec(eeconfig_read_default_layer()); print("\n");
 
     debug_config_t dc;
@@ -279,9 +280,12 @@ static void print_eeconfig(void)
     print("backlight_config.raw: "); print_hex8(bc.raw); print("\n");
     print(".enable: "); print_dec(bc.enable); print("\n");
     print(".level: "); print_dec(bc.level); print("\n");
-#endif
+#endif /* BACKLIGHT_ENABLE */
+
+#endif /* !NO_PRINT */
+
 }
-#endif
+#endif /* BOOTMAGIC_ENABLE */
 
 static bool command_common(uint8_t code)
 {
@@ -305,7 +309,7 @@ static bool command_common(uint8_t code)
 #ifdef BOOTMAGIC_ENABLE
 
                // print stored eeprom config
-        case MAGIC_KC(MAGIC_KEY_EEPROM):        
+        case MAGIC_KC(MAGIC_KEY_EEPROM):
             print("eeconfig:\n");
             print_eeconfig();
             break;
@@ -369,7 +373,7 @@ static bool command_common(uint8_t code)
             break;
 
         // debug matrix toggle
-        case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX): 
+        case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX):
             debug_matrix = !debug_matrix;
             if (debug_matrix) {
                 print("\nmatrix: on\n");
@@ -380,7 +384,7 @@ static bool command_common(uint8_t code)
             break;
 
         // debug keyboard toggle
-        case MAGIC_KC(MAGIC_KEY_DEBUG_KBD): 
+        case MAGIC_KC(MAGIC_KEY_DEBUG_KBD):
             debug_keyboard = !debug_keyboard;
             if (debug_keyboard) {
                 print("\nkeyboard: on\n");
@@ -551,6 +555,7 @@ static uint8_t mousekey_param = 0;
 
 static void mousekey_param_print(void)
 {
+#ifndef NO_PRINT
     print("\n\t- Values -\n");
     print("1: delay(*10ms): "); pdec(mk_delay); print("\n");
     print("2: interval(ms): "); pdec(mk_interval); print("\n");
@@ -558,6 +563,8 @@ static void mousekey_param_print(void)
     print("4: time_to_max: "); pdec(mk_time_to_max); print("\n");
     print("5: wheel_max_speed: "); pdec(mk_wheel_max_speed); print("\n");
     print("6: wheel_time_to_max: "); pdec(mk_wheel_time_to_max); print("\n");
+#endif /* !NO_PRINT */
+
 }
 
 //#define PRINT_SET_VAL(v)  print(#v " = "); print_dec(v); print("\n");
@@ -677,7 +684,7 @@ static void mousekey_console_help(void)
           "pgdown:     -10\n"
           "\n"
           "speed = delta * max_speed * (repeat / time_to_max)\n");
-    xprintf("where delta: cursor=%d, wheel=%d\n" 
+    xprintf("where delta: cursor=%d, wheel=%d\n"
             "See http://en.wikipedia.org/wiki/Mouse_keys\n", MOUSEKEY_MOVE_DELTA,  MOUSEKEY_WHEEL_DELTA);
 }
 
index c0e9e14309d9ca03985097a2fbf95914ff0eceb6..4f3dde65aa48210ab321818b6911d11439cc0b74 100644 (file)
@@ -2,17 +2,17 @@
 /* Very basic print functions, intended to be used with usb_debug_only.c
  * http://www.pjrc.com/teensy/
  * Copyright (c) 2008 PJRC.COM, LLC
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * in the Software without restriction, including without limitation the rights
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  * copies of the Software, and to permit persons to whom the Software is
  * furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * 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));
 
 #else   /* NO_PRINT */
 
-#define xprintf
-#define print
-#define println
+#define xprintf(fmt, ...)
+#define print(s)
+#define println(s)
 #define print_set_sendchar(func)
 #define print_dec(data)
 #define print_decs(data)
index 5d40dcf7b23cce5a8fbeb8d77b59b26cfb5b02ff..f03f9a9b929429e1d6b4fbc3aa7783c733f0ecbe 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 2012 Jun Wako <wakojun@gmail.com>
  * This file is based on:
  *     LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse
@@ -152,10 +152,10 @@ static void Console_Task(void)
         {
             /* Create a temporary buffer to hold the read in report from the host */
             uint8_t ConsoleData[CONSOLE_EPSIZE];
+
             /* Read Console Report Data */
             Endpoint_Read_Stream_LE(&ConsoleData, sizeof(ConsoleData), NULL);
+
             /* Process Console Report Data */
             //ProcessConsoleHIDReport(ConsoleData);
         }
@@ -183,10 +183,6 @@ static void Console_Task(void)
 
     Endpoint_SelectEndpoint(ep);
 }
-#else
-static void Console_Task(void)
-{
-}
 #endif
 
 
@@ -216,7 +212,7 @@ void EVENT_USB_Device_Disconnect(void)
     print("[D]");
     /* For battery powered device */
     USB_IsInitialized = false;
-/* TODO: This doesn't work. After several plug in/outs can not be enumerated. 
+/* TODO: This doesn't work. After several plug in/outs can not be enumerated.
     if (USB_IsInitialized) {
         USB_Disable();  // Disable all interrupts
        USB_Controller_Enable();
@@ -313,7 +309,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
 
 #ifdef MIDI_ENABLE
     ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE);
-    ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE);    
+    ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE);
 #endif
 }
 
@@ -439,7 +435,7 @@ void EVENT_USB_Device_ControlRequest(void)
 }
 
 /*******************************************************************************
- * Host driver 
+ * Host driver
  ******************************************************************************/
 static uint8_t keyboard_leds(void)
 {
@@ -563,7 +559,7 @@ static void send_consumer(uint16_t data)
     bluefruit_serial_send(0x00);
     bluefruit_serial_send(0x02);
     bluefruit_serial_send((bitmap>>8)&0xFF);
-    bluefruit_serial_send(bitmap&0xFF); 
+    bluefruit_serial_send(bitmap&0xFF);
     bluefruit_serial_send(0x00);
     bluefruit_serial_send(0x00);
     bluefruit_serial_send(0x00);