Added wireless support; Added Lemokey L3; Added Keychron V1 Max

This commit is contained in:
lokher 2024-01-10 16:22:49 +08:00
parent 9539f135d8
commit 4ae5990fcc
31585 changed files with 99327 additions and 1763186 deletions

View file

@ -192,7 +192,6 @@ void protocol_pre_task(void) {
/* Remote wakeup */
if ((USB_DRIVER.status & USB_GETSTATUS_REMOTE_WAKEUP_ENABLED) && suspend_wakeup_condition()) {
usbWakeupHost(&USB_DRIVER);
restart_usb_driver(&USB_DRIVER);
}
}
/* Woken up */

View file

@ -765,20 +765,7 @@ void init_usb_driver(USBDriver *usbp) {
chVTObjectInit(&keyboard_idle_timer);
}
__attribute__((weak)) void restart_usb_driver(USBDriver *usbp) {
usbDisconnectBus(usbp);
usbStop(usbp);
#if USB_SUSPEND_WAKEUP_DELAY > 0
// Some hubs, kvm switches, and monitors do
// weird things, with USB device state bouncing
// around wildly on wakeup, yielding race
// conditions that can corrupt the keyboard state.
//
// Pause for a while to let things settle...
wait_ms(USB_SUSPEND_WAKEUP_DELAY);
#endif
__attribute__((weak)) void usb_start(USBDriver *usbp) {
usbStart(usbp, &usbcfg);
usbConnectBus(usbp);
}

View file

@ -33,8 +33,8 @@
/* Initialize the USB driver and bus */
void init_usb_driver(USBDriver *usbp);
/* Restart the USB driver and bus */
void restart_usb_driver(USBDriver *usbp);
/* Start the USB driver */
void usb_start(USBDriver *usbp);
/* ---------------
* USB Event queue

View file

@ -135,10 +135,10 @@ void host_system_send(uint16_t usage) {
if (!driver) return;
report_extra_t report = {
.report_id = REPORT_ID_SYSTEM,
.usage = usage,
};
static report_extra_t report;
report.report_id = REPORT_ID_SYSTEM;
report.usage = usage;
(*driver->send_extra)(&report);
}
@ -155,10 +155,10 @@ void host_consumer_send(uint16_t usage) {
if (!driver) return;
report_extra_t report = {
.report_id = REPORT_ID_CONSUMER,
.usage = usage,
};
static report_extra_t report;
report.report_id = REPORT_ID_CONSUMER;
report.usage = usage;
(*driver->send_extra)(&report);
}