X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/b9b03aadb219d06fbad9d110e508db93e45461af..d0db78432fc02bacbd57cc9f15eb05b4e56981cb:/Demos/Device/ClassDriver/MassStorage/MassStorage.c?ds=sidebyside diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.c b/Demos/Device/ClassDriver/MassStorage/MassStorage.c index 5dbc4a2cc..0a6604cfb 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.c +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.c @@ -40,17 +40,25 @@ * passed to all Mass Storage Class driver functions, so that multiple instances of the same class * within a device can be differentiated from one another. */ -USB_ClassInfo_MS_t Disk_MS_Interface = +USB_ClassInfo_MS_Device_t Disk_MS_Interface = { - .InterfaceNumber = 0, - - .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM, - .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE, - - .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM, - .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE, - - .TotalLUNs = TOTAL_LUNS, + .Config = + { + .InterfaceNumber = 0, + + .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM, + .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE, + + .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM, + .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE, + + .TotalLUNs = TOTAL_LUNS, + }, + + .State = + { + // Leave all state values to their defaults + } }; /** Main program entry point. This routine contains the overall program flow, including initial @@ -64,7 +72,7 @@ int main(void) for (;;) { - USB_MS_USBTask(&Disk_MS_Interface); + MS_Device_USBTask(&Disk_MS_Interface); USB_USBTask(); } } @@ -105,21 +113,21 @@ void EVENT_USB_ConfigurationChanged(void) { LEDs_SetAllLEDs(LEDMASK_USB_READY); - if (!(USB_MS_ConfigureEndpoints(&Disk_MS_Interface))) + if (!(MS_Device_ConfigureEndpoints(&Disk_MS_Interface))) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); } /** Event handler for the library USB Unhandled Control Packet event. */ void EVENT_USB_UnhandledControlPacket(void) { - USB_MS_ProcessControlPacket(&Disk_MS_Interface); + MS_Device_ProcessControlPacket(&Disk_MS_Interface); } /** Mass Storage class driver callback function the reception of SCSI commands from the host, which must be processed. * - * \param MSInterfaceInfo Pointer to the Mass Storage class interface configuration structure being referenced + * \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface configuration structure being referenced */ -bool CALLBACK_USB_MS_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo) +bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) { bool CommandSuccess;