mirror of
https://github.com/ArteryTek/AT32F415_Firmware_Library.git
synced 2026-05-21 09:22:11 +00:00
update version to v2.1.7
This commit is contained in:
@@ -213,6 +213,7 @@ static usb_sts_type class_init_handler(void *udev)
|
||||
usbd_ept_open(pudev, USBD_KEYBOARD_IN_EPT, EPT_INT_TYPE, USBD_KEYBOARD_IN_MAXPACKET_SIZE);
|
||||
|
||||
pkeyboard->g_u8tx_completed = 1;
|
||||
pkeyboard->send_state = 0;
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -369,6 +370,7 @@ static usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
|
||||
trans next packet data
|
||||
*/
|
||||
pkeyboard->g_u8tx_completed = 1;
|
||||
pkeyboard->send_state = 0;
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -442,11 +444,16 @@ static usb_sts_type class_event_handler(void *udev, usbd_event_type event)
|
||||
*/
|
||||
usb_sts_type usb_keyboard_class_send_report(void *udev, uint8_t *report, uint16_t len)
|
||||
{
|
||||
usb_sts_type status = USB_OK;
|
||||
usb_sts_type status = USB_FAIL;
|
||||
usbd_core_type *pudev = (usbd_core_type *)udev;
|
||||
|
||||
if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED)
|
||||
keyboard_type *pkeyboard = (keyboard_type *)pudev->class_handler->pdata;
|
||||
|
||||
if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED && pkeyboard->send_state == 0)
|
||||
{
|
||||
pkeyboard->send_state = 1;
|
||||
usbd_ept_send(pudev, USBD_KEYBOARD_IN_EPT, report, len);
|
||||
status = USB_OK;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ typedef struct
|
||||
|
||||
__IO uint8_t hid_suspend_flag;
|
||||
__IO uint8_t g_u8tx_completed;
|
||||
uint8_t send_state;
|
||||
uint8_t hid_state;
|
||||
uint8_t temp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user