mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 12:51:47 +00:00
Fix bugs in the new VirtualSerialMassStorage demo (thanks to Martin Degelsegger).
This commit is contained in:
parent
b47374caf5
commit
f6f4ac588c
@ -43,13 +43,13 @@
|
|||||||
|
|
||||||
/* Macros: */
|
/* Macros: */
|
||||||
/** Endpoint number of the CDC device-to-host notification IN endpoint. */
|
/** Endpoint number of the CDC device-to-host notification IN endpoint. */
|
||||||
#define CDC_NOTIFICATION_EPNUM 2
|
#define CDC_NOTIFICATION_EPNUM 1
|
||||||
|
|
||||||
/** Endpoint number of the CDC device-to-host data IN endpoint. */
|
/** Endpoint number of the CDC device-to-host data IN endpoint. */
|
||||||
#define CDC_TX_EPNUM 3
|
#define CDC_TX_EPNUM 2
|
||||||
|
|
||||||
/** Endpoint number of the CDC host-to-device data OUT endpoint. */
|
/** Endpoint number of the CDC host-to-device data OUT endpoint. */
|
||||||
#define CDC_RX_EPNUM 4
|
#define CDC_RX_EPNUM 3
|
||||||
|
|
||||||
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
|
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
|
||||||
#define CDC_NOTIFICATION_EPSIZE 8
|
#define CDC_NOTIFICATION_EPSIZE 8
|
||||||
@ -58,10 +58,10 @@
|
|||||||
#define CDC_TXRX_EPSIZE 16
|
#define CDC_TXRX_EPSIZE 16
|
||||||
|
|
||||||
/** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
|
/** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
|
||||||
#define MASS_STORAGE_IN_EPNUM 3
|
#define MASS_STORAGE_IN_EPNUM 4
|
||||||
|
|
||||||
/** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
|
/** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
|
||||||
#define MASS_STORAGE_OUT_EPNUM 4
|
#define MASS_STORAGE_OUT_EPNUM 5
|
||||||
|
|
||||||
/** Size in bytes of the Mass Storage data endpoints. */
|
/** Size in bytes of the Mass Storage data endpoints. */
|
||||||
#define MASS_STORAGE_IO_EPSIZE 64
|
#define MASS_STORAGE_IO_EPSIZE 64
|
||||||
|
@ -68,17 +68,17 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
|
|||||||
{
|
{
|
||||||
.Config =
|
.Config =
|
||||||
{
|
{
|
||||||
.InterfaceNumber = 0,
|
.InterfaceNumber = 2,
|
||||||
|
|
||||||
.DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
|
.DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
|
||||||
.DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
|
.DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
|
||||||
.DataINEndpointDoubleBank = false,
|
.DataINEndpointDoubleBank = false,
|
||||||
|
|
||||||
.DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
|
.DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
|
||||||
.DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
|
.DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
|
||||||
.DataOUTEndpointDoubleBank = false,
|
.DataOUTEndpointDoubleBank = false,
|
||||||
|
|
||||||
.TotalLUNs = TOTAL_LUNS,
|
.TotalLUNs = TOTAL_LUNS,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
* - Series 7 USB AVRs (AT90USBxxx7)
|
* - Series 7 USB AVRs (AT90USBxxx7)
|
||||||
* - Series 6 USB AVRs (AT90USBxxx6)
|
* - Series 6 USB AVRs (AT90USBxxx6)
|
||||||
* - Series 4 USB AVRs (ATMEGAxxU4)
|
* - Series 4 USB AVRs (ATMEGAxxU4)
|
||||||
* - Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
|
|
||||||
*
|
*
|
||||||
* \section Sec_Info USB Information:
|
* \section Sec_Info USB Information:
|
||||||
*
|
*
|
||||||
|
@ -54,8 +54,11 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
|
|||||||
|
|
||||||
Pipe_Unfreeze();
|
Pipe_Unfreeze();
|
||||||
|
|
||||||
for (uint8_t HeaderByte = 0; HeaderByte < sizeof(USB_Request_Header_t); HeaderByte++)
|
Pipe_Write_Byte(USB_ControlRequest.bmRequestType);
|
||||||
Pipe_Write_Byte(*(HeaderStream++));
|
Pipe_Write_Byte(USB_ControlRequest.bRequest);
|
||||||
|
Pipe_Write_Word_LE(USB_ControlRequest.wValue);
|
||||||
|
Pipe_Write_Word_LE(USB_ControlRequest.wIndex);
|
||||||
|
Pipe_Write_Word_LE(USB_ControlRequest.wLength);
|
||||||
|
|
||||||
Pipe_ClearSETUP();
|
Pipe_ClearSETUP();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user