Some minor whitespace corrections.
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 11 Jun 2009 01:52:53 +0000 (01:52 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 11 Jun 2009 01:52:53 +0000 (01:52 +0000)
24 files changed:
Demos/Device/ClassDriver/AudioInput/AudioInput.h
Demos/Device/ClassDriver/AudioInput/Descriptors.c
Demos/Device/ClassDriver/AudioInput/Descriptors.h
Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
Demos/Device/ClassDriver/AudioOutput/Descriptors.c
Demos/Device/ClassDriver/AudioOutput/Descriptors.h
Demos/Device/ClassDriver/CDC/Descriptors.c
Demos/Device/ClassDriver/CDC/Descriptors.h
Demos/Device/ClassDriver/DualCDC/Descriptors.c
Demos/Device/ClassDriver/DualCDC/Descriptors.h
Demos/Device/ClassDriver/Joystick/Descriptors.c
Demos/Device/ClassDriver/Joystick/Descriptors.h
Demos/Device/ClassDriver/Keyboard/Keyboard.c
Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h
Demos/Device/ClassDriver/MIDI/Descriptors.c
Demos/Device/ClassDriver/Mouse/Descriptors.c
Demos/Device/ClassDriver/Mouse/Mouse.c
Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c
Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
Demos/Device/ClassDriver/USBtoSerial/Descriptors.c
Demos/Device/LowLevel/AudioInput/Descriptors.c
Demos/Device/LowLevel/AudioOutput/AudioOutput.c
Demos/Device/LowLevel/AudioOutput/Descriptors.c
Demos/Device/LowLevel/USBtoSerial/Descriptors.c

index 40c478b..1c67ac5 100644 (file)
                #include <avr/power.h>\r
 \r
                #include "Descriptors.h"\r
-                               \r
+\r
                #include <LUFA/Version.h>\r
                #include <LUFA/Drivers/Board/LEDs.h>\r
                #include <LUFA/Drivers/Board/Joystick.h>\r
                #include <LUFA/Drivers/Peripheral/ADC.h>\r
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/Device/Audio.h>\r
-               \r
+\r
        /* Macros: */\r
                /** ADC channel number for the microphone input. */\r
                #define MIC_IN_ADC_CHANNEL        2\r
-               \r
+\r
                /** Maximum ADC sample value for the microphone input. */\r
                #define SAMPLE_MAX_RANGE          0xFFFF\r
 \r
 \r
                /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */\r
                #define LEDMASK_USB_ERROR        (LEDS_LED1 | LEDS_LED3)\r
-               \r
+\r
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
                void ProcessNextSample(void);\r
-               \r
+\r
                void EVENT_USB_Connect(void);\r
                void EVENT_USB_Disconnect(void);\r
                void EVENT_USB_ConfigurationChanged(void);\r
index 6697cfe..8bb7660 100644 (file)
 USB_Descriptor_Device_t PROGMEM DeviceDescriptor =\r
 {\r
        .Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},\r
-               \r
+\r
        .USBSpecification       = VERSION_BCD(02.00),\r
        .Class                  = 0x00,\r
        .SubClass               = 0x00,\r
        .Protocol               = 0x00,\r
-                               \r
+\r
        .Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,\r
-               \r
+\r
        .VendorID               = 0x03EB,\r
        .ProductID              = 0x2047,\r
        .ReleaseNumber          = 0x0000,\r
-               \r
+\r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
        .SerialNumStrIndex      = NO_DESCRIPTOR,\r
-               \r
+\r
        .NumberOfConfigurations = 1\r
 };\r
 \r
@@ -80,12 +80,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 \r
                        .ConfigurationNumber      = 1,\r
                        .ConfigurationStrIndex    = NO_DESCRIPTOR,\r
-                               \r
+\r
                        .ConfigAttributes         = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),\r
-                       \r
+\r
                        .MaxPowerConsumption      = USB_CONFIG_POWER_MA(100)\r
                },\r
-               \r
+\r
        .AudioControlInterface = \r
                {\r
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
@@ -94,40 +94,40 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .AlternateSetting         = 0,\r
                        \r
                        .TotalEndpoints           = 0,\r
-                               \r
+\r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x01,\r
                        .Protocol                 = 0x00,\r
-                               \r
-                       .InterfaceStrIndex        = NO_DESCRIPTOR                       \r
+\r
+                       .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
-       \r
+\r
        .AudioControlInterface_SPC = \r
                {\r
                        .Header                   = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface},\r
                        .Subtype                  = DSUBTYPE_Header,\r
-                       \r
+\r
                        .ACSpecification          = VERSION_BCD(01.00),\r
                        .TotalLength              = (sizeof(USB_AudioInterface_AC_t) +\r
                                                     sizeof(USB_AudioInputTerminal_t) +\r
-                                                                            sizeof(USB_AudioOutputTerminal_t)),\r
+                                                    sizeof(USB_AudioOutputTerminal_t)),\r
                        \r
                        .InCollection             = 1,\r
-                       .InterfaceNumbers         = {1},                        \r
+                       .InterfaceNumbers         = {1},\r
                },\r
 \r
        .InputTerminal = \r
                {\r
                        .Header                   = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface},\r
                        .Subtype                  = DSUBTYPE_InputTerminal,\r
-               \r
+\r
                        .TerminalID               = 0x01,\r
                        .TerminalType             = TERMINAL_IN_MIC,\r
                        .AssociatedOutputTerminal = 0x00,\r
-                       \r
+\r
                        .TotalChannels            = 1,\r
                        .ChannelConfig            = 0,\r
-                       \r
+\r
                        .ChannelStrIndex          = NO_DESCRIPTOR,\r
                        .TerminalStrIndex         = NO_DESCRIPTOR\r
                },\r
@@ -136,14 +136,14 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {\r
                        .Header                   = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface},\r
                        .Subtype                  = DSUBTYPE_OutputTerminal,\r
-               \r
+\r
                        .TerminalID               = 0x02,\r
                        .TerminalType             = TERMINAL_STREAMING,\r
                        .AssociatedInputTerminal  = 0x00,\r
-                       \r
+\r
                        .SourceID                 = 0x01,\r
-                       \r
-                       .TerminalStrIndex         = NO_DESCRIPTOR                       \r
+\r
+                       .TerminalStrIndex         = NO_DESCRIPTOR\r
                },\r
 \r
        .AudioStreamInterface_Alt0 = \r
@@ -152,13 +152,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 \r
                        .InterfaceNumber          = 1,\r
                        .AlternateSetting         = 0,\r
-                       \r
+\r
                        .TotalEndpoints           = 0,\r
-                               \r
+\r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x02,\r
                        .Protocol                 = 0x00,\r
-                               \r
+\r
                        .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
 \r
@@ -168,27 +168,27 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 \r
                        .InterfaceNumber          = 1,\r
                        .AlternateSetting         = 1,\r
-                       \r
+\r
                        .TotalEndpoints           = 1,\r
-                               \r
+\r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x02,\r
                        .Protocol                 = 0x00,\r
-                               \r
+\r
                        .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
-               \r
+\r
        .AudioStreamInterface_SPC = \r
                {\r
                        .Header                   = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface},\r
                        .Subtype                  = DSUBTYPE_General,\r
-                       \r
+\r
                        .TerminalLink             = 0x02,\r
-                       \r
+\r
                        .FrameDelay               = 1,\r
                        .AudioFormat              = 0x0001\r
                },\r
-               \r
+\r
        .AudioFormat = \r
                {\r
                        .Header                   = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface},\r
@@ -239,7 +239,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 USB_Descriptor_String_t PROGMEM LanguageString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = {LANGUAGE_ID_ENG}\r
 };\r
 \r
@@ -250,7 +250,7 @@ USB_Descriptor_String_t PROGMEM LanguageString =
 USB_Descriptor_String_t PROGMEM ManufacturerString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"Dean Camera"\r
 };\r
 \r
@@ -261,7 +261,7 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
 USB_Descriptor_String_t PROGMEM ProductString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"LUFA Audio In Demo"\r
 };\r
 \r
index 0da8952..b2225b2 100644 (file)
@@ -47,7 +47,7 @@
                        /** Endpoint number of the Audio isochronous streaming data endpoint. */\r
                        #define AUDIO_STREAM_EPNUM       1\r
                #else\r
-                       #define AUDIO_STREAM_EPNUM       3              \r
+                       #define AUDIO_STREAM_EPNUM       3\r
                #endif\r
                \r
                /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires\r
                 *  USB AVR models will result in unavoidable distorted output.\r
                 */\r
                #define AUDIO_STREAM_EPSIZE          ENDPOINT_MAX_SIZE(AUDIO_STREAM_EPNUM)\r
-               \r
+\r
                /** Sample frequency of the data being transmitted through the streaming endpoint. */\r
                #define AUDIO_SAMPLE_FREQUENCY       48000\r
-               \r
+\r
        /* Type Defines: */\r
                /** Type define for the device configuration descriptor structure. This must be defined in the\r
                 *  application code, as the configuration descriptor contains several sub-descriptors which\r
@@ -78,7 +78,7 @@
                        USB_AudioStreamEndpoint_Std_t         AudioEndpoint;\r
                        USB_AudioStreamEndpoint_Spc_t         AudioEndpoint_SPC;\r
                } USB_Descriptor_Configuration_t;\r
-               \r
+\r
        /* Function Prototypes: */\r
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
                                                    ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
index 8c3bf61..4497963 100644 (file)
@@ -99,7 +99,7 @@ void ProcessNextSample(void)
                /* Massage signed 16-bit left and right audio samples into signed 8-bit */\r
                int8_t  LeftSample_8Bit   = (LeftSample_16Bit  >> 8);\r
                int8_t  RightSample_8Bit  = (RightSample_16Bit >> 8);\r
-                       \r
+\r
                /* Mix the two channels together to produce a mono, 8-bit sample */\r
                int8_t  MixedSample_8Bit  = (((int16_t)LeftSample_8Bit + (int16_t)RightSample_8Bit) >> 1);\r
 \r
@@ -160,9 +160,9 @@ void EVENT_USB_Connect(void)
 #if (defined(AUDIO_OUT_MONO) || defined(AUDIO_OUT_STEREO))\r
        /* PWM speaker timer initialization */\r
        TCCRxA  = ((1 << WGMx0) | (1 << COMxA1) | (1 << COMxA0)\r
-                                                       | (1 << COMxB1) | (1 << COMxB0)); // Set on match, clear on TOP\r
+               | (1 << COMxB1) | (1 << COMxB0)); // Set on match, clear on TOP\r
        TCCRxB  = ((1 << WGMx2) | (1 << CSx0));  // Fast 8-Bit PWM, Fcpu speed\r
-#endif \r
+#endif\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
@@ -176,7 +176,7 @@ void EVENT_USB_Disconnect(void)
 #if (defined(AUDIO_OUT_MONO) || defined(AUDIO_OUT_STEREO))\r
        /* Stop the PWM generation timer */\r
        TCCRxB = 0;\r
-#endif         \r
+#endif\r
 \r
 #if defined(AUDIO_OUT_MONO)\r
        /* Set speaker as input to reduce current draw */\r
index 0039c2b..01d3bc7 100644 (file)
 USB_Descriptor_Device_t PROGMEM DeviceDescriptor =\r
 {\r
        .Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},\r
-               \r
+\r
        .USBSpecification       = VERSION_BCD(02.00),\r
        .Class                  = 0x00,\r
        .SubClass               = 0x00,\r
        .Protocol               = 0x00,\r
-                               \r
+\r
        .Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,\r
-               \r
+\r
        .VendorID               = 0x03EB,\r
        .ProductID              = 0x2046,\r
        .ReleaseNumber          = 0x0000,\r
-               \r
+\r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
        .SerialNumStrIndex      = NO_DESCRIPTOR,\r
-               \r
+\r
        .NumberOfConfigurations = 1\r
 };\r
 \r
@@ -80,7 +80,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 \r
                        .ConfigurationNumber      = 1,\r
                        .ConfigurationStrIndex    = NO_DESCRIPTOR,\r
-                               \r
+                       \r
                        .ConfigAttributes         = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),\r
                        \r
                        .MaxPowerConsumption      = USB_CONFIG_POWER_MA(100)\r
@@ -94,12 +94,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .AlternateSetting         = 0,\r
                        \r
                        .TotalEndpoints           = 0,\r
-                               \r
+                       \r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x01,\r
                        .Protocol                 = 0x00,\r
-                               \r
-                       .InterfaceStrIndex        = NO_DESCRIPTOR                       \r
+                       \r
+                       .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
        \r
        .AudioControlInterface_SPC = \r
@@ -109,11 +109,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        \r
                        .ACSpecification          = VERSION_BCD(01.00),\r
                        .TotalLength              = (sizeof(USB_AudioInterface_AC_t) +\r
-                                                  sizeof(USB_AudioInputTerminal_t) +\r
-                                                                          sizeof(USB_AudioOutputTerminal_t)),\r
+                                                    sizeof(USB_AudioInputTerminal_t) +\r
+                                                    sizeof(USB_AudioOutputTerminal_t)),\r
                        \r
                        .InCollection             = 1,\r
-                       .InterfaceNumbers         = {1},                        \r
+                       .InterfaceNumbers         = {1},\r
                },\r
 \r
        .InputTerminal = \r
@@ -143,7 +143,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        \r
                        .SourceID                 = 0x01,\r
                        \r
-                       .TerminalStrIndex         = NO_DESCRIPTOR                       \r
+                       .TerminalStrIndex         = NO_DESCRIPTOR\r
                },\r
 \r
        .AudioStreamInterface_Alt0 = \r
@@ -154,11 +154,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .AlternateSetting         = 0,\r
                        \r
                        .TotalEndpoints           = 0,\r
-                               \r
+                       \r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x02,\r
                        .Protocol                 = 0x00,\r
-                               \r
+                       \r
                        .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
 \r
@@ -170,11 +170,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .AlternateSetting         = 1,\r
                        \r
                        .TotalEndpoints           = 1,\r
-                               \r
+                       \r
                        .Class                    = 0x01,\r
                        .SubClass                 = 0x02,\r
                        .Protocol                 = 0x00,\r
-                               \r
+                       \r
                        .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
                \r
@@ -239,7 +239,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 USB_Descriptor_String_t PROGMEM LanguageString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = {LANGUAGE_ID_ENG}\r
 };\r
 \r
@@ -250,7 +250,7 @@ USB_Descriptor_String_t PROGMEM LanguageString =
 USB_Descriptor_String_t PROGMEM ManufacturerString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"Dean Camera"\r
 };\r
 \r
@@ -261,7 +261,7 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
 USB_Descriptor_String_t PROGMEM ProductString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"LUFA Audio Out Demo"\r
 };\r
 \r
index 1f03f64..f007890 100644 (file)
@@ -47,7 +47,7 @@
                        /** Endpoint number of the Audio isochronous streaming data endpoint. */\r
                        #define AUDIO_STREAM_EPNUM       1\r
                #else\r
-                       #define AUDIO_STREAM_EPNUM       3              \r
+                       #define AUDIO_STREAM_EPNUM       3\r
                #endif\r
                \r
                /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires\r
@@ -81,6 +81,6 @@
                \r
        /* Function Prototypes: */\r
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
-                                                                                       ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
+                                                   ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
 \r
 #endif\r
index 03e6882..9a2fe5e 100644 (file)
 USB_Descriptor_Device_t PROGMEM DeviceDescriptor =\r
 {\r
        .Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},\r
-               \r
+\r
        .USBSpecification       = VERSION_BCD(01.10),\r
        .Class                  = 0x02,\r
        .SubClass               = 0x00,\r
        .Protocol               = 0x00,\r
-                               \r
+\r
        .Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,\r
-               \r
+\r
        .VendorID               = 0x03EB,\r
        .ProductID              = 0x2044,\r
        .ReleaseNumber          = 0x0000,\r
-               \r
+\r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
        .SerialNumStrIndex      = NO_DESCRIPTOR,\r
-               \r
+\r
        .NumberOfConfigurations = 1\r
 };\r
 \r
@@ -77,10 +77,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 \r
                        .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),\r
                        .TotalInterfaces        = 2,\r
-                               \r
+                       \r
                        .ConfigurationNumber    = 1,\r
                        .ConfigurationStrIndex  = NO_DESCRIPTOR,\r
-                               \r
+                       \r
                        .ConfigAttributes       = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),\r
                        \r
                        .MaxPowerConsumption    = USB_CONFIG_POWER_MA(100)\r
@@ -94,11 +94,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .AlternateSetting       = 0,\r
                        \r
                        .TotalEndpoints         = 1,\r
-                               \r
+                       \r
                        .Class                  = 0x02,\r
                        .SubClass               = 0x02,\r
                        .Protocol               = 0x01,\r
-                               \r
+                       \r
                        .InterfaceStrIndex      = NO_DESCRIPTOR\r
                },\r
 \r
@@ -137,7 +137,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .ManagementEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),\r
                        .Attributes             = EP_TYPE_INTERRUPT,\r
                        .EndpointSize           = CDC_NOTIFICATION_EPSIZE,\r
@@ -163,7 +163,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .DataOutEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),\r
                        .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
@@ -173,7 +173,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .DataInEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),\r
                        .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
@@ -188,7 +188,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 USB_Descriptor_String_t PROGMEM LanguageString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = {LANGUAGE_ID_ENG}\r
 };\r
 \r
@@ -199,7 +199,7 @@ USB_Descriptor_String_t PROGMEM LanguageString =
 USB_Descriptor_String_t PROGMEM ManufacturerString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"Dean Camera"\r
 };\r
 \r
@@ -210,7 +210,7 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
 USB_Descriptor_String_t PROGMEM ProductString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"LUFA CDC Demo"\r
 };\r
 \r
@@ -258,6 +258,6 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
                        break;\r
        }\r
        \r
-       *DescriptorAddress = Address;           \r
+       *DescriptorAddress = Address;\r
        return Size;\r
 }\r
index 1a9dbb5..caea188 100644 (file)
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/Device/CDC.h>\r
 \r
-       /* Macros: */                    \r
+       /* Macros: */\r
                /** Endpoint number of the CDC device-to-host notification IN endpoint. */\r
                #define CDC_NOTIFICATION_EPNUM         2\r
 \r
                /** Endpoint number of the CDC device-to-host data IN endpoint. */\r
-               #define CDC_TX_EPNUM                   3        \r
+               #define CDC_TX_EPNUM                   3\r
 \r
                /** Endpoint number of the CDC host-to-device data OUT endpoint. */\r
-               #define CDC_RX_EPNUM                   4        \r
+               #define CDC_RX_EPNUM                   4\r
 \r
                /** Size in bytes of the CDC device-to-host notification IN endpoint. */\r
                #define CDC_NOTIFICATION_EPSIZE        8\r
 \r
                /** Size in bytes of the CDC data IN and OUT endpoints. */\r
-               #define CDC_TXRX_EPSIZE                16       \r
+               #define CDC_TXRX_EPSIZE                16\r
 \r
        /* Type Defines: */\r
                /** Type define for the device configuration descriptor structure. This must be defined in the\r
@@ -79,6 +79,6 @@
 \r
        /* Function Prototypes: */\r
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
-                                                                                       ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
+                                                   ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
 \r
 #endif\r
index 64aed7d..951a558 100644 (file)
 USB_Descriptor_Device_t PROGMEM DeviceDescriptor =\r
 {\r
        .Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},\r
-               \r
+       \r
        .USBSpecification       = VERSION_BCD(01.10),\r
        .Class                  = 0xEF,\r
        .SubClass               = 0x02,\r
        .Protocol               = 0x01,\r
-                               \r
+       \r
        .Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,\r
-               \r
+       \r
        .VendorID               = 0x03EB,\r
        .ProductID              = 0x204E,\r
        .ReleaseNumber          = 0x0000,\r
-               \r
+       \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
        .SerialNumStrIndex      = NO_DESCRIPTOR,\r
-               \r
+       \r
        .NumberOfConfigurations = 1\r
 };\r
 \r
@@ -77,10 +77,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 \r
                        .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),\r
                        .TotalInterfaces        = 4,\r
-                               \r
+                       \r
                        .ConfigurationNumber    = 1,\r
                        .ConfigurationStrIndex  = NO_DESCRIPTOR,\r
-                               \r
+                       \r
                        .ConfigAttributes       = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),\r
                        \r
                        .MaxPowerConsumption    = USB_CONFIG_POWER_MA(100)\r
@@ -108,11 +108,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .AlternateSetting       = 0,\r
                        \r
                        .TotalEndpoints         = 1,\r
-                               \r
+                       \r
                        .Class                  = 0x02,\r
                        .SubClass               = 0x02,\r
                        .Protocol               = 0x01,\r
-                               \r
+                       \r
                        .InterfaceStrIndex      = NO_DESCRIPTOR\r
                },\r
 \r
@@ -151,7 +151,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .CDC1_ManagementEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_NOTIFICATION_EPNUM),\r
                        .Attributes             = EP_TYPE_INTERRUPT,\r
                        .EndpointSize           = CDC_NOTIFICATION_EPSIZE,\r
@@ -166,18 +166,18 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .AlternateSetting       = 0,\r
                        \r
                        .TotalEndpoints         = 2,\r
-                               \r
+                       \r
                        .Class                  = 0x0A,\r
                        .SubClass               = 0x00,\r
                        .Protocol               = 0x00,\r
-                               \r
+                       \r
                        .InterfaceStrIndex      = NO_DESCRIPTOR\r
                },\r
 \r
        .CDC1_DataOutEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC1_RX_EPNUM),\r
                        .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
@@ -187,7 +187,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .CDC1_DataInEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_TX_EPNUM),\r
                        .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
@@ -216,11 +216,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .AlternateSetting       = 0,\r
                        \r
                        .TotalEndpoints         = 1,\r
-                               \r
+                       \r
                        .Class                  = 0x02,\r
                        .SubClass               = 0x02,\r
                        .Protocol               = 0x01,\r
-                               \r
+                       \r
                        .InterfaceStrIndex      = NO_DESCRIPTOR\r
                },\r
 \r
@@ -259,7 +259,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .CDC2_ManagementEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_NOTIFICATION_EPNUM),\r
                        .Attributes             = EP_TYPE_INTERRUPT,\r
                        .EndpointSize           = CDC_NOTIFICATION_EPSIZE,\r
@@ -285,7 +285,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .CDC2_DataOutEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC2_RX_EPNUM),\r
                        .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
@@ -295,7 +295,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .CDC2_DataInEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_TX_EPNUM),\r
                        .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
@@ -310,7 +310,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 USB_Descriptor_String_t PROGMEM LanguageString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = {LANGUAGE_ID_ENG}\r
 };\r
 \r
@@ -321,7 +321,7 @@ USB_Descriptor_String_t PROGMEM LanguageString =
 USB_Descriptor_String_t PROGMEM ManufacturerString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"Dean Camera"\r
 };\r
 \r
@@ -332,7 +332,7 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
 USB_Descriptor_String_t PROGMEM ProductString =\r
 {\r
        .Header                 = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},\r
-               \r
+\r
        .UnicodeString          = L"LUFA Dual CDC Demo"\r
 };\r
 \r
@@ -380,6 +380,6 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
                        break;\r
        }\r
        \r
-       *DescriptorAddress = Address;   \r
+       *DescriptorAddress = Address;\r
        return Size;\r
 }\r
index 97165e5..023cdc5 100644 (file)
                #define CDC1_NOTIFICATION_EPNUM        3\r
 \r
                /** Endpoint number of the first CDC interface's device-to-host data IN endpoint. */\r
-               #define CDC1_TX_EPNUM                  1        \r
+               #define CDC1_TX_EPNUM                  1\r
 \r
                /** Endpoint number of the first CDC interface's host-to-device data OUT endpoint. */\r
-               #define CDC1_RX_EPNUM                  2        \r
+               #define CDC1_RX_EPNUM                  2\r
 \r
                /** Endpoint number of the second CDC interface's device-to-host notification IN endpoint. */\r
                #define CDC2_NOTIFICATION_EPNUM        4\r
 \r
                /** Endpoint number of the second CDC interface's device-to-host data IN endpoint. */\r
-               #define CDC2_TX_EPNUM                  5        \r
+               #define CDC2_TX_EPNUM                  5\r
 \r
                /** Endpoint number of the second CDC interface's host-to-device data OUT endpoint. */\r
-               #define CDC2_RX_EPNUM                  6        \r
+               #define CDC2_RX_EPNUM                  6\r
 \r
                /** Size in bytes of the CDC device-to-host notification IN endpoints. */\r
                #define CDC_NOTIFICATION_EPSIZE        8\r
 \r
                /** Size in bytes of the CDC data IN and OUT endpoints. */\r
-               #define CDC_TXRX_EPSIZE                16       \r
+               #define CDC_TXRX_EPSIZE                16\r
 \r
        /* Type Defines: */\r
                /** Type define for the device configuration descriptor structure. This must be defined in the\r
@@ -99,6 +99,6 @@
 \r
        /* Function Prototypes: */\r
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
-                                                                                       ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
+                                                   ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
 \r
 #endif\r
index bd7be65..f3313e0 100644 (file)
@@ -86,7 +86,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
        .Class                  = 0x00,\r
        .SubClass               = 0x00,\r
        .Protocol               = 0x00,\r
-                               \r
+       \r
        .Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,\r
                \r
        .VendorID               = 0x03EB,\r
@@ -141,7 +141,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .JoystickHID = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},\r
-                                                                        \r
+                       \r
                        .HIDSpec                = VERSION_BCD(01.11),\r
                        .CountryCode            = 0x00,\r
                        .TotalReportDescriptors = 1,\r
@@ -152,7 +152,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .JoystickEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | JOYSTICK_EPNUM),\r
                        .Attributes             = EP_TYPE_INTERRUPT,\r
                        .EndpointSize           = JOYSTICK_EPSIZE,\r
index 1241ad1..c6926ac 100644 (file)
@@ -54,7 +54,7 @@
                        USB_Descriptor_HID_t                  JoystickHID;\r
                USB_Descriptor_Endpoint_t             JoystickEndpoint;\r
                } USB_Descriptor_Configuration_t;\r
-                                       \r
+\r
        /* Macros: */\r
                /** Endpoint number of the Joystick HID reporting IN endpoint. */\r
                #define JOYSTICK_EPNUM               1\r
@@ -64,6 +64,6 @@
 \r
        /* Function Prototypes: */\r
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
-                                                                                       ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
+                                                   ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
 \r
 #endif\r
index bebad12..fbfcf2f 100644 (file)
  */\r
 USB_ClassInfo_HID_t Keyboard_HID_Interface =\r
     {\r
-        .InterfaceNumber         = 0,\r
+               .InterfaceNumber         = 0,\r
 \r
-        .ReportINEndpointNumber  = KEYBOARD_EPNUM,\r
-        .ReportINEndpointSize    = KEYBOARD_EPSIZE,\r
+               .ReportINEndpointNumber  = KEYBOARD_EPNUM,\r
+               .ReportINEndpointSize    = KEYBOARD_EPSIZE,\r
 \r
                .ReportINBufferSize      = sizeof(USB_KeyboardReport_Data_t),\r
 \r
-        .IdleCount               = 500,\r
+               .IdleCount               = 500,\r
     };\r
 \r
 /** Main program entry point. This routine contains the overall program flow, including initial\r
@@ -58,32 +58,32 @@ USB_ClassInfo_HID_t Keyboard_HID_Interface =
  */\r
 int main(void)\r
 {\r
-    SetupHardware();\r
-\r
-    LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
-    \r
-    for (;;)\r
-    {\r
-        USB_HID_USBTask(&Keyboard_HID_Interface);\r
-        USB_USBTask();\r
-    }\r
+       SetupHardware();\r
+\r
+       LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
+       \r
+       for (;;)\r
+       {\r
+               USB_HID_USBTask(&Keyboard_HID_Interface);\r
+               USB_USBTask();\r
+       }\r
 }\r
 \r
 /** Configures the board hardware and chip peripherals for the demo's functionality. */\r
 void SetupHardware()\r
 {\r
-    /* Disable watchdog if enabled by bootloader/fuses */\r
-    MCUSR &= ~(1 << WDRF);\r
-    wdt_disable();\r
+       /* Disable watchdog if enabled by bootloader/fuses */\r
+       MCUSR &= ~(1 << WDRF);\r
+       wdt_disable();\r
 \r
-    /* Disable clock division */\r
-    clock_prescale_set(clock_div_1);\r
+       /* Disable clock division */\r
+       clock_prescale_set(clock_div_1);\r
 \r
-    /* Hardware Initialization */\r
-    Joystick_Init();\r
-    LEDs_Init();\r
-    Buttons_Init();\r
-    USB_Init();\r
+       /* Hardware Initialization */\r
+       Joystick_Init();\r
+       LEDs_Init();\r
+       Buttons_Init();\r
+       USB_Init();\r
 \r
        /* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */\r
        OCR0A  = ((F_CPU / 64) / 1000);\r
@@ -95,28 +95,28 @@ void SetupHardware()
 /** Event handler for the library USB Connection event. */\r
 void EVENT_USB_Connect(void)\r
 {\r
-    LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
+       LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
 void EVENT_USB_Disconnect(void)\r
 {\r
-    LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
+       LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
 void EVENT_USB_ConfigurationChanged(void)\r
 {\r
-    LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
+       LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
-    if (!(USB_HID_ConfigureEndpoints(&Keyboard_HID_Interface)))\r
-      LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
+       if (!(USB_HID_ConfigureEndpoints(&Keyboard_HID_Interface)))\r
+         LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
 /** Event handler for the library USB Unhandled Control Packet event. */\r
 void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
-    USB_HID_ProcessControlPacket(&Keyboard_HID_Interface);\r
+       USB_HID_ProcessControlPacket(&Keyboard_HID_Interface);\r
 }\r
 \r
 /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
@@ -135,28 +135,28 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
  */\r
 uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\r
 {\r
-    USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;\r
-    \r
-    uint8_t JoyStatus_LCL    = Joystick_GetStatus();\r
-    uint8_t ButtonStatus_LCL = Buttons_GetStatus();\r
-\r
-    if (JoyStatus_LCL & JOY_UP)\r
-      KeyboardReport->KeyCode[0] = 0x04; // A\r
-    else if (JoyStatus_LCL & JOY_DOWN)\r
-      KeyboardReport->KeyCode[0] = 0x05; // B\r
-\r
-    if (JoyStatus_LCL & JOY_LEFT)\r
-      KeyboardReport->KeyCode[0] = 0x06; // C\r
-    else if (JoyStatus_LCL & JOY_RIGHT)\r
-      KeyboardReport->KeyCode[0] = 0x07; // D\r
-\r
-    if (JoyStatus_LCL & JOY_PRESS)\r
-      KeyboardReport->KeyCode[0] = 0x08; // E\r
-      \r
-    if (ButtonStatus_LCL & BUTTONS_BUTTON1)\r
-      KeyboardReport->KeyCode[0] = 0x09; // F\r
-      \r
-    return sizeof(USB_KeyboardReport_Data_t);\r
+       USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;\r
+       \r
+       uint8_t JoyStatus_LCL    = Joystick_GetStatus();\r
+       uint8_t ButtonStatus_LCL = Buttons_GetStatus();\r
+\r
+       if (JoyStatus_LCL & JOY_UP)\r
+         KeyboardReport->KeyCode[0] = 0x04; // A\r
+       else if (JoyStatus_LCL & JOY_DOWN)\r
+         KeyboardReport->KeyCode[0] = 0x05; // B\r
+\r
+       if (JoyStatus_LCL & JOY_LEFT)\r
+         KeyboardReport->KeyCode[0] = 0x06; // C\r
+       else if (JoyStatus_LCL & JOY_RIGHT)\r
+         KeyboardReport->KeyCode[0] = 0x07; // D\r
+\r
+       if (JoyStatus_LCL & JOY_PRESS)\r
+         KeyboardReport->KeyCode[0] = 0x08; // E\r
+         \r
+       if (ButtonStatus_LCL & BUTTONS_BUTTON1)\r
+         KeyboardReport->KeyCode[0] = 0x09; // F\r
+         \r
+       return sizeof(USB_KeyboardReport_Data_t);\r
 }\r
 \r
 /** HID class driver callback function for the processing of HID reports from the host.\r
@@ -168,17 +168,17 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI
 void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
                                                void* ReportData, uint16_t ReportSize)\r
 {\r
-    uint8_t  LEDMask   = LEDS_NO_LEDS;\r
-    uint8_t* LEDReport = (uint8_t*)ReportData;\r
-\r
-    if (*LEDReport & 0x01) // NUM Lock\r
-      LEDMask |= LEDS_LED1;\r
-    \r
-    if (*LEDReport & 0x02) // CAPS Lock\r
-      LEDMask |= LEDS_LED3;\r
-\r
-    if (*LEDReport & 0x04) // SCROLL Lock\r
-      LEDMask |= LEDS_LED4;\r
-      \r
-    LEDs_SetAllLEDs(LEDMask);\r
+       uint8_t  LEDMask   = LEDS_NO_LEDS;\r
+       uint8_t* LEDReport = (uint8_t*)ReportData;\r
+\r
+       if (*LEDReport & 0x01) // NUM Lock\r
+         LEDMask |= LEDS_LED1;\r
+       \r
+       if (*LEDReport & 0x02) // CAPS Lock\r
+         LEDMask |= LEDS_LED3;\r
+\r
+       if (*LEDReport & 0x04) // SCROLL Lock\r
+         LEDMask |= LEDS_LED4;\r
+         \r
+       LEDs_SetAllLEDs(LEDMask);\r
 }\r
index 1dcad08..6f1c53a 100644 (file)
@@ -71,6 +71,6 @@
 \r
        /* Function Prototypes: */\r
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
-                                                                                       ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
+                                                   ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
 \r
 #endif\r
index 6973a4c..2ff22ce 100644 (file)
@@ -99,7 +99,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .SubClass                 = 0x01,\r
                        .Protocol                 = 0x00,\r
                                \r
-                       .InterfaceStrIndex        = NO_DESCRIPTOR                       \r
+                       .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
        \r
        .AudioControlInterface_SPC = \r
@@ -111,7 +111,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .TotalLength              = sizeof(USB_AudioInterface_AC_t),\r
                        \r
                        .InCollection             = 1,\r
-                       .InterfaceNumbers         = {1},                        \r
+                       .InterfaceNumbers         = {1},\r
                },\r
 \r
        .AudioStreamInterface = \r
index 8ac4570..7c32b3f 100644 (file)
@@ -141,7 +141,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .MouseHID = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},\r
-                                                                        \r
+\r
                        .HIDSpec                = VERSION_BCD(01.11),\r
                        .CountryCode            = 0x00,\r
                        .TotalReportDescriptors = 1,\r
@@ -152,12 +152,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .MouseEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+\r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_EPNUM),\r
                        .Attributes             = EP_TYPE_INTERRUPT,\r
                        .EndpointSize           = MOUSE_EPSIZE,\r
                        .PollingIntervalMS      = 0x02\r
-               }       \r
+               }\r
 };\r
 \r
 /** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests\r
index f5bd931..2ae2778 100644 (file)
@@ -92,13 +92,13 @@ void SetupHardware(void)
 /** Event handler for the library USB Connection event. */\r
 void EVENT_USB_Connect(void)\r
 {\r
-    LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
+       LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
 void EVENT_USB_Disconnect(void)\r
 {\r
-    LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
+       LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
index 1be5bfd..c1fdbf8 100644 (file)
@@ -137,7 +137,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .ManagementEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),\r
                        .Attributes             = EP_TYPE_INTERRUPT,\r
                        .EndpointSize           = CDC_NOTIFICATION_EPSIZE,\r
@@ -163,7 +163,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .DataOutEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                        \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),\r
                        .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
@@ -173,7 +173,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .DataInEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),\r
                        .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
index 7c85719..8c55dff 100644 (file)
@@ -106,13 +106,13 @@ void SetupHardware(void)
 /** Event handler for the library USB Connection event. */\r
 void EVENT_USB_Connect(void)\r
 {\r
-    LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
+       LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
 void EVENT_USB_Disconnect(void)\r
 {\r
-    LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
+       LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
index c369d16..d4db3a4 100644 (file)
@@ -137,7 +137,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .ManagementEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),\r
                        .Attributes             = EP_TYPE_INTERRUPT,\r
                        .EndpointSize           = CDC_NOTIFICATION_EPSIZE,\r
@@ -163,7 +163,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .DataOutEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),\r
                        .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
@@ -173,11 +173,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        .DataInEndpoint = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
+                       \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),\r
-                       .Attributes       =             EP_TYPE_BULK,\r
+                       .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
-                       .PollingIntervalMS=             0x00\r
+                       .PollingIntervalMS      = 0x00\r
                }\r
 };\r
 \r
index b8de373..809e542 100644 (file)
@@ -99,7 +99,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .SubClass                 = 0x01,\r
                        .Protocol                 = 0x00,\r
                                \r
-                       .InterfaceStrIndex        = NO_DESCRIPTOR                       \r
+                       .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
        \r
        .AudioControlInterface_SPC = \r
@@ -110,10 +110,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .ACSpecification          = VERSION_BCD(01.00),\r
                        .TotalLength              = (sizeof(USB_AudioInterface_AC_t) +\r
                                                     sizeof(USB_AudioInputTerminal_t) +\r
-                                                                            sizeof(USB_AudioOutputTerminal_t)),\r
+                                                    sizeof(USB_AudioOutputTerminal_t)),\r
                        \r
                        .InCollection             = 1,\r
-                       .InterfaceNumbers         = {1},                        \r
+                       .InterfaceNumbers         = {1},\r
                },\r
 \r
        .InputTerminal = \r
@@ -143,7 +143,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        \r
                        .SourceID                 = 0x01,\r
                        \r
-                       .TerminalStrIndex         = NO_DESCRIPTOR                       \r
+                       .TerminalStrIndex         = NO_DESCRIPTOR\r
                },\r
 \r
        .AudioStreamInterface_Alt0 = \r
index 07418d5..9661f03 100644 (file)
@@ -97,7 +97,7 @@ void EVENT_USB_Connect(void)
 #if (defined(AUDIO_OUT_MONO) || defined(AUDIO_OUT_STEREO))\r
        /* PWM speaker timer initialization */\r
        TCCRxA  = ((1 << WGMx0) | (1 << COMxA1) | (1 << COMxA0)\r
-                                                       | (1 << COMxB1) | (1 << COMxB0)); // Set on match, clear on TOP\r
+                               | (1 << COMxB1) | (1 << COMxB0)); // Set on match, clear on TOP\r
        TCCRxB  = ((1 << WGMx2) | (1 << CSx0));  // Fast 8-Bit PWM, Fcpu speed\r
 #endif \r
 }\r
index 92d7e0d..8dfb6e1 100644 (file)
@@ -99,7 +99,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .SubClass                 = 0x01,\r
                        .Protocol                 = 0x00,\r
                                \r
-                       .InterfaceStrIndex        = NO_DESCRIPTOR                       \r
+                       .InterfaceStrIndex        = NO_DESCRIPTOR\r
                },\r
        \r
        .AudioControlInterface_SPC = \r
@@ -109,11 +109,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        \r
                        .ACSpecification          = VERSION_BCD(01.00),\r
                        .TotalLength              = (sizeof(USB_AudioInterface_AC_t) +\r
-                                                  sizeof(USB_AudioInputTerminal_t) +\r
-                                                                          sizeof(USB_AudioOutputTerminal_t)),\r
+                                                    sizeof(USB_AudioInputTerminal_t) +\r
+                                                    sizeof(USB_AudioOutputTerminal_t)),\r
                        \r
                        .InCollection             = 1,\r
-                       .InterfaceNumbers         = {1},                        \r
+                       .InterfaceNumbers         = {1},\r
                },\r
 \r
        .InputTerminal = \r
index c369d16..088ab59 100644 (file)
@@ -175,9 +175,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
                                                                                 \r
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),\r
-                       .Attributes       =             EP_TYPE_BULK,\r
+                       .Attributes             = EP_TYPE_BULK,\r
                        .EndpointSize           = CDC_TXRX_EPSIZE,\r
-                       .PollingIntervalMS=             0x00\r
+                       .PollingIntervalMS      = 0x00\r
                }\r
 };\r
 \r