update template

This commit is contained in:
sakumisu
2022-07-03 11:23:26 +08:00
parent 010116ee63
commit 3d615a1c66
4 changed files with 695 additions and 29 deletions

View File

@@ -243,38 +243,16 @@ void hid_mouse_init(void)
mouse_cfg.y = 0;
}
/**
* @brief device send report to host
* @pre none
* @param[in] ep endpoint address
* @param[in] data Points to the data buffer waiting to be sent
* @param[in] len Length of data to be sent
* @retval none
*/
void hid_mouse_send_report(uint8_t ep, uint8_t *data, uint8_t len)
{
if (usb_device_is_configured()) {
if (hid_state == HID_STATE_IDLE) {
/*!< updata the state */
hid_state = HID_STATE_BUSY;
/*!< write buffer */
usbd_ep_write(ep, data, len, NULL);
}
}
}
/**
* @brief hid mouse test
* @pre none
* @param[in] none
* @retval none
*/
void hid_mouse_send_report_test(void)
void hid_mouse_test(void)
{
/*!< remove mouse pointer */
/*!< move mouse pointer */
mouse_cfg.x += 10;
mouse_cfg.y = 0;
/*!< send repotr to host */
hid_mouse_send_report(HID_INT_EP, (uint8_t *)&mouse_cfg, 4);
/*!< delay 1000ms */
}
usbd_ep_write(HID_INT_EP, (uint8_t *)&mouse_cfg, 4, NULL);
}