]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Fix usage of debug flag
authortmk <nobody@nowhere>
Fri, 26 Oct 2012 18:07:37 +0000 (03:07 +0900)
committertmk <nobody@nowhere>
Fri, 26 Oct 2012 18:07:37 +0000 (03:07 +0900)
common/debug.h
common/keyboard.c
common/print.c
protocol/iwrap/main.c
protocol/lufa/lufa.c
protocol/pjrc/main.c
protocol/vusb/main.c

index c12f2cb004180b7c0a75039aff6748d06dc45445..648f0e096c71e1a4c987361be59c47d49ec1c7c9 100644 (file)
@@ -46,7 +46,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define debug_bin_reverse16(data) do { if (debug_enable) print_bin_reverse16(data); } while (0)
 #define debug_bin_reverse32(data) do { if (debug_enable) print_bin_reverse32(data); } while (0)
 
-#define debug_dec(data)           debug_dec(data)
 #define debug_hex(data)           debug_hex8(data)
 #define debug_bin(data)           debug_bin8(data)
 #define debug_bin_reverse(data)   debug_bin8(data)
index bda7c0625bff83f481699c879ba84e11a23df225..fa22116f177175670e7dc64f76d77e15e9b8710c 100644 (file)
@@ -544,7 +544,7 @@ static inline void process_key(keyevent_t event)
 
 void keyboard_init(void)
 {
-    debug_keyboard = true;
+    // TODO: to enable debug print magic key bind on boot time
 
     // TODO: configuration of sendchar impl
     print_sendchar_func = sendchar;
index 6a8a725bca11e2211f2c9fd28f71121f6bef6dea..d8a899b4071df0b902ba741c1d300672ae412fcc 100644 (file)
@@ -31,7 +31,7 @@
 
 
 int8_t (*print_sendchar_func)(uint8_t) = 0;
-bool print_enable = false;
+bool print_enable = true;
 
 
 /* print string stored in data memory(SRAM)
index c11ff7ab95bcaa3b79cb1aba2cf0899ecbf135c3..05a67337fd3db16b2c1f369282ae0949123f6450 100644 (file)
@@ -131,9 +131,6 @@ int main(void)
     //pullup_pins();
     //set_prr();
 
-    print_enable = true;
-    debug_enable = false;
-
 #ifdef HOST_VUSB
     disable_vusb();
 #endif
index bff1f5e8b28bf5caa0286a80fb05608d1cd48662..68f30dd162f4f0aead644b29267b7eb1c896a999 100644 (file)
@@ -461,19 +461,12 @@ int main(void)  __attribute__ ((weak));
 int main(void)
 {
     SetupHardware();
+    keyboard_init();
+    host_set_driver(&lufa_driver);
     sei();
 
-    print_enable = true;
-    debug_enable = true;
-    debug_matrix = true;
-    debug_keyboard = true;
-    debug_mouse = true;
-
     // TODO: can't print here
     debug("LUFA init\n");
-
-    keyboard_init();
-    host_set_driver(&lufa_driver);
     while (1) {
         keyboard_task();
 
index e0f600fe7c66f77faf40c47484151e4166d48224..9f664bc432c7b66e0880b66371fbaacef870cb28 100644 (file)
@@ -57,33 +57,6 @@ int main(void)
     while (!usb_configured()) /* wait */ ;
 
     keyboard_init();
-    matrix_scan();
-    if (matrix_key_count() >= 3) {
-#ifdef DEBUG_LED
-        for (int i = 0; i < 6; i++) {
-            DEBUG_LED_CONFIG;
-            DEBUG_LED_ON;
-            _delay_ms(500);
-            DEBUG_LED_OFF;
-            _delay_ms(500);
-        }
-#else
-        _delay_ms(5000);
-#endif
-        print_enable = true;
-        debug_enable = true;
-        debug_matrix = true;
-        debug_keyboard = true;
-        debug_mouse = true;
-        print("debug enabled.\n");
-    }
-    if (matrix_key_count() >= 4) {
-        print("jump to bootloader...\n");
-        _delay_ms(1000);
-        bootloader_jump(); // not return
-    }
-
-
     host_set_driver(pjrc_driver());
     while (1) {
        keyboard_task(); 
index e964a69a878768169f9ca3642d5ce8ccd55d4c9f..8e4a266e9b60d63c423b0a336401e78fd33f93dd 100644 (file)
@@ -53,10 +53,6 @@ int main(void)
     uart_init(UART_BAUD_RATE);
 #endif
 
-    debug_enable = true;
-    print_enable = true;
-
-    debug("keyboard_init()\n");
     keyboard_init();
     host_set_driver(vusb_driver());