This file manages the USB device mass-storage task.
Definition in file device_mass_storage_task.h.
#include "conf_usb.h"
Go to the source code of this file.
Functions | |
void | device_mass_storage_task (void *pvParameters) |
Entry point of the device mass-storage task management. | |
void | device_mass_storage_task_init (void) |
This function initializes the hardware/software resources required for device mass-storage task. | |
void | usb_sof_action (void) |
usb_sof_action |
void device_mass_storage_task | ( | void * | pvParameters | ) |
Entry point of the device mass-storage task management.
This function links the device mass-storage SCSI commands to the USB bus.
pvParameters | Input. Unused. |
Definition at line 120 of file device_mass_storage_task.c.
References configTSK_USB_DMS_PERIOD, EP_MS_OUT, usb_mass_storage_cbw(), and usb_mass_storage_csw().
Referenced by device_mass_storage_task_init().
00121 { 00122 portTickType xLastWakeTime; 00123 00124 xLastWakeTime = xTaskGetTickCount(); 00125 while (TRUE) 00126 { 00127 vTaskDelayUntil(&xLastWakeTime, configTSK_USB_DMS_PERIOD); 00128 00129 // First, check the device enumeration state 00130 if (!Is_device_enumerated()) continue; 00131 00132 // Display Start-of-Frame counter on LEDs 00133 // LED_Display_Field(0x7E, sof_cnt >> 5); 00134 00135 // If we receive something in the OUT endpoint, parse it 00136 if (Is_usb_out_received(EP_MS_OUT)) 00137 { 00138 usb_mass_storage_cbw(); 00139 usb_mass_storage_csw(); 00140 } 00141 } 00142 }
void device_mass_storage_task_init | ( | void | ) |
This function initializes the hardware/software resources required for device mass-storage task.
Definition at line 98 of file device_mass_storage_task.c.
References configTSK_USB_DMS_NAME, configTSK_USB_DMS_PRIORITY, configTSK_USB_DMS_STACK_SIZE, device_mass_storage_task(), EP_MS_IN, EP_MS_OUT, and sof_cnt.
Referenced by b_usbsys_start().
00099 { 00100 g_scsi_ep_ms_in = EP_MS_IN; 00101 g_scsi_ep_ms_out = EP_MS_OUT; 00102 sof_cnt = 0; 00103 00104 xTaskCreate(device_mass_storage_task, 00105 configTSK_USB_DMS_NAME, 00106 configTSK_USB_DMS_STACK_SIZE, 00107 NULL, 00108 configTSK_USB_DMS_PRIORITY, 00109 NULL); 00110 }