Skip to content

Commit

Permalink
improved usb interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Huckies committed Mar 27, 2024
1 parent d0da550 commit a8190b5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion qmk_porting/protocol/usb_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ void usbd_configure_done_callback()
#ifdef RAW_ENABLE
usbd_ep_start_read(QMKRAW_OUT_EP, qmkraw_out_buffer, sizeof(qmkraw_out_buffer));
#endif
usb_device_state_set_configuration(true, 1);
}

void usb_dc_low_level_init()
Expand Down Expand Up @@ -452,13 +451,26 @@ void usbd_event_handler(uint8_t event)
case USBD_EVENT_DISCONNECTED:
break;
case USBD_EVENT_RESUME:
#if !defined ESB_ENABLE || ESB_ENABLE == 1
usb_device_state_set_resume(usb_device_is_configured(), 1);
#else
inform_keyboard_usb_resume(usb_device_is_configured());
#endif
break;
case USBD_EVENT_SUSPEND:
#if !defined ESB_ENABLE || ESB_ENABLE == 1
usb_device_state_set_suspend(usb_device_is_configured(), 1);
#else
inform_keyboard_usb_suspend(usb_device_is_configured());
#endif
break;
case USBD_EVENT_CONFIGURED:
usbd_configure_done_callback();
#if !defined ESB_ENABLE || ESB_ENABLE == 1
usb_device_state_set_configuration(true, 1);
#else
inform_keyboard_usb_configured();
#endif
break;
case USBD_EVENT_SET_REMOTE_WAKEUP:
break;
Expand Down

0 comments on commit a8190b5

Please sign in to comment.