X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=protocol%2Fpjrc%2Fmain.c;h=4f87a1736458851e980b9839da15e336ed770ce9;hb=541913029150d57e83396293d35807a16d3755e8;hp=776bfee9d610aa0fbe31719f7c727c3b3a477545;hpb=4701b08b71b187cb3d015bec7e05d30e35c344ac;p=max%2Ftmk_keyboard.git diff --git a/protocol/pjrc/main.c b/protocol/pjrc/main.c index 776bfee9..4f87a173 100644 --- a/protocol/pjrc/main.c +++ b/protocol/pjrc/main.c @@ -24,17 +24,16 @@ #include #include #include +#include #include #include "keyboard.h" #include "usb.h" #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" @@ -53,9 +52,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(WDTO_120MS); + if (remote_wakeup && suspend_wakeup_condition()) { + usb_remote_wakeup(); + } + } + + keyboard_task(); } }