]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/common/keyboard.c
Merge remote-tracking branch 'jackhumbert/master' into patch-1
[qmk_firmware.git] / tmk_core / common / keyboard.c
index f0ead604eccb87567c4984a67adf2bb7efa10434..81df8eb73bf535594ce5d19cd68e81eab4a6514d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright 2011,2012,2013 Jun Wako <wakojun@gmail.com>
+Copyright 2011, 2012, 2013 Jun Wako <wakojun@gmail.com>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -27,9 +27,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "command.h"
 #include "util.h"
 #include "sendchar.h"
-#include "bootmagic.h"
 #include "eeconfig.h"
 #include "backlight.h"
+#ifdef BOOTMAGIC_ENABLE
+#   include "bootmagic.h"
+#else
+#   include "magic.h"
+#endif
 #ifdef MOUSEKEY_ENABLE
 #   include "mousekey.h"
 #endif
@@ -37,9 +41,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #   include "ps2_mouse.h"
 #endif
 #ifdef SERIAL_MOUSE_ENABLE
-#include "serial_mouse.h"
+#   include "serial_mouse.h"
+#endif
+#ifdef ADB_MOUSE_ENABLE
+#   include "adb.h"
+#endif
+#ifdef RGBLIGHT_ENABLE
+#   include "rgblight.h"
 #endif
-
 
 #ifdef MATRIX_HAS_GHOST
 static bool has_ghost_in_row(uint8_t row)
@@ -58,9 +67,15 @@ static bool has_ghost_in_row(uint8_t row)
 }
 #endif
 
+__attribute__ ((weak))
+void matrix_setup(void) {
+}
 
-void keyboard_init(void)
-{
+void keyboard_setup(void) {
+    matrix_setup();
+}
+
+void keyboard_init(void) {
     timer_init();
     matrix_init();
 #ifdef PS2_MOUSE_ENABLE
@@ -69,15 +84,23 @@ void keyboard_init(void)
 #ifdef SERIAL_MOUSE_ENABLE
     serial_mouse_init();
 #endif
-
-
+#ifdef ADB_MOUSE_ENABLE
+    adb_mouse_init();
+#endif
 #ifdef BOOTMAGIC_ENABLE
     bootmagic();
+#else
+    magic();
 #endif
-
 #ifdef BACKLIGHT_ENABLE
     backlight_init();
 #endif
+#ifdef RGBLIGHT_ENABLE
+    rgblight_init();
+#endif
+#if defined(NKRO_ENABLE) && defined(FORCE_NKRO)
+       keyboard_nkro = true;
+#endif
 }
 
 /*
@@ -147,6 +170,10 @@ MATRIX_LOOP_END:
         serial_mouse_task();
 #endif
 
+#ifdef ADB_MOUSE_ENABLE
+        adb_mouse_task();
+#endif
+
     // update LED
     if (led_status != host_keyboard_leds()) {
         led_status = host_keyboard_leds();