Fix possible infinite loop in the control stream write template functions.

This commit is contained in:
Dean Camera 2014-06-08 15:33:29 +10:00
parent 910c6eb599
commit b8f7dae24c
3 changed files with 6 additions and 0 deletions

View File

@ -79,6 +79,8 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer,
return ENDPOINT_RWCSTREAM_DeviceDisconnected;
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
return ENDPOINT_RWCSTREAM_BusSuspended;
else if (Endpoint_IsSETUPReceived())
return ENDPOINT_RWCSTREAM_HostAborted;
}
return ENDPOINT_RWCSTREAM_NoError;

View File

@ -79,6 +79,8 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer,
return ENDPOINT_RWCSTREAM_DeviceDisconnected;
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
return ENDPOINT_RWCSTREAM_BusSuspended;
else if (Endpoint_IsSETUPReceived())
return ENDPOINT_RWCSTREAM_HostAborted;
}
return ENDPOINT_RWCSTREAM_NoError;

View File

@ -81,6 +81,8 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer,
return ENDPOINT_RWCSTREAM_DeviceDisconnected;
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
return ENDPOINT_RWCSTREAM_BusSuspended;
else if (Endpoint_IsSETUPReceived())
return ENDPOINT_RWCSTREAM_HostAborted;
}
return ENDPOINT_RWCSTREAM_NoError;