1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #include <stdbool.h>
- #include <avr/io.h>
- #include <avr/interrupt.h>
- #include <avr/wdt.h>
- #include <util/delay.h>
- #include "keyboard.h"
- #include "usb.h"
- #include "matrix.h"
- #include "print.h"
- #include "debug.h"
- #include "sendchar.h"
- #include "util.h"
- #include "suspend.h"
- #include "host.h"
- #include "pjrc.h"
- #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
- int main(void)
- {
-
- CPU_PRESCALE(0);
- keyboard_setup();
-
-
-
- usb_init();
- while (!usb_configured()) ;
- print_set_sendchar(sendchar);
- keyboard_init();
- host_set_driver(pjrc_driver());
- #ifdef SLEEP_LED_ENABLE
- sleep_led_init();
- #endif
- while (1) {
- while (suspend) {
- suspend_power_down();
- if (remote_wakeup && suspend_wakeup_condition()) {
- usb_remote_wakeup();
- }
- }
- keyboard_task();
- }
- }
|