X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=protocol%2Fpjrc%2Fmain.c;h=1ef87f8651c8a2ee415e7d72590156b20db8c5b8;hb=897daee45604bcacc0b33b3fdc8a74f7160d7149;hp=9f664bc432c7b66e0880b66371fbaacef870cb28;hpb=16a583d7fd057c3ebcb859db44f097fd8073ec49;p=max%2Ftmk_keyboard.git diff --git a/protocol/pjrc/main.c b/protocol/pjrc/main.c index 9f664bc4..1ef87f86 100644 --- a/protocol/pjrc/main.c +++ b/protocol/pjrc/main.c @@ -30,11 +30,9 @@ #include "matrix.h" #include "print.h" #include "debug.h" +#include "sendchar.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 +42,6 @@ int main(void) { - DEBUG_LED_CONFIG; - DEBUG_LED_OFF; - // set for 16 MHz clock CPU_PRESCALE(0); @@ -56,9 +51,21 @@ int main(void) usb_init(); while (!usb_configured()) /* wait */ ; + print_set_sendchar(sendchar); + 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(); } }