update version to v2.2.2

This commit is contained in:
Artery-MCU
2025-11-27 18:17:29 +08:00
parent 9cdb243884
commit 29f8bfd95b
2032 changed files with 6969 additions and 7796 deletions

View File

@@ -3,7 +3,8 @@
* @file mouse_class.c
* @brief usb hid mouse class type
**************************************************************************
* Copyright notice & Disclaimer
*
* Copyright (c) 2025, Artery Technology, All rights reserved.
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
@@ -74,6 +75,7 @@ static usb_sts_type class_init_handler(void *udev)
{
usb_sts_type status = USB_OK;
usbd_core_type *pudev = (usbd_core_type *)udev;
mouse_type *pmouse = (mouse_type *)pudev->class_handler->pdata;
#ifndef USB_EPT_AUTO_MALLOC_BUFFER
/* use user define buffer address */
@@ -82,6 +84,8 @@ static usb_sts_type class_init_handler(void *udev)
/* open hid in endpoint */
usbd_ept_open(pudev, USBD_MOUSE_IN_EPT, EPT_INT_TYPE, USBD_MOUSE_IN_MAXPACKET_SIZE);
pmouse->send_state = 0;
return status;
}
@@ -231,11 +235,13 @@ static usb_sts_type class_ept0_rx_handler(void *udev)
static usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
{
usb_sts_type status = USB_OK;
usbd_core_type *pudev = (usbd_core_type *)udev;
mouse_type *pmouse = (mouse_type *)pudev->class_handler->pdata;
/* ...user code...
trans next packet data
*/
pmouse->send_state = 0;
return status;
}
@@ -308,11 +314,16 @@ static usb_sts_type class_event_handler(void *udev, usbd_event_type event)
*/
usb_sts_type usb_mouse_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;
mouse_type *pmouse = (mouse_type *)pudev->class_handler->pdata;
if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED)
if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED && pmouse->send_state == 0)
{
pmouse->send_state = 1;
usbd_ept_send(pudev, USBD_MOUSE_IN_EPT, report, len);
status = USB_OK;
}
return status;
}

View File

@@ -3,7 +3,8 @@
* @file mouse_class.h
* @brief usb hid mouse header file
**************************************************************************
* Copyright notice & Disclaimer
*
* Copyright (c) 2025, Artery Technology, All rights reserved.
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
@@ -87,6 +88,7 @@ typedef struct
uint8_t mouse_buffer[4];
uint8_t hid_state;
__IO uint8_t hid_suspend_flag;
uint8_t send_state;
}mouse_type;
/**

View File

@@ -3,7 +3,8 @@
* @file mouse_desc.c
* @brief usb hid mouse device descriptor
**************************************************************************
* Copyright notice & Disclaimer
*
* Copyright (c) 2025, Artery Technology, All rights reserved.
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.

View File

@@ -3,7 +3,8 @@
* @file mouse_desc.h
* @brief usb mouse descriptor header file
**************************************************************************
* Copyright notice & Disclaimer
*
* Copyright (c) 2025, Artery Technology, All rights reserved.
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.