#define debug_bin_reverse16(data) do { if (debug_enable) print_bin_reverse16(data); } while (0)
#define debug_bin_reverse32(data) do { if (debug_enable) print_bin_reverse32(data); } while (0)
-#define debug_dec(data) debug_dec(data)
#define debug_hex(data) debug_hex8(data)
#define debug_bin(data) debug_bin8(data)
#define debug_bin_reverse(data) debug_bin8(data)
void keyboard_init(void)
{
- debug_keyboard = true;
+ // TODO: to enable debug print magic key bind on boot time
// TODO: configuration of sendchar impl
print_sendchar_func = sendchar;
int8_t (*print_sendchar_func)(uint8_t) = 0;
-bool print_enable = false;
+bool print_enable = true;
/* print string stored in data memory(SRAM)
//pullup_pins();
//set_prr();
- print_enable = true;
- debug_enable = false;
-
#ifdef HOST_VUSB
disable_vusb();
#endif
int main(void)
{
SetupHardware();
+ keyboard_init();
+ host_set_driver(&lufa_driver);
sei();
- print_enable = true;
- debug_enable = true;
- debug_matrix = true;
- debug_keyboard = true;
- debug_mouse = true;
-
// TODO: can't print here
debug("LUFA init\n");
-
- keyboard_init();
- host_set_driver(&lufa_driver);
while (1) {
keyboard_task();
while (!usb_configured()) /* wait */ ;
keyboard_init();
- matrix_scan();
- if (matrix_key_count() >= 3) {
-#ifdef DEBUG_LED
- for (int i = 0; i < 6; i++) {
- DEBUG_LED_CONFIG;
- DEBUG_LED_ON;
- _delay_ms(500);
- DEBUG_LED_OFF;
- _delay_ms(500);
- }
-#else
- _delay_ms(5000);
-#endif
- print_enable = true;
- debug_enable = true;
- debug_matrix = true;
- debug_keyboard = true;
- debug_mouse = true;
- print("debug enabled.\n");
- }
- if (matrix_key_count() >= 4) {
- print("jump to bootloader...\n");
- _delay_ms(1000);
- bootloader_jump(); // not return
- }
-
-
host_set_driver(pjrc_driver());
while (1) {
keyboard_task();
uart_init(UART_BAUD_RATE);
#endif
- debug_enable = true;
- print_enable = true;
-
- debug("keyboard_init()\n");
keyboard_init();
host_set_driver(vusb_driver());