Endpoint_SelectEndpoint(NKRO_IN_EPNUM);
/* Check if write ready for a polling interval around 1ms */
- while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(4);
+ while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(8);
if (!Endpoint_IsReadWriteAllowed()) return;
/* Write Keyboard Report Data */
static void send_system(uint16_t data)
{
+#ifdef EXTRAKEY_ENABLE
uint8_t timeout = 255;
if (USB_DeviceState != DEVICE_STATE_Configured)
Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL);
Endpoint_ClearIN();
+#endif
}
static void send_consumer(uint16_t data)
{
+#ifdef EXTRAKEY_ENABLE
uint8_t timeout = 255;
if (USB_DeviceState != DEVICE_STATE_Configured)
Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL);
Endpoint_ClearIN();
+#endif
}
USB_USBTask();
#endif
}
+
+ /* wait for Console startup */
+ // TODO: long delay often works anyhoo but proper startup would be better
+ uint16_t delay = 2000;
+ while (delay--) {
+#ifndef INTERRUPT_CONTROL_ENDPOINT
+ USB_USBTask();
+#endif
+ _delay_ms(1);
+ }
+
print("USB configured.\n");
/* init modules */
keyboard_led_stats = 0;
led_set(keyboard_led_stats);
- matrix_init();
+ matrix_clear();
clear_keyboard();
#ifdef SLEEP_LED_ENABLE
sleep_led_enable();