]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - protocol/pjrc/main.c
Merge remote-tracking branch 'tmk/master' into cub_layout
[max/tmk_keyboard.git] / protocol / pjrc / main.c
index 9f664bc432c7b66e0880b66371fbaacef870cb28..5f15dbf892c16f42acbf1a80ee0041b27537565d 100644 (file)
 #include "print.h"
 #include "debug.h"
 #include "util.h"
-#include "bootloader.h"
-#ifdef PS2_MOUSE_ENABLE
-#   include "ps2_mouse.h"
-#endif
+#include "suspend.h"
 #include "host.h"
 #include "pjrc.h"
 
@@ -44,9 +41,6 @@
 
 int main(void)
 {
-    DEBUG_LED_CONFIG;
-    DEBUG_LED_OFF;
-
     // set for 16 MHz clock
     CPU_PRESCALE(0);
 
@@ -58,7 +52,17 @@ int main(void)
 
     keyboard_init();
     host_set_driver(pjrc_driver());
+#ifdef SLEEP_LED_ENABLE
+    sleep_led_init();
+#endif
     while (1) {
-       keyboard_task(); 
+        while (suspend) {
+            suspend_power_down();
+            if (remote_wakeup && suspend_wakeup_condition()) {
+                usb_remote_wakeup();
+            }
+        }
+
+        keyboard_task(); 
     }
 }