|
|
|
@ -343,7 +343,7 @@ static uint8_t usb_class_deinit(USBD_HandleTypeDef *dev, uint8_t cfg_idx) {
|
|
|
|
|
|
|
|
|
|
static uint8_t usb_class_setup(USBD_HandleTypeDef *dev,
|
|
|
|
|
USBD_SetupReqTypedef *req) {
|
|
|
|
|
delay_random();
|
|
|
|
|
wait_random();
|
|
|
|
|
if (((req->bmRequest & USB_REQ_TYPE_MASK) != USB_REQ_TYPE_CLASS) &&
|
|
|
|
|
((req->bmRequest & USB_REQ_TYPE_MASK) != USB_REQ_TYPE_STANDARD) &&
|
|
|
|
|
((req->bmRequest & USB_REQ_TYPE_MASK) != USB_REQ_TYPE_VENDOR)) {
|
|
|
|
@ -472,7 +472,7 @@ static uint8_t usb_class_setup(USBD_HandleTypeDef *dev,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static uint8_t usb_class_data_in(USBD_HandleTypeDef *dev, uint8_t ep_num) {
|
|
|
|
|
delay_random();
|
|
|
|
|
wait_random();
|
|
|
|
|
for (int i = 0; i < USBD_MAX_NUM_INTERFACES; i++) {
|
|
|
|
|
switch (usb_ifaces[i].type) {
|
|
|
|
|
case USB_IFACE_TYPE_HID:
|
|
|
|
@ -492,7 +492,7 @@ static uint8_t usb_class_data_in(USBD_HandleTypeDef *dev, uint8_t ep_num) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static uint8_t usb_class_data_out(USBD_HandleTypeDef *dev, uint8_t ep_num) {
|
|
|
|
|
delay_random();
|
|
|
|
|
wait_random();
|
|
|
|
|
for (int i = 0; i < USBD_MAX_NUM_INTERFACES; i++) {
|
|
|
|
|
switch (usb_ifaces[i].type) {
|
|
|
|
|
case USB_IFACE_TYPE_HID:
|
|
|
|
@ -512,7 +512,7 @@ static uint8_t usb_class_data_out(USBD_HandleTypeDef *dev, uint8_t ep_num) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static uint8_t usb_class_sof(USBD_HandleTypeDef *dev) {
|
|
|
|
|
delay_random();
|
|
|
|
|
wait_random();
|
|
|
|
|
for (int i = 0; i < USBD_MAX_NUM_INTERFACES; i++) {
|
|
|
|
|
switch (usb_ifaces[i].type) {
|
|
|
|
|
case USB_IFACE_TYPE_VCP:
|
|
|
|
|