this software.\r
*/\r
\r
+#if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
+ #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
+#endif\r
+\r
/** \file\r
*\r
* USB Device Descriptors, for library use when in USB device mode. Descriptors are special \r
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)\r
},\r
\r
- .Interface = \r
+ .MassStorageInterface = \r
{\r
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
\r
.InterfaceStrIndex = NO_DESCRIPTOR\r
},\r
\r
- .DataInEndpoint = \r
+ .MassStorageDataInEndpoint = \r
{\r
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
\r
.PollingIntervalMS = 0x00\r
},\r
\r
- .DataOutEndpoint = \r
+ .MassStorageDataOutEndpoint = \r
{\r
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
\r
.InterfaceStrIndex = NO_DESCRIPTOR\r
},\r
\r
-\r
-\r
.KeyboardHID = \r
{ \r
.Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},\r
#include <LUFA/Drivers/USB/Class/MassStorage.h>\r
#include <LUFA/Drivers/USB/Class/HID.h>\r
\r
- #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)\r
- #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.\r
- #endif\r
-\r
/* Macros: */\r
/** Endpoint number of the Keyboard HID reporting IN endpoint. */\r
#define KEYBOARD_EPNUM 1\r
typedef struct\r
{\r
USB_Descriptor_Configuration_Header_t Config;\r
- USB_Descriptor_Interface_t Interface;\r
- USB_Descriptor_Endpoint_t DataInEndpoint;\r
- USB_Descriptor_Endpoint_t DataOutEndpoint;\r
+ USB_Descriptor_Interface_t MassStorageInterface;\r
+ USB_Descriptor_Endpoint_t MassStorageDataInEndpoint;\r
+ USB_Descriptor_Endpoint_t MassStorageDataOutEndpoint;\r
USB_Descriptor_Interface_t KeyboardInterface;\r
USB_HID_Descriptor_t KeyboardHID;\r
USB_Descriptor_Endpoint_t KeyboardEndpoint;\r
} USB_Descriptor_Configuration_t;\r
-\r
-/* typedef struct\r
- {\r
- USB_Descriptor_Configuration_Header_t Config;\r
- USB_Descriptor_Interface_t Interface;\r
- USB_HID_Descriptor_t KeyboardHID;\r
- USB_Descriptor_Endpoint_t KeyboardEndpoint;\r
- } USB_Descriptor_Configuration_keyboard_t;\r
-// */\r
\r
/* Function Prototypes: */\r
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
\r
/* Clear Dataflash sector protections, if enabled */\r
DataflashManager_ResetDataflashProtections();\r
-\r
- /* Millisecond timer initialization, with output compare interrupt enabled for the HID idle timing */\r
- OCR0A = ((F_CPU / 64) / 1000);\r
- TCCR0A = (1 << WGM01);\r
- TCCR0B = ((1 << CS01) | (1 << CS00));\r
- TIMSK0 = (1 << OCIE0A);\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
\r
if (!(MS_Device_ConfigureEndpoints(&Disk_MS_Interface)))\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
+\r
if (!(HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface)))\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
+\r
+ USB_Device_EnableSOFEvents();\r
}\r
\r
/** Event handler for the library USB Unhandled Control Request event. */\r
return CommandSuccess;\r
}\r
\r
-/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
-ISR(TIMER0_COMPA_vect, ISR_BLOCK)\r
+/** Event handler for the USB device Start Of Frame event. */\r
+void EVENT_USB_Device_StartOfFrame(void)\r
{\r
- HID_Device_MillisecondElapsed(&Keyboard_HID_Interface);\r
+ HID_Device_MillisecondElapsed(&Keyboard_HID_Interface);\r
}\r
\r
/** HID class driver callback function for the creation of HID reports to the host.\r
void EVENT_USB_Device_Disconnect(void);\r
void EVENT_USB_Device_ConfigurationChanged(void);\r
void EVENT_USB_Device_UnhandledControlRequest(void);\r
+ void EVENT_USB_Device_StartOfFrame(void);\r
\r
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfaceInfo);\r
\r
typedef struct\r
{\r
uint16_t BitOffset; /**< Bit offset in the IN, OUT or FEATURE report of the item. */\r
- uint8_t ItemType; /**< Report item type, a value in HID_Types_t. */\r
+ uint8_t ItemType; /**< Report item type, a value in HID_ReportItemTypes_t. */\r
uint16_t ItemFlags; /**< Item data flags, such as constant/variable, etc. */\r
uint8_t ReportID; /**< Report ID this item belongs to, or 0x00 if device has only one report */\r
HID_CollectionPath_t* CollectionPath; /**< Collection path of the item. */\r
* - Renamed the AVRISP project folder to AVRISP-MKII to reduce confusion\r
* - Renamed the RESET_LINE_* makefile tokens in the AVRISP MKII Project to AUX_LINE_*, as they are not always used for target\r
* reset\r
+ * - Changed over the MassStorageKeyboard Class driver device demo to use Start of Frame events rather than a timer to keep track\r
+ * of elapsed milliseconds\r
*\r
* <b>Fixed:</b>\r
* - Fixed AVRISP project not able to enter programming mode when ISP protocol is used\r
* - Demos/Projects\r
* -# Multiple-Report HID device\r
* -# Device/Host USB bridge\r
+ * -# Alternative (USB-IF endorsed) USB-Ethernet Classes\r
* -# Finish BluetoothHost demo\r
* -# Finish MIDI class Bootloader\r
* -# Finish SideShow demo\r