summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/usb.h2
-rw-r--r--firmware/usbstack/usb_core.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index 2bcd95ef81..fe9f3bcfa1 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -178,7 +178,7 @@ struct usb_transfer_completion_event_data
178 int dir; 178 int dir;
179 int status; 179 int status;
180 int length; 180 int length;
181 void* data; 181 void* data[2];
182}; 182};
183#endif /* HAVE_USBSTACK */ 183#endif /* HAVE_USBSTACK */
184 184
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
index 1f17872ba8..4bc0443477 100644
--- a/firmware/usbstack/usb_core.c
+++ b/firmware/usbstack/usb_core.c
@@ -446,10 +446,10 @@ void usb_core_handle_transfer_completion(
446 case EP_CONTROL: 446 case EP_CONTROL:
447 logf("ctrl handled %ld req=0x%x", 447 logf("ctrl handled %ld req=0x%x",
448 current_tick, 448 current_tick,
449 ((struct usb_ctrlrequest*)event->data)->bRequest); 449 ((struct usb_ctrlrequest*)event->data[0])->bRequest);
450 450
451 usb_core_control_request_handler( 451 usb_core_control_request_handler(
452 (struct usb_ctrlrequest*)event->data); 452 (struct usb_ctrlrequest*)event->data[0]);
453 break; 453 break;
454 default: 454 default:
455 handler = ep_data[ep].completion_handler[EP_DIR(event->dir)]; 455 handler = ep_data[ep].completion_handler[EP_DIR(event->dir)];
@@ -952,7 +952,8 @@ void usb_core_transfer_complete(int endpoint, int dir, int status, int length)
952 952
953 completion_event->endpoint = endpoint; 953 completion_event->endpoint = endpoint;
954 completion_event->dir = dir; 954 completion_event->dir = dir;
955 completion_event->data = 0; 955 completion_event->data[0] = NULL;
956 completion_event->data[1] = NULL;
956 completion_event->status = status; 957 completion_event->status = status;
957 completion_event->length = length; 958 completion_event->length = length;
958 /* All other endpoints. Let the thread deal with it */ 959 /* All other endpoints. Let the thread deal with it */
@@ -984,7 +985,8 @@ void usb_core_legacy_control_request(struct usb_ctrlrequest* req)
984 985
985 completion_event->endpoint = EP_CONTROL; 986 completion_event->endpoint = EP_CONTROL;
986 completion_event->dir = 0; 987 completion_event->dir = 0;
987 completion_event->data = (void*)req; 988 completion_event->data[0] = (void*)req;
989 completion_event->data[1] = NULL;
988 completion_event->status = 0; 990 completion_event->status = 0;
989 completion_event->length = 0; 991 completion_event->length = 0;
990 logf("ctrl received %ld, req=0x%x", current_tick, req->bRequest); 992 logf("ctrl received %ld, req=0x%x", current_tick, req->bRequest);