projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7f9f97c
)
Clean up MassStorageKeyboard demo.
author
Dean Camera
<dean@fourwalledcubicle.com>
Sun, 3 Jan 2010 03:48:40 +0000
(
03:48
+0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Sun, 3 Jan 2010 03:48:40 +0000
(
03:48
+0000)
Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
patch
|
blob
|
blame
|
history
Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h
patch
|
blob
|
blame
|
history
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
patch
|
blob
|
blame
|
history
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Class/Host/HIDParser.h
patch
|
blob
|
blame
|
history
LUFA/ManPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
LUFA/ManPages/FutureChanges.txt
patch
|
blob
|
blame
|
history
diff --git
a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
index
1deda8e
..
b779ea3
100644
(file)
--- a/
Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
+++ b/
Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
@@
-29,6
+29,10
@@
this software.
\r
*/
\r
\r
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
/** \file
\r
*
\r
* USB Device Descriptors, for library use when in USB device mode. Descriptors are special
\r
@@
-129,7
+133,7
@@
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
\r
},
\r
\r
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
\r
},
\r
\r
- .Interface =
\r
+ .
MassStorage
Interface =
\r
{
\r
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
\r
\r
{
\r
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
\r
\r
@@
-145,7
+149,7
@@
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR
\r
},
\r
\r
.InterfaceStrIndex = NO_DESCRIPTOR
\r
},
\r
\r
- .DataInEndpoint =
\r
+ .
MassStorage
DataInEndpoint =
\r
{
\r
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
\r
\r
{
\r
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
\r
\r
@@
-155,7
+159,7
@@
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.PollingIntervalMS = 0x00
\r
},
\r
\r
.PollingIntervalMS = 0x00
\r
},
\r
\r
- .DataOutEndpoint =
\r
+ .
MassStorage
DataOutEndpoint =
\r
{
\r
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
\r
\r
{
\r
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
\r
\r
@@
-181,8
+185,6
@@
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR
\r
},
\r
\r
.InterfaceStrIndex = NO_DESCRIPTOR
\r
},
\r
\r
-
\r
-
\r
.KeyboardHID =
\r
{
\r
.Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},
\r
.KeyboardHID =
\r
{
\r
.Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},
\r
diff --git
a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h
b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h
index
6904b89
..
c29d908
100644
(file)
--- a/
Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h
+++ b/
Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h
@@
-44,10
+44,6
@@
#include <LUFA/Drivers/USB/Class/MassStorage.h>
\r
#include <LUFA/Drivers/USB/Class/HID.h>
\r
\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
/* Macros: */
\r
/** Endpoint number of the Keyboard HID reporting IN endpoint. */
\r
#define KEYBOARD_EPNUM 1
\r
@@
-72,22
+68,13
@@
typedef struct
\r
{
\r
USB_Descriptor_Configuration_Header_t Config;
\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
MassStorage
Interface;
\r
+ USB_Descriptor_Endpoint_t
MassStorage
DataInEndpoint;
\r
+ USB_Descriptor_Endpoint_t
MassStorage
DataOutEndpoint;
\r
USB_Descriptor_Interface_t KeyboardInterface;
\r
USB_HID_Descriptor_t KeyboardHID;
\r
USB_Descriptor_Endpoint_t KeyboardEndpoint;
\r
} USB_Descriptor_Configuration_t;
\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
/* Function Prototypes: */
\r
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
\r
diff --git
a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
index
25b51b5
..
683ab66
100644
(file)
--- a/
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
+++ b/
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
@@
-118,12
+118,6
@@
void SetupHardware(void)
\r
/* Clear Dataflash sector protections, if enabled */
\r
DataflashManager_ResetDataflashProtections();
\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
\r
/** Event handler for the library USB Connection event. */
\r
@@
-145,8
+139,11
@@
void EVENT_USB_Device_ConfigurationChanged(void)
\r
if (!(MS_Device_ConfigureEndpoints(&Disk_MS_Interface)))
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
\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
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
}
\r
\r
/** Event handler for the library USB Unhandled Control Request event. */
\r
@@
-171,10
+168,10
@@
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfa
return CommandSuccess;
\r
}
\r
\r
return CommandSuccess;
\r
}
\r
\r
-/**
ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when se
t. */
\r
-
ISR(TIMER0_COMPA_vect, ISR_BLOCK
)
\r
+/**
Event handler for the USB device Start Of Frame even
t. */
\r
+
void EVENT_USB_Device_StartOfFrame(void
)
\r
{
\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
}
\r
\r
/** HID class driver callback function for the creation of HID reports to the host.
\r
diff --git
a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h
b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h
index
ce21145
..
41b899a
100644
(file)
--- a/
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h
+++ b/
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h
@@
-87,6
+87,7
@@
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_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
\r
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfaceInfo);
\r
\r
diff --git
a/LUFA/Drivers/USB/Class/Host/HIDParser.h
b/LUFA/Drivers/USB/Class/Host/HIDParser.h
index
c03f9f1
..
53601ec
100644
(file)
--- a/
LUFA/Drivers/USB/Class/Host/HIDParser.h
+++ b/
LUFA/Drivers/USB/Class/Host/HIDParser.h
@@
-198,7
+198,7
@@
typedef struct
\r
{
\r
uint16_t BitOffset; /**< Bit offset in the IN, OUT or FEATURE report of the item. */
\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_
ReportItem
Types_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
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
diff --git
a/LUFA/ManPages/ChangeLog.txt
b/LUFA/ManPages/ChangeLog.txt
index
a64428e
..
eea1f2b
100644
(file)
--- a/
LUFA/ManPages/ChangeLog.txt
+++ b/
LUFA/ManPages/ChangeLog.txt
@@
-20,6
+20,8
@@
* - 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
* - 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
*
\r
* <b>Fixed:</b>
\r
* - Fixed AVRISP project not able to enter programming mode when ISP protocol is used
\r
diff --git
a/LUFA/ManPages/FutureChanges.txt
b/LUFA/ManPages/FutureChanges.txt
index
3267afc
..
38cbf0c
100644
(file)
--- a/
LUFA/ManPages/FutureChanges.txt
+++ b/
LUFA/ManPages/FutureChanges.txt
@@
-27,6
+27,7
@@
* - Demos/Projects
\r
* -# Multiple-Report HID device
\r
* -# Device/Host USB bridge
\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
* -# Finish BluetoothHost demo
\r
* -# Finish MIDI class Bootloader
\r
* -# Finish SideShow demo
\r