mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 17:20:53 +01:00
[usb] Handle GET_STATUS request.
Change-Id: I4c9d8cbe7241dfd6fbb986253122a74d0ddb0e2c
This commit is contained in:
@@ -420,6 +420,15 @@ int controlSetupGetDescriptor() {
|
||||
return (int) RequestReturnCodes::USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
int controlSetupGetStatus() {
|
||||
if (sControlBufferLength > 2) {
|
||||
sControlBufferLength = 2;
|
||||
}
|
||||
sControlBuffer[0] = 0;
|
||||
sControlBuffer[1] = 0;
|
||||
return (int) RequestReturnCodes::USBD_REQ_HANDLED;
|
||||
}
|
||||
|
||||
int controlSetupSetConfiguration() {
|
||||
/* We support one configuration only */
|
||||
if (sSetupData.wValue != 0 || sSetupData.wValue != USB_DFU_CONFIGURATION_VALUE) {
|
||||
@@ -444,7 +453,7 @@ int controlRequestDispatch() {
|
||||
int controlStandardRequest() {
|
||||
switch (sSetupData.bRequest) {
|
||||
case USB_REQ_GET_STATUS:
|
||||
//TODO Not needed for enumeration?
|
||||
return controlSetupGetStatus();
|
||||
break;
|
||||
case USB_REQ_CLEAR_FEATURE:
|
||||
case USB_REQ_SET_FEATURE:
|
||||
|
||||
@@ -164,6 +164,7 @@ void controlSetup();
|
||||
void controlSetupIn();
|
||||
void controlSetupOut();
|
||||
int controlSetupGetDescriptor();
|
||||
int controlSetupGetStatus();
|
||||
int controlSetupSetConfiguration();
|
||||
int controlRequestDispatch();
|
||||
int controlStandardRequest();
|
||||
|
||||
Reference in New Issue
Block a user