Commit 6122ba93 authored by Dean Camera's avatar Dean Camera
Browse files

Fix MassStorageKeyboard demo USE_INTERNAL_SERIAL check being performed before...

Fix MassStorageKeyboard demo USE_INTERNAL_SERIAL check being performed before the required library headers were included, causing a compilation error.

Added notes to the class driver functions indicating which functions require what Device/Host state machine states to function.
parent 1e1cf2c4
......@@ -29,10 +29,6 @@
this software.
*/
#if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)
#warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.
#endif
/** \file
*
* USB Device Descriptors, for library use when in USB device mode. Descriptors are special
......@@ -42,6 +38,18 @@
#include "Descriptors.h"
/* On some devices, there is a factory set internal serial number which can be automatically sent to the host as
* the device's serial number when the Device Descriptor's .SerialNumStrIndex entry is set to USE_INTERNAL_SERIAL.
* This allows the host to track a device across insertions on different ports, allowing them to retain allocated
* resources like COM port numbers and drivers. On demos using this feature, give a warning on unsupported devices
* so that the user can supply their own serial number descriptor instead or remove the USE_INTERNAL_SERIAL value
* from the Device Descriptor (forcing the host to generate a serial number for each device from the VID, PID and
* port location).
*/
#if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)
#warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.
#endif
/** HID class report descriptor. This is a special descriptor constructed with values from the
* USBIF HID class specification to describe the reports and capabilities of the HID device. This
* descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
......
......@@ -123,8 +123,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
......@@ -132,6 +131,7 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB
LUFA_OPTS += -D INTERRUPT_CONTROL_ENDPOINT
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c \
Descriptors.c \
......
......@@ -123,6 +123,9 @@
/** Determines if the given audio interface is ready for a sample to be read from it, and selects the streaming
* OUT endpoint ready for reading.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
*
* \return Boolean true if the given Audio interface has a sample to be read, false otherwise
......@@ -132,6 +135,9 @@
/** Determines if the given audio interface is ready to accept the next sample to be written to it, and selects
* the streaming IN endpoint ready for writing.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
*
* \return Boolean true if the given Audio interface is ready to accept the next sample, false otherwise
......
......@@ -157,6 +157,9 @@
/** Sends a given string to the attached USB host, if connected. If a host is not connected when the function is called, the
* string is discarded.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
* \param[in] Data Pointer to the string to send to the host
* \param[in] Length Size in bytes of the string to send to the host
......@@ -169,6 +172,9 @@
/** Sends a given byte to the attached USB host, if connected. If a host is not connected when the function is called, the
* byte is discarded.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
* \param[in] Data Byte of data to send to the host
*
......@@ -177,6 +183,9 @@
uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1);
/** Determines the number of bytes received by the CDC interface from the host, waiting to be read.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
*
......@@ -188,6 +197,9 @@
* returns 0. The \ref CDC_Device_BytesReceived() function should be queried before data is received to ensure that no data
* underflow occurs.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
*
* \return Next received byte from the host, or 0 if no data received
......@@ -195,6 +207,9 @@
uint8_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Flushes any data waiting to be sent, ensuring that the send buffer is cleared.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
*
......@@ -207,6 +222,9 @@
* until they are cleared via a second notification. This should be called each time the CDC class driver's
* ControlLineStates.DeviceToHost value is updated to push the new states to the USB host.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
*/
void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
......
......@@ -186,10 +186,4 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
}
}
void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo)
{
if (HIDInterfaceInfo->State.IdleMSRemaining)
HIDInterfaceInfo->State.IdleMSRemaining--;
}
#endif
......@@ -138,7 +138,12 @@
*
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state
*/
void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);
static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo)
{
if (HIDInterfaceInfo->State.IdleMSRemaining)
HIDInterfaceInfo->State.IdleMSRemaining--;
}
/** HID class driver callback for the user creation of a HID IN report. This callback may fire in response to either
* HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback the
......
......@@ -112,6 +112,9 @@
void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Sends a MIDI event packet to the host. If no host is connected, the event packet is discarded.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
* \param[in] Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send
......@@ -122,6 +125,9 @@
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
/** Receives a MIDI event packet from the host.
*
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
* the call will fail.
*
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
* \param[out] Event Pointer to a USB_MIDI_EventPacket_t structure where the received MIDI event is to be placed
......
......@@ -177,6 +177,9 @@
/** Sends a given string to the attached USB device, if connected. If a device is not connected when the function is called, the
* string is discarded.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
* \param[in] Data Pointer to the string to send to the device
* \param[in] Length Size in bytes of the string to send to the device
......@@ -189,6 +192,9 @@
/** Sends a given byte to the attached USB device, if connected. If a host is not connected when the function is called, the
* byte is discarded.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
* \param[in] Data Byte of data to send to the device
*
......@@ -197,6 +203,9 @@
uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1);
/** Determines the number of bytes received by the CDC interface from the device, waiting to be read.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
*
......@@ -208,6 +217,9 @@
* returns 0. The \ref CDC_Host_BytesReceived() function should be queried before data is received to ensure that no data
* underflow occurs.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
*
* \return Next received byte from the device, or 0 if no data received
......@@ -215,6 +227,9 @@
uint8_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Flushes any data waiting to be sent, ensuring that the send buffer is cleared.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
*
......
......@@ -220,6 +220,9 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
void* Buffer, const uint16_t ReportSize)
{
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
if ((USB_HostState != HOST_STATE_Configured) || !(HIDInterfaceInfo->State.IsActive))
return false;
if (HIDInterfaceInfo->State.DeviceUsesOUTPipe)
{
uint8_t ErrorCode;
......
......@@ -159,6 +159,9 @@
/** Receives a HID IN report from the attached HID device, when a report has been received on the HID IN Data pipe.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \note The destination buffer should be large enough to accommodate the largest report that the attached device
* can generate.
*
......@@ -172,6 +175,9 @@
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
/** Receives a HID IN report from the attached device, by the report ID.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method is unavailable.
*
......@@ -188,6 +194,9 @@
/** Sends an OUT report to the currently attached HID device, using the device's OUT pipe if available or the device's
* Control pipe if not.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, the ReportID parameter is removed
* from the parameter list of this function.
*
......@@ -211,6 +220,9 @@
#endif
/** Determines if a HID IN report has been received from the attached device on the data IN pipe.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
*
......
......@@ -120,6 +120,9 @@
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
/** Sends a MIDI event packet to the device. If no device is connected, the event packet is discarded.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
* \param[in] Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send
......@@ -130,6 +133,9 @@
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
/** Receives a MIDI event packet from the device.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
* \param[out] Event Pointer to a USB_MIDI_EventPacket_t structure where the received MIDI event is to be placed
......
......@@ -164,6 +164,9 @@
/** Retrieves the Mass Storage device's inquiry data for the specified LUN, indicating the device characteristics and
* properties.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
* \param[in] LUNIndex LUN index within the device the command is being issued to
* \param[out] InquiryData Location where the read inquiry data should be stored
......@@ -185,6 +188,9 @@
ATTR_NON_NULL_PTR_ARG(1);
/** Retrieves the total capacity of the attached USB Mass Storage device, in blocks, and block size.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
* \param[in] LUNIndex LUN index within the device the command is being issued to
......@@ -199,6 +205,9 @@
/** Retrieves the device sense data, indicating the current device state and error codes for the previously
* issued command.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
* \param[in] LUNIndex LUN index within the device the command is being issued to
* \param[out] SenseData Pointer to the location where the sense information should be stored
......@@ -212,6 +221,9 @@
/** Issues a PREVENT MEDIUM REMOVAL command, to logically (or, depending on the type of device, physically) lock
* the device from removal so that blocks of data on the medium can be read or altered.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
* \param[in] LUNIndex LUN index within the device the command is being issued to
* \param[in] PreventRemoval Boolean true if the device should be locked from removal, false otherwise
......@@ -222,6 +234,9 @@
const bool PreventRemoval) ATTR_NON_NULL_PTR_ARG(1);
/** Reads blocks of data from the attached Mass Storage device's medium.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
* \param[in] LUNIndex LUN index within the device the command is being issued to
......@@ -237,6 +252,9 @@
void* BlockBuffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(6);
/** Writes blocks of data to the attached Mass Storage device's medium.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
* \param[in] LUNIndex LUN index within the device the command is being issued to
......
......@@ -156,6 +156,9 @@
* printer is able to understand - for example, PCL data. Not all printers accept all printer languages; see
* \ref PRNT_Host_GetDeviceID() for details on determining acceptable languages for an attached printer.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
* \param[in] PrinterCommands Pointer to a buffer containing the raw command stream to send to the printer
* \param[in] CommandSize Size in bytes of the command stream to be sent
......
......@@ -189,6 +189,9 @@
uint16_t MaxLength) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
/** Determines if a packet is currently waiting for the host to read in and process.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
*
......@@ -200,6 +203,9 @@
/** Retrieves the next pending packet from the device, discarding the remainder of the RNDIS packet header to leave
* only the packet contents for processing by the host in the nominated buffer.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
* \param[out] Buffer Pointer to a buffer where the packer data is to be written to
* \param[out] PacketLength Pointer to where the length in bytes of the read packet is to be stored
......@@ -210,6 +216,9 @@
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3);
/** Sends the given packet to the attached RNDIS device, after adding a RNDIS packet message header.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
* \param[in] Buffer Pointer to a buffer where the packer data is to be read from
......
......@@ -134,7 +134,10 @@
/** Opens a new PIMA session with the attached device. This should be used before any session-orientated PIMA commands
* are issued to the device. Only one session can be open at the one time.
*
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
*
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
......@@ -144,7 +147,10 @@
/** Closes an already opened PIMA session with the attached device. This should be used after all session-orientated
* PIMA commands have been issued to the device.
*
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
*
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
......@@ -155,6 +161,9 @@
/** Sends a raw PIMA block header to the device, filling out the transaction ID automatically. This can be used to send
* arbitrary PIMA blocks to the device with or without parameters.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
* \param[in] PIMAHeader Pointer to a PIMA container structure that is to be sent
*
......@@ -165,6 +174,9 @@
/** Receives a raw PIMA block header to the device. This can be used to receive arbitrary PIMA blocks from the device with
* or without parameters.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
* \param[out] PIMAHeader Pointer to a PIMA container structure where the received block is to be stored
*
......@@ -173,7 +185,10 @@
uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, SI_PIMA_Container_t* const PIMAHeader);
/** Sends a given PIMA command to the attached device, filling out the PIMA command header's Transaction ID automatically.
*
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
* \param[in] Operation PIMA operation code to issue to the device
* \param[in] TotalParams Total number of 32-bit parameters to send to the device in the issued command block
......@@ -187,7 +202,10 @@
/** Receives and checks a response block from the attached PIMA device, once a command has been issued and all data
* associated with the command has been transferred.
*
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
*
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
......@@ -196,6 +214,9 @@
uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Indicates if the device has issued a PIMA event block to the host via the asynchronous events pipe.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
*
......@@ -204,6 +225,9 @@
bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Receives an asynchronous event block from the device via the asynchronous events pipe.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
* \param[out] PIMAHeader Pointer to a PIMA container structure where the event should be stored
......@@ -218,6 +242,9 @@
/** Sends arbitrary data to the attached device, for use in the data phase of PIMA commands which require data
* transfer beyond the regular PIMA command block parameters.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
* \param[in] Buffer Pointer to a buffer where the data to send has been stored
* \param[in] Bytes Length in bytes of the data in the buffer to send to the attached device
......@@ -230,6 +257,9 @@
/** Receives arbitrary data from the attached device, for use in the data phase of PIMA commands which require data
* transfer beyond the regular PIMA command block parameters.
*
* \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
* call will fail.
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
* \param[out] Buffer Pointer to a buffer where the received data is to be stored
* \param[in] Bytes Length in bytes of the data to read
......
......@@ -18,6 +18,7 @@
* The following is a list of known AVR USB development boards, which recommend using LUFA for the USB stack. Some of these
* are open design, and all are available for purchase as completed development boards suitable for project development.
*
* - AT90USB162 Breadboard PCB (Russian): http://microsin.ru/content/view/685/44/
* - Benito #7, a no-frills USB board: http://www.dorkbotpdx.org/wiki/benito
* - Bumble-B, yet another AT90USB162 development board: http://fletchtronics.net/bumble-b
* - Micropendous, an open design/source set of AVR USB development boards: http://micropendous.org/
......@@ -64,4 +65,8 @@
* - Lightweight CC110x USB dongle for 868MHz Protocols: http://busware.de/tiki-index.php?page=CUL
* - Mobo 4.3, a USB controlled all band (160-10m) HF SDR transceiver: http://sites.google.com/site/lofturj/mobo4_3
* - SEGA Megadrive/Super Nintendo Cartridge Reader: http://www.snega2usb.com
*
* \section Sec_LUFAPublications Publications Mentioning LUFA
* - Elektor Magazine, "My First AVR-USB" by Antoine Authier (feature), January 2010 Issue
* - Elektor Magazine, "USB is Cool/Sucks" by Jerry Jacobs and Chris Vossen (minor mention), January 2010 Issue
*/
\ No newline at end of file
......@@ -79,8 +79,6 @@ void DiskHost_USBTask(void)
return;
}
USB_HostState = HOST_STATE_Configured;
uint8_t MaxLUNIndex;
if (MS_Host_GetMaxLUN(&DiskHost_MS_Interface, &MaxLUNIndex))
{
......@@ -96,6 +94,10 @@ void DiskHost_USBTask(void)
return;
}
USB_HostState = HOST_STATE_Configured;
/* Note: For the RequestSense call to work, the host state machine must be in the
* Configured state, or the call will be aborted */
SCSI_Request_Sense_Response_t SenseData;
if (MS_Host_RequestSense(&DiskHost_MS_Interface, 0, &SenseData) != 0)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment