aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-10-13 14:05:35 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-10-13 14:05:35 +0000
commit5a4def747897c1c6ffbe465506d846c7c686d3e9 (patch)
treee5a9ca31ab554e993f1a9041e44976cf7b253921 /LUFA
parenta8871c7fba73307226bd13e2cad4c840c850e6f1 (diff)
downloadlufa-5a4def747897c1c6ffbe465506d846c7c686d3e9.tar.gz
lufa-5a4def747897c1c6ffbe465506d846c7c686d3e9.tar.bz2
lufa-5a4def747897c1c6ffbe465506d846c7c686d3e9.zip
Clean up excessive whitespace at the end of each line using the wspurify tool made by Laszlo Monda
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/CodeTemplates/DriverStubs/Buttons.h21
-rw-r--r--LUFA/CodeTemplates/DriverStubs/Dataflash.h33
-rw-r--r--LUFA/CodeTemplates/DriverStubs/Joystick.h21
-rw-r--r--LUFA/CodeTemplates/DriverStubs/LEDs.h21
-rw-r--r--LUFA/Common/Attributes.h33
-rw-r--r--LUFA/Common/BoardTypes.h33
-rw-r--r--LUFA/Common/Common.h41
-rw-r--r--LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h21
-rw-r--r--LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h27
-rw-r--r--LUFA/Drivers/Board/BENITO/Buttons.h21
-rw-r--r--LUFA/Drivers/Board/BENITO/LEDs.h21
-rw-r--r--LUFA/Drivers/Board/BUI/LEDs.h21
-rw-r--r--LUFA/Drivers/Board/BUMBLEB/Buttons.h19
-rw-r--r--LUFA/Drivers/Board/BUMBLEB/Joystick.h17
-rw-r--r--LUFA/Drivers/Board/BUMBLEB/LEDs.h21
-rw-r--r--LUFA/Drivers/Board/Buttons.h21
-rw-r--r--LUFA/Drivers/Board/CULV3/Buttons.h19
-rw-r--r--LUFA/Drivers/Board/CULV3/LEDs.h23
-rw-r--r--LUFA/Drivers/Board/Dataflash.h27
-rw-r--r--LUFA/Drivers/Board/EVK527/AT45DB321C.h27
-rw-r--r--LUFA/Drivers/Board/EVK527/Buttons.h19
-rw-r--r--LUFA/Drivers/Board/EVK527/Dataflash.h29
-rw-r--r--LUFA/Drivers/Board/EVK527/Joystick.h21
-rw-r--r--LUFA/Drivers/Board/EVK527/LEDs.h23
-rw-r--r--LUFA/Drivers/Board/JMDBU2/Buttons.h21
-rw-r--r--LUFA/Drivers/Board/JMDBU2/LEDs.h23
-rw-r--r--LUFA/Drivers/Board/Joystick.h19
-rw-r--r--LUFA/Drivers/Board/LEDs.h23
-rw-r--r--LUFA/Drivers/Board/OLIMEX162/Buttons.h21
-rw-r--r--LUFA/Drivers/Board/OLIMEX162/LEDs.h25
-rw-r--r--LUFA/Drivers/Board/RZUSBSTICK/LEDs.h29
-rw-r--r--LUFA/Drivers/Board/STK525/AT45DB321C.h27
-rw-r--r--LUFA/Drivers/Board/STK525/Buttons.h19
-rw-r--r--LUFA/Drivers/Board/STK525/Dataflash.h29
-rw-r--r--LUFA/Drivers/Board/STK525/Joystick.h27
-rw-r--r--LUFA/Drivers/Board/STK525/LEDs.h25
-rw-r--r--LUFA/Drivers/Board/STK526/AT45DB642D.h27
-rw-r--r--LUFA/Drivers/Board/STK526/Buttons.h19
-rw-r--r--LUFA/Drivers/Board/STK526/Dataflash.h27
-rw-r--r--LUFA/Drivers/Board/STK526/Joystick.h23
-rw-r--r--LUFA/Drivers/Board/STK526/LEDs.h27
-rw-r--r--LUFA/Drivers/Board/TEENSY/LEDs.h25
-rw-r--r--LUFA/Drivers/Board/Temperature.c13
-rw-r--r--LUFA/Drivers/Board/Temperature.h23
-rw-r--r--LUFA/Drivers/Board/UDIP/Buttons.h21
-rw-r--r--LUFA/Drivers/Board/UDIP/LEDs.h25
-rw-r--r--LUFA/Drivers/Board/UNO/LEDs.h21
-rw-r--r--LUFA/Drivers/Board/USBFOO/Buttons.h21
-rw-r--r--LUFA/Drivers/Board/USBFOO/LEDS.h25
-rw-r--r--LUFA/Drivers/Board/USBKEY/AT45DB642D.h29
-rw-r--r--LUFA/Drivers/Board/USBKEY/Buttons.h21
-rw-r--r--LUFA/Drivers/Board/USBKEY/Dataflash.h37
-rw-r--r--LUFA/Drivers/Board/USBKEY/Joystick.h21
-rw-r--r--LUFA/Drivers/Board/USBKEY/LEDs.h23
-rw-r--r--LUFA/Drivers/Board/USBTINYMKII/Buttons.h19
-rw-r--r--LUFA/Drivers/Board/USBTINYMKII/LEDs.h21
-rw-r--r--LUFA/Drivers/Board/XPLAIN/AT45DB642D.h29
-rw-r--r--LUFA/Drivers/Board/XPLAIN/Dataflash.h33
-rw-r--r--LUFA/Drivers/Board/XPLAIN/LEDs.h27
-rw-r--r--LUFA/Drivers/Misc/TerminalCodes.h25
-rw-r--r--LUFA/Drivers/Peripheral/ADC.h17
-rw-r--r--LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h55
-rw-r--r--LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h25
-rw-r--r--LUFA/Drivers/Peripheral/SPI.h29
-rw-r--r--LUFA/Drivers/Peripheral/Serial.c13
-rw-r--r--LUFA/Drivers/Peripheral/Serial.h29
-rw-r--r--LUFA/Drivers/Peripheral/SerialStream.c17
-rw-r--r--LUFA/Drivers/Peripheral/SerialStream.h25
-rw-r--r--LUFA/Drivers/Peripheral/TWI.c19
-rw-r--r--LUFA/Drivers/Peripheral/TWI.h17
-rw-r--r--LUFA/Drivers/USB/Class/Audio.h19
-rw-r--r--LUFA/Drivers/USB/Class/CDC.h19
-rw-r--r--LUFA/Drivers/USB/Class/Common/Audio.h131
-rw-r--r--LUFA/Drivers/USB/Class/Common/CDC.h41
-rw-r--r--LUFA/Drivers/USB/Class/Common/HID.h39
-rw-r--r--LUFA/Drivers/USB/Class/Common/MIDI.h47
-rw-r--r--LUFA/Drivers/USB/Class/Common/MassStorage.h43
-rw-r--r--LUFA/Drivers/USB/Class/Common/Printer.h19
-rw-r--r--LUFA/Drivers/USB/Class/Common/RNDIS.h51
-rw-r--r--LUFA/Drivers/USB/Class/Common/RNDISConstants.h27
-rw-r--r--LUFA/Drivers/USB/Class/Common/StillImage.h29
-rw-r--r--LUFA/Drivers/USB/Class/Device/Audio.c20
-rw-r--r--LUFA/Drivers/USB/Class/Device/Audio.h41
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDC.c55
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDC.h49
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.c41
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.h43
-rw-r--r--LUFA/Drivers/USB/Class/Device/MIDI.c29
-rw-r--r--LUFA/Drivers/USB/Class/Device/MIDI.h27
-rw-r--r--LUFA/Drivers/USB/Class/Device/MassStorage.c45
-rw-r--r--LUFA/Drivers/USB/Class/Device/MassStorage.h31
-rw-r--r--LUFA/Drivers/USB/Class/Device/RNDIS.c135
-rw-r--r--LUFA/Drivers/USB/Class/Device/RNDIS.h39
-rw-r--r--LUFA/Drivers/USB/Class/HID.h25
-rw-r--r--LUFA/Drivers/USB/Class/Host/CDC.c79
-rw-r--r--LUFA/Drivers/USB/Class/Host/CDC.h45
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.c85
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.h39
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDParser.c109
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDParser.h51
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDReportData.h23
-rw-r--r--LUFA/Drivers/USB/Class/Host/MIDI.c41
-rw-r--r--LUFA/Drivers/USB/Class/Host/MIDI.h29
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorage.c85
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorage.h45
-rw-r--r--LUFA/Drivers/USB/Class/Host/Printer.c83
-rw-r--r--LUFA/Drivers/USB/Class/Host/Printer.h37
-rw-r--r--LUFA/Drivers/USB/Class/Host/RNDIS.c91
-rw-r--r--LUFA/Drivers/USB/Class/Host/RNDIS.h31
-rw-r--r--LUFA/Drivers/USB/Class/Host/StillImage.c89
-rw-r--r--LUFA/Drivers/USB/Class/Host/StillImage.h39
-rw-r--r--LUFA/Drivers/USB/Class/MIDI.h17
-rw-r--r--LUFA/Drivers/USB/Class/MassStorage.h19
-rw-r--r--LUFA/Drivers/USB/Class/Printer.h17
-rw-r--r--LUFA/Drivers/USB/Class/RNDIS.h19
-rw-r--r--LUFA/Drivers/USB/Class/StillImage.h19
-rw-r--r--LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c35
-rw-r--r--LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h35
-rw-r--r--LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c79
-rw-r--r--LUFA/Drivers/USB/HighLevel/DeviceStandardReq.h39
-rw-r--r--LUFA/Drivers/USB/HighLevel/EndpointStream.c2
-rw-r--r--LUFA/Drivers/USB/HighLevel/EndpointStream.h1
-rw-r--r--LUFA/Drivers/USB/HighLevel/Events.c13
-rw-r--r--LUFA/Drivers/USB/HighLevel/Events.h35
-rw-r--r--LUFA/Drivers/USB/HighLevel/HostStandardReq.c41
-rw-r--r--LUFA/Drivers/USB/HighLevel/HostStandardReq.h27
-rw-r--r--LUFA/Drivers/USB/HighLevel/PipeStream.c1
-rw-r--r--LUFA/Drivers/USB/HighLevel/PipeStream.h1
-rw-r--r--LUFA/Drivers/USB/HighLevel/StdDescriptors.h67
-rw-r--r--LUFA/Drivers/USB/HighLevel/StdRequestType.h19
-rw-r--r--LUFA/Drivers/USB/HighLevel/StreamCallbacks.h23
-rw-r--r--LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_R.c16
-rw-r--r--LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_W.c12
-rw-r--r--LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_RW.c8
-rw-r--r--LUFA/Drivers/USB/HighLevel/Template/Template_Pipe_RW.c9
-rw-r--r--LUFA/Drivers/USB/HighLevel/USBMode.h28
-rw-r--r--LUFA/Drivers/USB/HighLevel/USBTask.c21
-rw-r--r--LUFA/Drivers/USB/HighLevel/USBTask.h35
-rw-r--r--LUFA/Drivers/USB/LowLevel/Device.c13
-rw-r--r--LUFA/Drivers/USB/LowLevel/Device.h39
-rw-r--r--LUFA/Drivers/USB/LowLevel/Endpoint.c23
-rw-r--r--LUFA/Drivers/USB/LowLevel/Endpoint.h125
-rw-r--r--LUFA/Drivers/USB/LowLevel/Host.c67
-rw-r--r--LUFA/Drivers/USB/LowLevel/Host.h73
-rw-r--r--LUFA/Drivers/USB/LowLevel/OTG.h37
-rw-r--r--LUFA/Drivers/USB/LowLevel/Pipe.c29
-rw-r--r--LUFA/Drivers/USB/LowLevel/Pipe.h141
-rw-r--r--LUFA/Drivers/USB/LowLevel/USBController.c41
-rw-r--r--LUFA/Drivers/USB/LowLevel/USBController.h75
-rw-r--r--LUFA/Drivers/USB/LowLevel/USBInterrupt.c67
-rw-r--r--LUFA/Drivers/USB/LowLevel/USBInterrupt.h23
-rw-r--r--LUFA/Drivers/USB/USB.h70
-rw-r--r--LUFA/License.txt1
-rw-r--r--LUFA/ManPages/AboutLUFA.txt2
-rw-r--r--LUFA/ManPages/AlternativeStacks.txt6
-rw-r--r--LUFA/ManPages/BuildingLinkableLibraries.txt1
-rw-r--r--LUFA/ManPages/ChangeLog.txt21
-rw-r--r--LUFA/ManPages/CompileTimeTokens.txt3
-rw-r--r--LUFA/ManPages/CompilingApps.txt4
-rw-r--r--LUFA/ManPages/ConfiguringApps.txt4
-rw-r--r--LUFA/ManPages/DevelopingWithLUFA.txt2
-rw-r--r--LUFA/ManPages/DeviceSupport.txt2
-rw-r--r--LUFA/ManPages/DirectorySummaries.txt65
-rw-r--r--LUFA/ManPages/Donating.txt2
-rw-r--r--LUFA/ManPages/FutureChanges.txt1
-rw-r--r--LUFA/ManPages/GettingStarted.txt1
-rw-r--r--LUFA/ManPages/Groups.txt3
-rw-r--r--LUFA/ManPages/LUFAPoweredProjects.txt6
-rw-r--r--LUFA/ManPages/LUFAvsAtmelStack.txt2
-rw-r--r--LUFA/ManPages/LibraryApps.txt3
-rw-r--r--LUFA/ManPages/LibraryResources.txt4
-rw-r--r--LUFA/ManPages/LicenseInfo.txt1
-rw-r--r--LUFA/ManPages/MainPage.txt3
-rw-r--r--LUFA/ManPages/MigrationInformation.txt13
-rw-r--r--LUFA/ManPages/ProgrammingApps.txt4
-rw-r--r--LUFA/ManPages/SoftwareBootloaderJump.txt9
-rw-r--r--LUFA/ManPages/VIDAndPIDValues.txt1
-rw-r--r--LUFA/ManPages/WhyUseLUFA.txt2
-rw-r--r--LUFA/ManPages/WritingBoardDrivers.txt1
-rw-r--r--LUFA/Scheduler/Scheduler.c31
-rw-r--r--LUFA/Scheduler/Scheduler.h53
-rw-r--r--LUFA/Version.h15
-rw-r--r--LUFA/makefile6
183 files changed, 2819 insertions, 2656 deletions
diff --git a/LUFA/CodeTemplates/DriverStubs/Buttons.h b/LUFA/CodeTemplates/DriverStubs/Buttons.h
index c92577a44..d03352240 100644
--- a/LUFA/CodeTemplates/DriverStubs/Buttons.h
+++ b/LUFA/CodeTemplates/DriverStubs/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -38,7 +38,7 @@
This stub is for the board-specific component of the LUFA Buttons driver,
for the control of physical board-mounted GPIO pushbuttons.
*/
-
+
#ifndef __BUTTONS_USER_H__
#define __BUTTONS_USER_H__
@@ -57,12 +57,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 // TODO: Add mask for first board button here
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -81,5 +81,6 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
+
diff --git a/LUFA/CodeTemplates/DriverStubs/Dataflash.h b/LUFA/CodeTemplates/DriverStubs/Dataflash.h
index 31b5fed32..4efa54279 100644
--- a/LUFA/CodeTemplates/DriverStubs/Dataflash.h
+++ b/LUFA/CodeTemplates/DriverStubs/Dataflash.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -49,7 +49,7 @@
#if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif
-
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
@@ -57,7 +57,7 @@
#define DATAFLASH_CHIPCS_DDR // TODO: Replace with the DDR register name for the board's Dataflash ICs
#define DATAFLASH_CHIPCS_PORT // TODO: Replace with the PORT register name for the board's Dataflash ICs
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Constant indicating the total number of dataflash ICs mounted on the selected board. */
@@ -71,7 +71,7 @@
/** Mask for the second dataflash chip selected. */
#define DATAFLASH_CHIP2 // TODO: Replace with mask to hold /CS of second Dataflash low, and all others high
-
+
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE // TODO: Replace with the page size for the Dataflash ICs
@@ -87,7 +87,7 @@
DATAFLASH_CHIPCS_DDR |= DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK;
}
-
+
/** Determines the currently selected dataflash chip.
*
* \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected
@@ -129,7 +129,7 @@
static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress)
{
Dataflash_DeselectChip();
-
+
if (PageAddress >= (DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS))
return;
@@ -149,11 +149,11 @@
static inline void Dataflash_ToggleSelectedChipCS(void)
{
uint8_t SelectedChipMask = Dataflash_GetSelectedChip();
-
+
Dataflash_DeselectChip();
Dataflash_SelectChip(SelectedChipMask);
}
-
+
/** Spin-loops while the currently selected dataflash is busy executing a command, such as a main
* memory page program or main memory to buffer transfer.
*/
@@ -162,7 +162,7 @@
Dataflash_ToggleSelectedChipCS();
Dataflash_SendByte(DF_CMD_GETSTATUS);
while (!(Dataflash_ReceiveByte() & DF_STATUS_READY));
- Dataflash_ToggleSelectedChipCS();
+ Dataflash_ToggleSelectedChipCS();
}
/** Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with
@@ -176,10 +176,11 @@
#if (DATAFLASH_TOTALCHIPS == 2)
PageAddress >>= 1;
#endif
-
+
Dataflash_SendByte(PageAddress >> 5);
Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
Dataflash_SendByte(BufferByte);
}
-
+
#endif
+
diff --git a/LUFA/CodeTemplates/DriverStubs/Joystick.h b/LUFA/CodeTemplates/DriverStubs/Joystick.h
index 4e7040a42..994b4bb5e 100644
--- a/LUFA/CodeTemplates/DriverStubs/Joystick.h
+++ b/LUFA/CodeTemplates/DriverStubs/Joystick.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -39,7 +39,7 @@
driver, a small surface mount four-way (plus button) digital joystick
on most USB AVR boards.
*/
-
+
#ifndef __JOYSTICK_USER_H__
#define __JOYSTICK_USER_H__
@@ -57,7 +57,7 @@
#if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the joystick being pushed in the left direction. */
@@ -74,14 +74,14 @@
/** Mask for the joystick being pushed inward. */
#define JOY_PRESS // TODO: Add mask to indicate joystick pressed position here
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Joystick_Init(void)
{
// TODO: Initialize joystick port pins as inputs with pull-ups
}
-
+
static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Joystick_GetStatus(void)
{
@@ -95,3 +95,4 @@
#endif
#endif
+
diff --git a/LUFA/CodeTemplates/DriverStubs/LEDs.h b/LUFA/CodeTemplates/DriverStubs/LEDs.h
index 8081be854..d959c8287 100644
--- a/LUFA/CodeTemplates/DriverStubs/LEDs.h
+++ b/LUFA/CodeTemplates/DriverStubs/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -83,7 +83,7 @@
{
// TODO: Add code to initialize LED port pins as outputs here
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
// TODO: Add code to turn on LEDs given in the LEDMask mask here, leave others as-is
@@ -98,7 +98,7 @@
{
// TODO: Add code to turn on only LEDs given in the LEDMask mask here, all others off
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask)
{
// TODO: Add code to set the Leds in the given LEDMask to the status given in ActiveMask here
@@ -108,7 +108,7 @@
{
// TODO: Add code to toggle the Leds in the given LEDMask, ignoring all others
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -120,5 +120,6 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
+
diff --git a/LUFA/Common/Attributes.h b/LUFA/Common/Attributes.h
index bcac84c7b..ac0b11f03 100644
--- a/LUFA/Common/Attributes.h
+++ b/LUFA/Common/Attributes.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -32,7 +32,7 @@
* \brief AVR-GCC special function/variable attribute macros.
*
* This file contains macros for applying GCC specific attributes to functions and variables to control various
- * optimiser and code generation features of the compiler. Attributes may be placed in the function prototype
+ * optimiser and code generation features of the compiler. Attributes may be placed in the function prototype
* or variable declaration in any order, and multiple attributes can be specified for a single item via a space
* separated list.
*
@@ -42,7 +42,7 @@
* \note Do not include this file directly, rather include the Common.h header file instead to gain this file's
* functionality.
*/
-
+
/** \ingroup Group_Common
* @defgroup Group_GCCAttr Function/Variable Attributes
*
@@ -67,7 +67,7 @@
* return code may be omitted by the compiler in the resulting binary.
*/
#define ATTR_NO_RETURN __attribute__ ((noreturn))
-
+
/** Indicates that the function returns a value which should not be ignored by the user code. When
* applied, any ignored return value from calling the function will produce a compiler warning.
*/
@@ -84,7 +84,7 @@
* is responsible for maintaining stack and register integrity.
*/
#define ATTR_NAKED __attribute__ ((naked))
-
+
/** Prevents the compiler from considering a specified function for inlining. When applied, the given
* function will not be inlined under any circumstances.
*/
@@ -94,25 +94,25 @@
* inlined under all circumstances.
*/
#define ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
-
+
/** Indicates that the specified function is pure, in that it has no side-effects other than global
* or parameter variable access.
*/
#define ATTR_PURE __attribute__ ((pure))
-
+
/** Indicates that the specified function is constant, in that it has no side effects other than
* parameter access.
*/
#define ATTR_CONST __attribute__ ((const))
-
+
/** Marks a given function as deprecated, which produces a warning if the function is called. */
#define ATTR_DEPRECATED __attribute__ ((deprecated))
-
+
/** Marks a function as a weak reference, which can be overridden by other functions with an
* identical name (in which case the weak reference is discarded at link time).
*/
#define ATTR_WEAK __attribute__ ((weak))
-
+
/** Forces the compiler to not automatically zero the given global variable on startup, so that the
* current RAM contents is retained. Under most conditions this value will be random due to the
* behaviour of volatile memory once power is removed, but may be used in some specific circumstances,
@@ -127,7 +127,7 @@
* \param[in] SectionIndex Initialization section number where the function should be placed.
*/
#define ATTR_INIT_SECTION(SectionIndex) __attribute__ ((naked, section (".init" #SectionIndex )))
-
+
/** Marks a function as an alias for another function.
*
* \param[in] Func Name of the function which the given function name should alias.
@@ -136,3 +136,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Common/BoardTypes.h b/LUFA/Common/BoardTypes.h
index 8f3394e5e..faef82caa 100644
--- a/LUFA/Common/BoardTypes.h
+++ b/LUFA/Common/BoardTypes.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -46,7 +46,7 @@
*
* @{
*/
-
+
#ifndef __BOARDTYPES_H__
#define __BOARDTYPES_H__
@@ -68,7 +68,7 @@
/** Selects the RZUSBSTICK specific board drivers, including the driver for the boards LEDs. */
#define BOARD_RZUSBSTICK 3
-
+
/** Selects the ATAVRUSBRF01 specific board drivers, including the driver for the board LEDs. */
#define BOARD_ATAVRUSBRF01 4
@@ -81,7 +81,7 @@
/** Selects the BUMBLEB specific board drivers, using the officially recommended peripheral layout. */
#define BOARD_BUMBLEB 6
-
+
/** Selects the XPLAIN (Revision 2 or newer) specific board drivers, including LED and Dataflash driver. */
#define BOARD_XPLAIN 7
@@ -90,20 +90,20 @@
/** Selects the EVK527 specific board drivers, including Temperature, Button, Dataflash, Joystick and LED drivers. */
#define BOARD_EVK527 9
-
+
/** Disables board drivers when operation will not be adversely affected (e.g. LEDs) - use of board drivers
* such as the Joystick driver, where the removal would adversely affect the code's operation is still disallowed. */
#define BOARD_NONE 10
-
+
/** Selects the Teensy (all versions) specific board drivers, including the driver for the board LEDs. */
#define BOARD_TEENSY 11
-
+
/** Selects the USBTINY MKII specific board drivers, including the Button and LEDs drivers. */
#define BOARD_USBTINYMKII 12
-
+
/** Selects the Benito specific board drivers, including the Button and LEDs drivers. */
#define BOARD_BENITO 13
-
+
/** Selects the JM-DB-U2 specific board drivers, including the Button and LEDs drivers. */
#define BOARD_JMDBU2 14
@@ -118,13 +118,13 @@
/** Selects the Arduino Uno specific board drivers, including the driver for the board LEDs. */
#define BOARD_UNO 18
-
+
/** Selects the CUL V3 specific board drivers, including the Button and LEDs drivers. */
#define BOARD_CULV3 19
#if !defined(__DOXYGEN__)
#define BOARD_ BOARD_NONE
-
+
#if !defined(BOARD)
#define BOARD BOARD_NONE
#endif
@@ -133,3 +133,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h
index c750e4015..61dfe2952 100644
--- a/LUFA/Common/Common.h
+++ b/LUFA/Common/Common.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -34,7 +34,7 @@
* This file contains macros which are common to all library elements, and which may be useful in user code. It
* also includes other common headers, such as Atomic.h, Attributes.h and BoardTypes.h.
*/
-
+
/** @defgroup Group_Common Common Utility Headers - LUFA/Drivers/Common/Common.h
*
* Common utility headers containing macros, functions, enums and types which are common to all
@@ -47,7 +47,7 @@
*
* Macros for debugging use.
*/
-
+
/** @defgroup Group_BitManip Endian and Bit Macros
*
* Functions for swapping endianness and reversing bit orders.
@@ -59,7 +59,7 @@
/* Includes: */
#include <stdint.h>
#include <stdbool.h>
-
+
#include "Attributes.h"
#include "BoardTypes.h"
@@ -78,7 +78,7 @@
* a block (such as inline IF statements).
*/
#define MACROE while (0)
-
+
/** Defines a volatile NOP statement which cannot be optimized out by the compiler, and thus can always
* be set as a breakpoint in the resulting code. Useful for debugging purposes, where the optimiser
* removes/reorders code to the point where break points cannot reliably be set.
@@ -93,7 +93,7 @@
* \ingroup Group_Debugging
*/
#define JTAG_DEBUG_BREAK() __asm__ volatile ("BREAK" ::)
-
+
/** Macro for testing condition "x" and breaking via JTAG_DEBUG_BREAK() if the condition is false.
*
* \ingroup Group_Debugging
@@ -165,7 +165,7 @@
return Byte;
}
-
+
/** Function to reverse the byte ordering of the individual bytes in a 16 bit number.
*
* \ingroup Group_BitManip
@@ -182,13 +182,13 @@
uint16_t Word;
uint8_t Bytes[2];
} Data;
-
+
Data.Word = Word;
-
+
Temp = Data.Bytes[0];
Data.Bytes[0] = Data.Bytes[1];
Data.Bytes[1] = Temp;
-
+
return Data.Word;
}
@@ -208,17 +208,17 @@
uint32_t DWord;
uint8_t Bytes[4];
} Data;
-
+
Data.DWord = DWord;
-
+
Temp = Data.Bytes[0];
Data.Bytes[0] = Data.Bytes[3];
Data.Bytes[3] = Temp;
-
+
Temp = Data.Bytes[1];
Data.Bytes[1] = Data.Bytes[2];
Data.Bytes[2] = Temp;
-
+
return Data.DWord;
}
@@ -235,7 +235,7 @@
uint8_t Bytes)
{
uint8_t* CurrDataPos = (uint8_t*)Data;
-
+
while (Bytes > 1)
{
uint8_t Temp = *CurrDataPos;
@@ -250,3 +250,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h b/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h
index dd5ce8122..da685d692 100644
--- a/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h
+++ b/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the Buttons driver
* dispatch header located in LUFA/Drivers/Board/Buttons.h.
*/
-
+
/** \ingroup Group_Buttons
* @defgroup Group_Buttons_ATAVRUSBRF01 ATAVRUSBRF01
*
@@ -66,12 +66,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -91,7 +91,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h b/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h
index 0ff47f418..550317c2a 100644
--- a/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h
+++ b/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the LEDs driver
* dispatch header located in LUFA/Drivers/Board/LEDs.h.
*/
-
+
/** \ingroup Group_LEDs
* @defgroup Group_LEDs_ATAVRUSBRF01 ATAVRUSBRF01
*
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __LEDS_ATAVRUSBRF01_H__
#define __LEDS_ATAVRUSBRF01_H__
@@ -71,7 +71,7 @@
/* Macros: */
#define LEDS_PORTD_LEDS (LEDS_LED1 | LEDS_LED2)
#define LEDS_PORTE_LEDS (LEDS_LED3 | LEDS_LED4)
-
+
#define LEDS_PORTE_MASK_SHIFT 4
#endif
@@ -88,7 +88,7 @@
/** LED mask for none of the board LEDs. */
#define LEDS_NO_LEDS 0
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
@@ -111,7 +111,7 @@
{
PORTD = (PORTD & ~LEDS_ALL_LEDS) | (LEDMask & LEDS_ALL_LEDS);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
@@ -122,7 +122,7 @@
{
PORTD ^= LEDMask;
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -134,7 +134,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/BENITO/Buttons.h b/LUFA/Drivers/Board/BENITO/Buttons.h
index a61ac7187..bd3dc78d5 100644
--- a/LUFA/Drivers/Board/BENITO/Buttons.h
+++ b/LUFA/Drivers/Board/BENITO/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the Buttons driver
* dispatch header located in LUFA/Drivers/Board/Buttons.h.
*/
-
+
/** \ingroup Group_Buttons
* @defgroup Group_Buttons_BENITO BENITO
*
@@ -66,12 +66,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -91,7 +91,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/BENITO/LEDs.h b/LUFA/Drivers/Board/BENITO/LEDs.h
index ff701985b..9c2446e9c 100644
--- a/LUFA/Drivers/Board/BENITO/LEDs.h
+++ b/LUFA/Drivers/Board/BENITO/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -85,7 +85,7 @@
DDRC |= LEDS_ALL_LEDS;
PORTC |= LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTC &= ~LEDMask;
@@ -100,7 +100,7 @@
{
PORTC = ((PORTC | LEDS_ALL_LEDS) & ~LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
@@ -111,7 +111,7 @@
{
PORTC ^= LEDMask;
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -123,7 +123,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/BUI/LEDs.h b/LUFA/Drivers/Board/BUI/LEDs.h
index 9fe73aed4..168b5cb7e 100644
--- a/LUFA/Drivers/Board/BUI/LEDs.h
+++ b/LUFA/Drivers/Board/BUI/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -87,7 +87,7 @@
{
DDRC |= LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTC |= LEDMask;
@@ -102,7 +102,7 @@
{
PORTC = (PORTC & ~LEDS_ALL_LEDS) | LEDMask;
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
@@ -113,7 +113,7 @@
{
PORTC ^= LEDMask;
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -125,7 +125,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/BUMBLEB/Buttons.h b/LUFA/Drivers/Board/BUMBLEB/Buttons.h
index 28a948b5d..e6029d936 100644
--- a/LUFA/Drivers/Board/BUMBLEB/Buttons.h
+++ b/LUFA/Drivers/Board/BUMBLEB/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -71,12 +71,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -96,7 +96,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/BUMBLEB/Joystick.h b/LUFA/Drivers/Board/BUMBLEB/Joystick.h
index 68866bf02..2f69133b6 100644
--- a/LUFA/Drivers/Board/BUMBLEB/Joystick.h
+++ b/LUFA/Drivers/Board/BUMBLEB/Joystick.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -93,7 +93,7 @@
/** Mask for the joystick being pushed inward. */
#define JOY_PRESS (1 << 4)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Joystick_Init(void)
@@ -101,7 +101,7 @@
DDRD &= ~JOY_MASK;
PORTD |= JOY_MASK;
}
-
+
static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Joystick_GetStatus(void)
{
@@ -117,3 +117,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/BUMBLEB/LEDs.h b/LUFA/Drivers/Board/BUMBLEB/LEDs.h
index e9816a88b..3b2b3e28a 100644
--- a/LUFA/Drivers/Board/BUMBLEB/LEDs.h
+++ b/LUFA/Drivers/Board/BUMBLEB/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -98,7 +98,7 @@
DDRB |= LEDS_ALL_LEDS;
PORTB &= ~LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LedMask)
{
PORTB |= LedMask;
@@ -113,13 +113,13 @@
{
PORTB = ((PORTB & ~LEDS_ALL_LEDS) | LedMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LedMask,
const uint8_t ActiveMask)
{
PORTB = ((PORTB & ~LedMask) | ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= LEDMask;
@@ -136,7 +136,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h
index 44e3ef6b2..6a53ed95d 100644
--- a/LUFA/Drivers/Board/Buttons.h
+++ b/LUFA/Drivers/Board/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -74,7 +74,7 @@
/* Includes: */
#include "../../Common/Common.h"
-
+
#if (BOARD == BOARD_NONE)
#error The Board Buttons driver cannot be used if the makefile BOARD option is not set.
#elif (BOARD == BOARD_USBKEY)
@@ -90,7 +90,7 @@
#elif (BOARD == BOARD_EVK527)
#include "EVK527/Buttons.h"
#elif (BOARD == BOARD_USBTINYMKII)
- #include "USBTINYMKII/Buttons.h"
+ #include "USBTINYMKII/Buttons.h"
#elif (BOARD == BOARD_BENITO)
#include "BENITO/Buttons.h"
#elif (BOARD == BOARD_JMDBU2)
@@ -108,7 +108,7 @@
#else
#error The selected board does not contain any GPIO buttons.
#endif
-
+
/* Pseudo-Functions for Doxygen: */
#if defined(__DOXYGEN__)
/** Initialises the BUTTONS driver, so that the current button position can be read. This sets the appropriate
@@ -117,7 +117,7 @@
* This must be called before any Button driver functions are used.
*/
static inline void Buttons_Init(void);
-
+
/** Returns a mask indicating which board buttons are currently pressed.
*
* \return Mask indicating which board buttons are currently pressed.
@@ -128,3 +128,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/CULV3/Buttons.h b/LUFA/Drivers/Board/CULV3/Buttons.h
index 770ba54fc..0a9407336 100644
--- a/LUFA/Drivers/Board/CULV3/Buttons.h
+++ b/LUFA/Drivers/Board/CULV3/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -66,12 +66,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 2)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -91,7 +91,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/CULV3/LEDs.h b/LUFA/Drivers/Board/CULV3/LEDs.h
index cb5f93490..6705b4d7d 100644
--- a/LUFA/Drivers/Board/CULV3/LEDs.h
+++ b/LUFA/Drivers/Board/CULV3/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -84,7 +84,7 @@
DDRE |= LEDS_ALL_LEDS;
PORTE &= ~LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTE |= LEDMask;
@@ -99,18 +99,18 @@
{
PORTE = ((PORTE & ~LEDS_ALL_LEDS) | LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTE = ((PORTE & ~LEDMask) | ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTE = (PORTE ^ (LEDMask & LEDS_ALL_LEDS));
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -122,7 +122,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/Dataflash.h b/LUFA/Drivers/Board/Dataflash.h
index b4bd39da0..150dca1c2 100644
--- a/LUFA/Drivers/Board/Dataflash.h
+++ b/LUFA/Drivers/Board/Dataflash.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -42,7 +42,7 @@
*
* For possible BOARD makefile values, see \ref Group_BoardTypes.
*/
-
+
/** \ingroup Group_BoardDrivers
* @defgroup Group_Dataflash Dataflash Driver - LUFA/Drivers/Board/Dataflash.h
*
@@ -61,7 +61,7 @@
*
* @{
*/
-
+
#ifndef __DATAFLASH_H__
#define __DATAFLASH_H__
@@ -86,7 +86,7 @@
#define __GET_DATAFLASH_MASK2(x, y) x ## y
#define __GET_DATAFLASH_MASK(x) __GET_DATAFLASH_MASK2(DATAFLASH_CHIP,x)
#endif
-
+
/** Retrieves the Dataflash chip select mask for the given Dataflash chip index.
*
* \param[in] index Index of the dataflash chip mask to retrieve
@@ -94,7 +94,7 @@
* \return Mask for the given Dataflash chip's /CS pin
*/
#define DATAFLASH_CHIP_MASK(index) __GET_DATAFLASH_MASK(index)
-
+
/* Inline Functions: */
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
* The AVR's SPI driver MUST be initialized before any of the dataflash commands are used.
@@ -128,7 +128,7 @@
* ((DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS) - 1).
*/
static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress);
-
+
/** Toggles the select line of the currently selected dataflash IC, so that it is ready to receive
* a new command.
*/
@@ -169,7 +169,7 @@
{
SPI_SendByte(Byte);
}
-
+
/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash.
*
* \return Last response byte from the dataflash
@@ -205,7 +205,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/EVK527/AT45DB321C.h b/LUFA/Drivers/Board/EVK527/AT45DB321C.h
index 6b056b53c..ee4f1f690 100644
--- a/LUFA/Drivers/Board/EVK527/AT45DB321C.h
+++ b/LUFA/Drivers/Board/EVK527/AT45DB321C.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __DATAFLASH_CMDS_H__
#define __DATAFLASH_CMDS_H__
@@ -56,9 +56,9 @@
#define DF_STATUS_READY (1 << 7)
#define DF_STATUS_COMPMISMATCH (1 << 6)
#define DF_STATUS_SECTORPROTECTION_ON (1 << 1)
-
+
#define DF_MANUFACTURER_ATMEL 0x1F
-
+
#define DF_CMD_GETSTATUS 0xD7
#define DF_CMD_MAINMEMTOBUFF1 0x53
@@ -67,12 +67,12 @@
#define DF_CMD_MAINMEMTOBUFF2COMP 0x61
#define DF_CMD_AUTOREWRITEBUFF1 0x58
#define DF_CMD_AUTOREWRITEBUFF2 0x59
-
+
#define DF_CMD_MAINMEMPAGEREAD 0xD2
#define DF_CMD_CONTARRAYREAD_LF 0xE8
#define DF_CMD_BUFF1READ_LF 0xD4
#define DF_CMD_BUFF2READ_LF 0xD6
-
+
#define DF_CMD_BUFF1WRITE 0x84
#define DF_CMD_BUFF2WRITE 0x87
#define DF_CMD_BUFF1TOMAINMEMWITHERASE 0x83
@@ -81,7 +81,7 @@
#define DF_CMD_BUFF2TOMAINMEM 0x89
#define DF_CMD_MAINMEMPAGETHROUGHBUFF1 0x82
#define DF_CMD_MAINMEMPAGETHROUGHBUFF2 0x85
-
+
#define DF_CMD_PAGEERASE 0x81
#define DF_CMD_BLOCKERASE 0x50
@@ -90,9 +90,10 @@
#define DF_CMD_SECTORPROTECTIONOFF_BYTE2 0x2A
#define DF_CMD_SECTORPROTECTIONOFF_BYTE3 0x7F
#define DF_CMD_SECTORPROTECTIONOFF_BYTE4 0xCF
-
+
#define DF_CMD_READMANUFACTURERDEVICEINFO 0x9F
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/EVK527/Buttons.h b/LUFA/Drivers/Board/EVK527/Buttons.h
index 624e1c20c..f15550e3e 100644
--- a/LUFA/Drivers/Board/EVK527/Buttons.h
+++ b/LUFA/Drivers/Board/EVK527/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -72,12 +72,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 2)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -97,7 +97,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/EVK527/Dataflash.h b/LUFA/Drivers/Board/EVK527/Dataflash.h
index 3bf492438..50de932ba 100644
--- a/LUFA/Drivers/Board/EVK527/Dataflash.h
+++ b/LUFA/Drivers/Board/EVK527/Dataflash.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -52,7 +52,7 @@
#define __DATAFLASH_EVK527_H__
/* Includes: */
- #include "AT45DB321C.h"
+ #include "AT45DB321C.h"
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_DATAFLASH_H)
@@ -77,7 +77,7 @@
/** Mask for the first dataflash chip selected. */
#define DATAFLASH_CHIP1 0
-
+
/** Internal main memory page size for the board's dataflash IC. */
#define DATAFLASH_PAGE_SIZE 512
@@ -93,7 +93,7 @@
DATAFLASH_CHIPCS_DDR |= DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK;
}
-
+
/** Determines the currently selected dataflash chip.
*
* \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected
@@ -135,7 +135,7 @@
static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress)
{
Dataflash_DeselectChip();
-
+
if (PageAddress >= DATAFLASH_PAGES)
return;
@@ -148,7 +148,7 @@
static inline void Dataflash_ToggleSelectedChipCS(void)
{
uint8_t SelectedChipMask = Dataflash_GetSelectedChip();
-
+
Dataflash_DeselectChip();
Dataflash_SelectChip(SelectedChipMask);
}
@@ -161,7 +161,7 @@
Dataflash_ToggleSelectedChipCS();
Dataflash_SendByte(DF_CMD_GETSTATUS);
while (!(Dataflash_ReceiveByte() & DF_STATUS_READY));
- Dataflash_ToggleSelectedChipCS();
+ Dataflash_ToggleSelectedChipCS();
}
/** Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with
@@ -172,12 +172,13 @@
*/
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
const uint16_t BufferByte)
- {
+ {
Dataflash_SendByte(PageAddress >> 5);
Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
Dataflash_SendByte(BufferByte);
}
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/EVK527/Joystick.h b/LUFA/Drivers/Board/EVK527/Joystick.h
index af3b54fdc..02af59adf 100644
--- a/LUFA/Drivers/Board/EVK527/Joystick.h
+++ b/LUFA/Drivers/Board/EVK527/Joystick.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -72,7 +72,7 @@
#define JOY_FMASK ((1 << 4) | (1 << 5) | (1 << 6) | (1 << 7))
#define JOY_CMASK (1 << 6))
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the joystick being pushed in the left direction. */
@@ -89,7 +89,7 @@
/** Mask for the joystick being pushed inward. */
#define JOY_PRESS (1 << 6)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Joystick_Init(void)
@@ -98,9 +98,9 @@
DDRC &= ~(JOY_CMASK);
PORTF |= JOY_FMASK;
- PORTC |= JOY_CMASK;
+ PORTC |= JOY_CMASK;
}
-
+
static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Joystick_GetStatus(void)
{
@@ -116,3 +116,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/EVK527/LEDs.h b/LUFA/Drivers/Board/EVK527/LEDs.h
index b24f6eb76..a74d39d5b 100644
--- a/LUFA/Drivers/Board/EVK527/LEDs.h
+++ b/LUFA/Drivers/Board/EVK527/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -90,7 +90,7 @@
DDRD |= LEDS_ALL_LEDS;
PORTD &= ~LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD |= LEDMask;
@@ -105,18 +105,18 @@
{
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTD = ((PORTD & ~LEDMask) | ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -128,7 +128,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/JMDBU2/Buttons.h b/LUFA/Drivers/Board/JMDBU2/Buttons.h
index e00bcd15c..70494fdee 100644
--- a/LUFA/Drivers/Board/JMDBU2/Buttons.h
+++ b/LUFA/Drivers/Board/JMDBU2/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the Buttons driver
* dispatch header located in LUFA/Drivers/Board/Buttons.h.
*/
-
+
/** \ingroup Group_Buttons
* @defgroup Group_Buttons_JMDBU2 JMDBU2
*
@@ -66,12 +66,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -91,7 +91,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/JMDBU2/LEDs.h b/LUFA/Drivers/Board/JMDBU2/LEDs.h
index 22efbc63e..f048dcfc9 100644
--- a/LUFA/Drivers/Board/JMDBU2/LEDs.h
+++ b/LUFA/Drivers/Board/JMDBU2/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -84,7 +84,7 @@
DDRD |= LEDS_ALL_LEDS;
PORTD &= ~LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD |= LEDMask;
@@ -99,18 +99,18 @@
{
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTD = ((PORTD & ~LEDMask) | ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -122,7 +122,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/Joystick.h b/LUFA/Drivers/Board/Joystick.h
index f4423fb23..5f5026bcb 100644
--- a/LUFA/Drivers/Board/Joystick.h
+++ b/LUFA/Drivers/Board/Joystick.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -40,9 +40,9 @@
* If the BOARD value is set to BOARD_USER, this will include the /Board/Joystick.h file in the user project
* directory.
*
- * For possible BOARD makefile values, see \ref Group_BoardTypes.
+ * For possible BOARD makefile values, see \ref Group_BoardTypes.
*/
-
+
/** \ingroup Group_BoardDrivers
* @defgroup Group_Joystick Joystick Driver - LUFA/Drivers/Board/Joystick.h
*
@@ -73,7 +73,7 @@
/* Includes: */
#include "../../Common/Common.h"
-
+
#if (BOARD == BOARD_NONE)
#error The Board Joystick driver cannot be used if the makefile BOARD option is not set.
#elif (BOARD == BOARD_USBKEY)
@@ -111,3 +111,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h
index 67efbeaee..7122e7ae5 100644
--- a/LUFA/Drivers/Board/LEDs.h
+++ b/LUFA/Drivers/Board/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -62,7 +62,7 @@
*
* \note To make code as compatible as possible, it is assumed that all boards carry a minimum of four LEDs. If
* a board contains less than four LEDs, the remaining LED masks are defined to 0 so as to have no effect.
- * If other behaviour is desired, either alias the remaining LED masks to existing LED masks via the -D
+ * If other behaviour is desired, either alias the remaining LED masks to existing LED masks via the -D
* switch in the project makefile, or alias them to nothing in the makefile to cause compilation errors when
* a non-existing LED is referenced in application code. Note that this means that it is possible to make
* compatible code for a board with no LEDs by making a board LED driver (see \ref Page_WritingBoardDrivers)
@@ -79,7 +79,7 @@
#define __INCLUDE_FROM_LEDS_H
#define INCLUDE_FROM_LEDS_H
#endif
-
+
/* Includes: */
#include "../../Common/Common.h"
@@ -130,7 +130,7 @@
#elif (BOARD == BOARD_USER)
#include "Board/LEDs.h"
#endif
-
+
#if !defined(LEDS_LED1)
#define LEDS_LED1 0
#endif
@@ -146,7 +146,7 @@
#if !defined(LEDS_LED4)
#define LEDS_LED4 0
#endif
-
+
/* Pseudo-Functions for Doxygen: */
#if defined(__DOXYGEN__)
/** Initialises the board LED driver so that the LEDs can be controlled. This sets the appropriate port
@@ -181,7 +181,7 @@
*/
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask);
-
+
/** Toggles all LEDs in the LED mask, leaving all others in their current states.
*
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file).
@@ -199,3 +199,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/OLIMEX162/Buttons.h b/LUFA/Drivers/Board/OLIMEX162/Buttons.h
index c30b4d369..48b75aa6b 100644
--- a/LUFA/Drivers/Board/OLIMEX162/Buttons.h
+++ b/LUFA/Drivers/Board/OLIMEX162/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the Buttons driver
* dispatch header located in LUFA/Drivers/Board/Buttons.h.
*/
-
+
/** \ingroup Group_Buttons
* @defgroup Group_Buttons_OLIMEX162 OLIMEX162
*
@@ -66,12 +66,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -91,7 +91,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/OLIMEX162/LEDs.h b/LUFA/Drivers/Board/OLIMEX162/LEDs.h
index 205836fb5..3bf3a40ac 100644
--- a/LUFA/Drivers/Board/OLIMEX162/LEDs.h
+++ b/LUFA/Drivers/Board/OLIMEX162/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __LEDS_OLIMEX162_H__
#define __LEDS_OLIMEX162_H__
@@ -76,7 +76,7 @@
/** LED mask for none of the board LEDs. */
#define LEDS_NO_LEDS 0
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
@@ -84,7 +84,7 @@
DDRD |= LEDS_ALL_LEDS;
PORTD |= LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD &= ~LEDMask;
@@ -99,13 +99,13 @@
{
PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTD = ((PORTD | LEDMask) & ~ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
@@ -122,7 +122,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h b/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h
index 673bc25f8..4f4d3cc44 100644
--- a/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h
+++ b/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __LEDS_RZUSBSTICK_H__
#define __LEDS_RZUSBSTICK_H__
@@ -71,7 +71,7 @@
/* Macros: */
#define LEDS_PORTD_LEDS (LEDS_LED1 | LEDS_LED2)
#define LEDS_PORTE_LEDS (LEDS_LED3 | LEDS_LED4)
-
+
#define LEDS_PORTE_MASK_SHIFT 4
#endif
@@ -94,7 +94,7 @@
/** LED mask for none of the board LEDs. */
#define LEDS_NO_LEDS 0
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
@@ -106,11 +106,11 @@
DDRE |= (LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT);
PORTE |= (LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT);
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD |= (LEDMask & LEDS_LED1);
- PORTD &= ~(LEDMask & LEDS_LED2);
+ PORTD &= ~(LEDMask & LEDS_LED2);
PORTE &= ~((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
}
@@ -128,7 +128,7 @@
PORTE = ((PORTE | (LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT)) &
~((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT));
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
@@ -137,7 +137,7 @@
PORTE = ((PORTE | ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT)) &
~((ActiveMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT));
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD = (PORTD ^ (LEDMask & LEDS_PORTD_LEDS));
@@ -156,7 +156,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK525/AT45DB321C.h b/LUFA/Drivers/Board/STK525/AT45DB321C.h
index 7b95a62d9..ac6985508 100644
--- a/LUFA/Drivers/Board/STK525/AT45DB321C.h
+++ b/LUFA/Drivers/Board/STK525/AT45DB321C.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __DATAFLASH_CMDS_H__
#define __DATAFLASH_CMDS_H__
@@ -56,9 +56,9 @@
#define DF_STATUS_READY (1 << 7)
#define DF_STATUS_COMPMISMATCH (1 << 6)
#define DF_STATUS_SECTORPROTECTION_ON (1 << 1)
-
+
#define DF_MANUFACTURER_ATMEL 0x1F
-
+
#define DF_CMD_GETSTATUS 0xD7
#define DF_CMD_MAINMEMTOBUFF1 0x53
@@ -67,12 +67,12 @@
#define DF_CMD_MAINMEMTOBUFF2COMP 0x61
#define DF_CMD_AUTOREWRITEBUFF1 0x58
#define DF_CMD_AUTOREWRITEBUFF2 0x59
-
+
#define DF_CMD_MAINMEMPAGEREAD 0xD2
#define DF_CMD_CONTARRAYREAD_LF 0xE8
#define DF_CMD_BUFF1READ_LF 0xD4
#define DF_CMD_BUFF2READ_LF 0xD6
-
+
#define DF_CMD_BUFF1WRITE 0x84
#define DF_CMD_BUFF2WRITE 0x87
#define DF_CMD_BUFF1TOMAINMEMWITHERASE 0x83
@@ -81,7 +81,7 @@
#define DF_CMD_BUFF2TOMAINMEM 0x89
#define DF_CMD_MAINMEMPAGETHROUGHBUFF1 0x82
#define DF_CMD_MAINMEMPAGETHROUGHBUFF2 0x85
-
+
#define DF_CMD_PAGEERASE 0x81
#define DF_CMD_BLOCKERASE 0x50
@@ -90,9 +90,10 @@
#define DF_CMD_SECTORPROTECTIONOFF_BYTE2 0x2A
#define DF_CMD_SECTORPROTECTIONOFF_BYTE3 0x7F
#define DF_CMD_SECTORPROTECTIONOFF_BYTE4 0xCF
-
+
#define DF_CMD_READMANUFACTURERDEVICEINFO 0x9F
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK525/Buttons.h b/LUFA/Drivers/Board/STK525/Buttons.h
index 0dfac0fd4..91b856d49 100644
--- a/LUFA/Drivers/Board/STK525/Buttons.h
+++ b/LUFA/Drivers/Board/STK525/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -72,12 +72,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 2)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -97,7 +97,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK525/Dataflash.h b/LUFA/Drivers/Board/STK525/Dataflash.h
index 67b896ecb..d416221eb 100644
--- a/LUFA/Drivers/Board/STK525/Dataflash.h
+++ b/LUFA/Drivers/Board/STK525/Dataflash.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -52,7 +52,7 @@
#define __DATAFLASH_STK525_H__
/* Includes: */
- #include "AT45DB321C.h"
+ #include "AT45DB321C.h"
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_DATAFLASH_H)
@@ -77,7 +77,7 @@
/** Mask for the first dataflash chip selected. */
#define DATAFLASH_CHIP1 0
-
+
/** Internal main memory page size for the board's dataflash IC. */
#define DATAFLASH_PAGE_SIZE 512
@@ -135,20 +135,20 @@
static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress)
{
Dataflash_DeselectChip();
-
+
if (PageAddress >= DATAFLASH_PAGES)
return;
Dataflash_SelectChip(DATAFLASH_CHIP1);
}
-
+
/** Toggles the select line of the currently selected dataflash IC, so that it is ready to receive
* a new command.
*/
static inline void Dataflash_ToggleSelectedChipCS(void)
{
uint8_t SelectedChipMask = Dataflash_GetSelectedChip();
-
+
Dataflash_DeselectChip();
Dataflash_SelectChip(SelectedChipMask);
}
@@ -161,7 +161,7 @@
Dataflash_ToggleSelectedChipCS();
Dataflash_SendByte(DF_CMD_GETSTATUS);
while (!(Dataflash_ReceiveByte() & DF_STATUS_READY));
- Dataflash_ToggleSelectedChipCS();
+ Dataflash_ToggleSelectedChipCS();
}
/** Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with
@@ -172,12 +172,13 @@
*/
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
const uint16_t BufferByte)
- {
+ {
Dataflash_SendByte(PageAddress >> 6);
Dataflash_SendByte((PageAddress << 2) | (BufferByte >> 8));
Dataflash_SendByte(BufferByte);
}
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK525/Joystick.h b/LUFA/Drivers/Board/STK525/Joystick.h
index 5f5e58490..93122237c 100644
--- a/LUFA/Drivers/Board/STK525/Joystick.h
+++ b/LUFA/Drivers/Board/STK525/Joystick.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the joystick driver
* dispatch header located in LUFA/Drivers/Board/Joystick.h.
*/
-
+
/** \ingroup Group_Joystick
* @defgroup Group_Joystick_STK525 STK525
*
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __JOYSTICK_STK525_H__
#define __JOYSTICK_STK525_H__
@@ -72,7 +72,7 @@
#define JOY_BMASK ((1 << 5) | (1 << 6) | (1 << 7))
#define JOY_EMASK ((1 << 4) | (1 << 5))
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the joystick being pushed in the left direction. */
@@ -89,7 +89,7 @@
/** Mask for the joystick being pushed inward. */
#define JOY_PRESS (1 << 5)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Joystick_Init(void)
@@ -98,9 +98,9 @@
DDRE &= ~(JOY_EMASK);
PORTB |= JOY_BMASK;
- PORTE |= JOY_EMASK;
+ PORTE |= JOY_EMASK;
}
-
+
static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Joystick_GetStatus(void)
{
@@ -112,7 +112,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK525/LEDs.h b/LUFA/Drivers/Board/STK525/LEDs.h
index 7f3e2934a..99c89d675 100644
--- a/LUFA/Drivers/Board/STK525/LEDs.h
+++ b/LUFA/Drivers/Board/STK525/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __LEDS_STK525_H__
#define __LEDS_STK525_H__
@@ -60,7 +60,7 @@
#if defined(__cplusplus)
extern "C" {
#endif
-
+
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
@@ -93,7 +93,7 @@
DDRD |= LEDS_ALL_LEDS;
PORTD &= ~LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD |= LEDMask;
@@ -108,13 +108,13 @@
{
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTD = ((PORTD & ~LEDMask) | ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
@@ -131,7 +131,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK526/AT45DB642D.h b/LUFA/Drivers/Board/STK526/AT45DB642D.h
index aa7346797..54b907750 100644
--- a/LUFA/Drivers/Board/STK526/AT45DB642D.h
+++ b/LUFA/Drivers/Board/STK526/AT45DB642D.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -57,9 +57,9 @@
#define DF_STATUS_COMPMISMATCH (1 << 6)
#define DF_STATUS_SECTORPROTECTION_ON (1 << 1)
#define DF_STATUS_BINARYPAGESIZE_ON (1 << 0)
-
+
#define DF_MANUFACTURER_ATMEL 0x1F
-
+
#define DF_CMD_GETSTATUS 0xD7
#define DF_CMD_POWERDOWN 0xB9
#define DF_CMD_WAKEUP 0xAB
@@ -70,12 +70,12 @@
#define DF_CMD_MAINMEMTOBUFF2COMP 0x61
#define DF_CMD_AUTOREWRITEBUFF1 0x58
#define DF_CMD_AUTOREWRITEBUFF2 0x59
-
+
#define DF_CMD_MAINMEMPAGEREAD 0xD2
#define DF_CMD_CONTARRAYREAD_LF 0x03
#define DF_CMD_BUFF1READ_LF 0xD1
#define DF_CMD_BUFF2READ_LF 0xD3
-
+
#define DF_CMD_BUFF1WRITE 0x84
#define DF_CMD_BUFF2WRITE 0x87
#define DF_CMD_BUFF1TOMAINMEMWITHERASE 0x83
@@ -84,7 +84,7 @@
#define DF_CMD_BUFF2TOMAINMEM 0x89
#define DF_CMD_MAINMEMPAGETHROUGHBUFF1 0x82
#define DF_CMD_MAINMEMPAGETHROUGHBUFF2 0x85
-
+
#define DF_CMD_PAGEERASE 0x81
#define DF_CMD_BLOCKERASE 0x50
#define DF_CMD_SECTORERASE 0x7C
@@ -94,15 +94,16 @@
#define DF_CMD_CHIPERASE_BYTE2 0x94
#define DF_CMD_CHIPERASE_BYTE3 0x80
#define DF_CMD_CHIPERASE_BYTE4 0x9A
-
+
#define DF_CMD_SECTORPROTECTIONOFF ((char[]){0x3D, 0x2A, 0x7F, 0x9A})
#define DF_CMD_SECTORPROTECTIONOFF_BYTE1 0x3D
#define DF_CMD_SECTORPROTECTIONOFF_BYTE2 0x2A
#define DF_CMD_SECTORPROTECTIONOFF_BYTE3 0x7F
#define DF_CMD_SECTORPROTECTIONOFF_BYTE4 0x9A
-
+
#define DF_CMD_READMANUFACTURERDEVICEINFO 0x9F
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK526/Buttons.h b/LUFA/Drivers/Board/STK526/Buttons.h
index da51919c2..a63fe2da1 100644
--- a/LUFA/Drivers/Board/STK526/Buttons.h
+++ b/LUFA/Drivers/Board/STK526/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -72,12 +72,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -97,7 +97,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK526/Dataflash.h b/LUFA/Drivers/Board/STK526/Dataflash.h
index 40d42c96f..e86435db6 100644
--- a/LUFA/Drivers/Board/STK526/Dataflash.h
+++ b/LUFA/Drivers/Board/STK526/Dataflash.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -77,7 +77,7 @@
/** Mask for the first dataflash chip selected. */
#define DATAFLASH_CHIP1 0
-
+
/** Internal main memory page size for the board's dataflash IC. */
#define DATAFLASH_PAGE_SIZE 1024
@@ -93,7 +93,7 @@
DATAFLASH_CHIPCS_DDR |= DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK;
}
-
+
/** Determines the currently selected dataflash chip.
*
* \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected
@@ -135,7 +135,7 @@
static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress)
{
Dataflash_DeselectChip();
-
+
if (PageAddress >= DATAFLASH_PAGES)
return;
@@ -148,7 +148,7 @@
static inline void Dataflash_ToggleSelectedChipCS(void)
{
uint8_t SelectedChipMask = Dataflash_GetSelectedChip();
-
+
Dataflash_DeselectChip();
Dataflash_SelectChip(SelectedChipMask);
}
@@ -161,7 +161,7 @@
Dataflash_ToggleSelectedChipCS();
Dataflash_SendByte(DF_CMD_GETSTATUS);
while (!(Dataflash_ReceiveByte() & DF_STATUS_READY));
- Dataflash_ToggleSelectedChipCS();
+ Dataflash_ToggleSelectedChipCS();
}
/** Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with
@@ -172,12 +172,13 @@
*/
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
const uint16_t BufferByte)
- {
+ {
Dataflash_SendByte(PageAddress >> 5);
Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
Dataflash_SendByte(BufferByte);
}
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK526/Joystick.h b/LUFA/Drivers/Board/STK526/Joystick.h
index 0bf9c7937..1c3669248 100644
--- a/LUFA/Drivers/Board/STK526/Joystick.h
+++ b/LUFA/Drivers/Board/STK526/Joystick.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __JOYSTICK_STK526_H__
#define __JOYSTICK_STK526_H__
@@ -71,7 +71,7 @@
/* Macros: */
#define JOY_BMASK ((1 << 0) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7))
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the joystick being pushed in the left direction. */
@@ -88,7 +88,7 @@
/** Mask for the joystick being pushed inward. */
#define JOY_PRESS (1 << 0)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Joystick_Init(void)
@@ -97,7 +97,7 @@
PORTB |= JOY_BMASK;
}
-
+
static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Joystick_GetStatus(void)
{
@@ -109,7 +109,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/STK526/LEDs.h b/LUFA/Drivers/Board/STK526/LEDs.h
index d01adf8eb..6095218bc 100644
--- a/LUFA/Drivers/Board/STK526/LEDs.h
+++ b/LUFA/Drivers/Board/STK526/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __LEDS_STK526_H__
#define __LEDS_STK526_H__
@@ -93,7 +93,7 @@
DDRD |= LEDS_ALL_LEDS;
PORTD &= ~LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD |= LEDMask;
@@ -108,30 +108,31 @@
{
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTD = ((PORTD & ~LEDMask) | ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
return (PORTD & LEDS_ALL_LEDS);
}
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/TEENSY/LEDs.h b/LUFA/Drivers/Board/TEENSY/LEDs.h
index 37ebb6a9b..ab2c7207a 100644
--- a/LUFA/Drivers/Board/TEENSY/LEDs.h
+++ b/LUFA/Drivers/Board/TEENSY/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __LEDS_TEENSY_H__
#define __LEDS_TEENSY_H__
@@ -76,7 +76,7 @@
/** LED mask for none of the board LEDs. */
#define LEDS_NO_LEDS 0
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
@@ -84,7 +84,7 @@
DDRD |= LEDS_ALL_LEDS;
PORTD |= LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD &= ~LEDMask;
@@ -99,13 +99,13 @@
{
PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTD = ((PORTD | LEDMask) & ~ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
@@ -122,7 +122,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/Temperature.c b/LUFA/Drivers/Board/Temperature.c
index a5e82a2a1..1df6b9c98 100644
--- a/LUFA/Drivers/Board/Temperature.c
+++ b/LUFA/Drivers/Board/Temperature.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -58,3 +58,4 @@ int8_t Temperature_GetTemperature(void)
return TEMP_MAX_TEMP;
}
+
diff --git a/LUFA/Drivers/Board/Temperature.h b/LUFA/Drivers/Board/Temperature.h
index 40d8e9890..ba9752e5a 100644
--- a/LUFA/Drivers/Board/Temperature.h
+++ b/LUFA/Drivers/Board/Temperature.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -31,7 +31,7 @@
/** \file
* \brief Master include file for the board temperature sensor driver.
*
- * Master include file for the board temperature sensor driver, for the USB boards which contain a temperature sensor.
+ * Master include file for the board temperature sensor driver, for the USB boards which contain a temperature sensor.
*/
/** \ingroup Group_BoardDrivers
@@ -58,7 +58,7 @@
#include "../../Common/Common.h"
#include "../Peripheral/ADC.h"
-
+
#if (BOARD == BOARD_NONE)
#error The Board Temperature Sensor driver cannot be used if the makefile BOARD option is not set.
#elif ((BOARD != BOARD_USBKEY) && (BOARD != BOARD_STK525) && \
@@ -76,7 +76,7 @@
/* Macros: */
/** ADC channel number for the temperature sensor. */
#define TEMP_ADC_CHANNEL 0
-
+
/** ADC channel MUX mask for the temperature sensor. */
#define TEMP_ADC_CHANNEL_MASK ADC_CHANNEL0
@@ -85,7 +85,7 @@
/** Maximum returnable temperature from the \ref Temperature_GetTemperature() function. */
#define TEMP_MAX_TEMP ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET)
-
+
/* Inline Functions: */
/** Initialises the temperature sensor driver, including setting up the appropriate ADC channel.
* This must be called before any other temperature sensor routines.
@@ -118,7 +118,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/UDIP/Buttons.h b/LUFA/Drivers/Board/UDIP/Buttons.h
index 2cc86d11a..fbaa2f1e7 100644
--- a/LUFA/Drivers/Board/UDIP/Buttons.h
+++ b/LUFA/Drivers/Board/UDIP/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the Buttons driver
* dispatch header located in LUFA/Drivers/Board/Buttons.h.
*/
-
+
/** \ingroup Group_Buttons
* @defgroup Group_Buttons_UDIP UDIP
*
@@ -66,12 +66,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -91,7 +91,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/UDIP/LEDs.h b/LUFA/Drivers/Board/UDIP/LEDs.h
index 36979f534..e605c1f18 100644
--- a/LUFA/Drivers/Board/UDIP/LEDs.h
+++ b/LUFA/Drivers/Board/UDIP/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -71,7 +71,7 @@
/* Macros: */
#define LEDS_PORTB_LEDS (LEDS_LED1 | LEDS_LED2)
#define LEDS_PORTD_LEDS (LEDS_LED3 | LEDS_LED4)
-
+
#define LEDS_PORTD_MASK_SHIFT 1
#endif
@@ -102,7 +102,7 @@
DDRB |= LEDS_PORTB_LEDS;
DDRD |= (LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT);
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTB |= (LEDMask & LEDS_PORTB_LEDS);
@@ -121,7 +121,7 @@
PORTD = (PORTD & ~(LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT)) |
((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
@@ -129,13 +129,13 @@
PORTD = (PORTD & ~((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT)) |
((ActiveMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= (LEDMask & LEDS_PORTB_LEDS);
PORTD ^= ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT);
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -147,7 +147,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/UNO/LEDs.h b/LUFA/Drivers/Board/UNO/LEDs.h
index 7db32afda..37aff5326 100644
--- a/LUFA/Drivers/Board/UNO/LEDs.h
+++ b/LUFA/Drivers/Board/UNO/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -85,7 +85,7 @@
DDRD |= LEDS_ALL_LEDS;
PORTD |= LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD &= ~LEDMask;
@@ -100,7 +100,7 @@
{
PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
@@ -111,7 +111,7 @@
{
PORTD ^= LEDMask;
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -123,7 +123,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/USBFOO/Buttons.h b/LUFA/Drivers/Board/USBFOO/Buttons.h
index c0f40dcf0..782545d83 100644
--- a/LUFA/Drivers/Board/USBFOO/Buttons.h
+++ b/LUFA/Drivers/Board/USBFOO/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the Buttons driver
* dispatch header located in LUFA/Drivers/Board/Buttons.h.
*/
-
+
/** \ingroup Group_Buttons
* @defgroup Group_Buttons_USBFOO USBFOO
*
@@ -66,12 +66,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -91,7 +91,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/USBFOO/LEDS.h b/LUFA/Drivers/Board/USBFOO/LEDS.h
index 3ea9f4341..5f19f3096 100644
--- a/LUFA/Drivers/Board/USBFOO/LEDS.h
+++ b/LUFA/Drivers/Board/USBFOO/LEDS.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __LEDS_USBFOO_H__
#define __LEDS_USBFOO_H__
@@ -76,7 +76,7 @@
/** LED mask for none of the board LEDs. */
#define LEDS_NO_LEDS 0
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
@@ -84,7 +84,7 @@
DDRD |= LEDS_ALL_LEDS;
PORTD |= LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD &= ~LEDMask;
@@ -99,13 +99,13 @@
{
PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTD = ((PORTD | LEDMask) & ~ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
@@ -122,7 +122,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/USBKEY/AT45DB642D.h b/LUFA/Drivers/Board/USBKEY/AT45DB642D.h
index f78ddb555..0374c99ed 100644
--- a/LUFA/Drivers/Board/USBKEY/AT45DB642D.h
+++ b/LUFA/Drivers/Board/USBKEY/AT45DB642D.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __DATAFLASH_CMDS_H__
#define __DATAFLASH_CMDS_H__
@@ -57,9 +57,9 @@
#define DF_STATUS_COMPMISMATCH (1 << 6)
#define DF_STATUS_SECTORPROTECTION_ON (1 << 1)
#define DF_STATUS_BINARYPAGESIZE_ON (1 << 0)
-
+
#define DF_MANUFACTURER_ATMEL 0x1F
-
+
#define DF_CMD_GETSTATUS 0xD7
#define DF_CMD_POWERDOWN 0xB9
#define DF_CMD_WAKEUP 0xAB
@@ -70,12 +70,12 @@
#define DF_CMD_MAINMEMTOBUFF2COMP 0x61
#define DF_CMD_AUTOREWRITEBUFF1 0x58
#define DF_CMD_AUTOREWRITEBUFF2 0x59
-
+
#define DF_CMD_MAINMEMPAGEREAD 0xD2
#define DF_CMD_CONTARRAYREAD_LF 0x03
#define DF_CMD_BUFF1READ_LF 0xD1
#define DF_CMD_BUFF2READ_LF 0xD3
-
+
#define DF_CMD_BUFF1WRITE 0x84
#define DF_CMD_BUFF2WRITE 0x87
#define DF_CMD_BUFF1TOMAINMEMWITHERASE 0x83
@@ -84,7 +84,7 @@
#define DF_CMD_BUFF2TOMAINMEM 0x89
#define DF_CMD_MAINMEMPAGETHROUGHBUFF1 0x82
#define DF_CMD_MAINMEMPAGETHROUGHBUFF2 0x85
-
+
#define DF_CMD_PAGEERASE 0x81
#define DF_CMD_BLOCKERASE 0x50
#define DF_CMD_SECTORERASE 0x7C
@@ -94,15 +94,16 @@
#define DF_CMD_CHIPERASE_BYTE2 0x94
#define DF_CMD_CHIPERASE_BYTE3 0x80
#define DF_CMD_CHIPERASE_BYTE4 0x9A
-
+
#define DF_CMD_SECTORPROTECTIONOFF ((char[]){0x3D, 0x2A, 0x7F, 0x9A})
#define DF_CMD_SECTORPROTECTIONOFF_BYTE1 0x3D
#define DF_CMD_SECTORPROTECTIONOFF_BYTE2 0x2A
#define DF_CMD_SECTORPROTECTIONOFF_BYTE3 0x7F
#define DF_CMD_SECTORPROTECTIONOFF_BYTE4 0x9A
-
+
#define DF_CMD_READMANUFACTURERDEVICEINFO 0x9F
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/USBKEY/Buttons.h b/LUFA/Drivers/Board/USBKEY/Buttons.h
index 82a3b0f5b..551ae6893 100644
--- a/LUFA/Drivers/Board/USBKEY/Buttons.h
+++ b/LUFA/Drivers/Board/USBKEY/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the Buttons driver
* dispatch header located in LUFA/Drivers/Board/Buttons.h.
*/
-
+
/** \ingroup Group_Buttons
* @defgroup Group_Buttons_USBKEY USBKEY
*
@@ -66,12 +66,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 2)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -91,7 +91,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/USBKEY/Dataflash.h b/LUFA/Drivers/Board/USBKEY/Dataflash.h
index 8b01c64c6..a1aa2a44b 100644
--- a/LUFA/Drivers/Board/USBKEY/Dataflash.h
+++ b/LUFA/Drivers/Board/USBKEY/Dataflash.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -43,7 +43,7 @@
* Board specific Dataflash driver header for the Atmel USBKEY board.
*
* \note This file should not be included directly. It is automatically included as needed by the dataflash driver
- * dispatch header located in LUFA/Drivers/Board/Dataflash.h.
+ * dispatch header located in LUFA/Drivers/Board/Dataflash.h.
*
* @{
*/
@@ -58,7 +58,7 @@
#if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif
-
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
@@ -66,7 +66,7 @@
#define DATAFLASH_CHIPCS_DDR DDRE
#define DATAFLASH_CHIPCS_PORT PORTE
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Constant indicating the total number of dataflash ICs mounted on the selected board. */
@@ -80,13 +80,13 @@
/** Mask for the second dataflash chip selected. */
#define DATAFLASH_CHIP2 (1 << 0)
-
+
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE 1024
/** Total number of pages inside each of the board's dataflash ICs. */
#define DATAFLASH_PAGES 8192
-
+
/* Inline Functions: */
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
* The AVR's SPI driver MUST be initialized before any of the dataflash commands are used.
@@ -125,7 +125,7 @@
{
Dataflash_SelectChip(DATAFLASH_NO_CHIP);
}
-
+
/** Selects a dataflash IC from the given page number, which should range from 0 to
* ((DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS) - 1). For boards containing only one
* dataflash IC, this will select DATAFLASH_CHIP1. If the given page number is outside
@@ -138,7 +138,7 @@
static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress)
{
Dataflash_DeselectChip();
-
+
if (PageAddress >= (DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS))
return;
@@ -154,7 +154,7 @@
static inline void Dataflash_ToggleSelectedChipCS(void)
{
uint8_t SelectedChipMask = Dataflash_GetSelectedChip();
-
+
Dataflash_DeselectChip();
Dataflash_SelectChip(SelectedChipMask);
}
@@ -167,7 +167,7 @@
Dataflash_ToggleSelectedChipCS();
Dataflash_SendByte(DF_CMD_GETSTATUS);
while (!(Dataflash_ReceiveByte() & DF_STATUS_READY));
- Dataflash_ToggleSelectedChipCS();
+ Dataflash_ToggleSelectedChipCS();
}
/** Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with
@@ -178,14 +178,15 @@
*/
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
const uint16_t BufferByte)
- {
+ {
PageAddress >>= 1;
-
+
Dataflash_SendByte(PageAddress >> 5);
Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
Dataflash_SendByte(BufferByte);
- }
+ }
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/USBKEY/Joystick.h b/LUFA/Drivers/Board/USBKEY/Joystick.h
index bea3073c1..3cc252480 100644
--- a/LUFA/Drivers/Board/USBKEY/Joystick.h
+++ b/LUFA/Drivers/Board/USBKEY/Joystick.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -72,7 +72,7 @@
#define JOY_BMASK ((1 << 5) | (1 << 6) | (1 << 7))
#define JOY_EMASK ((1 << 4) | (1 << 5))
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the joystick being pushed in the left direction. */
@@ -89,7 +89,7 @@
/** Mask for the joystick being pushed inward. */
#define JOY_PRESS (1 << 5)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Joystick_Init(void)
@@ -98,9 +98,9 @@
DDRE &= ~(JOY_EMASK);
PORTB |= JOY_BMASK;
- PORTE |= JOY_EMASK;
+ PORTE |= JOY_EMASK;
}
-
+
static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Joystick_GetStatus(void)
{
@@ -116,3 +116,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/USBKEY/LEDs.h b/LUFA/Drivers/Board/USBKEY/LEDs.h
index 754009440..6ee0ec343 100644
--- a/LUFA/Drivers/Board/USBKEY/LEDs.h
+++ b/LUFA/Drivers/Board/USBKEY/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -93,7 +93,7 @@
DDRD |= LEDS_ALL_LEDS;
PORTD &= ~LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTD |= LEDMask;
@@ -108,18 +108,18 @@
{
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTD = ((PORTD & ~LEDMask) | ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTD ^= LEDMask;
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
@@ -131,7 +131,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/USBTINYMKII/Buttons.h b/LUFA/Drivers/Board/USBTINYMKII/Buttons.h
index 7037ee3d6..ddfb9831c 100644
--- a/LUFA/Drivers/Board/USBTINYMKII/Buttons.h
+++ b/LUFA/Drivers/Board/USBTINYMKII/Buttons.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -66,12 +66,12 @@
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
-
+
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
@@ -91,7 +91,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/USBTINYMKII/LEDs.h b/LUFA/Drivers/Board/USBTINYMKII/LEDs.h
index 9338a2007..7f252567c 100644
--- a/LUFA/Drivers/Board/USBTINYMKII/LEDs.h
+++ b/LUFA/Drivers/Board/USBTINYMKII/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -88,7 +88,7 @@
DDRB |= LEDS_ALL_LEDS;
PORTB &= ~LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LedMask)
{
PORTB |= LedMask;
@@ -103,13 +103,13 @@
{
PORTB = ((PORTB & ~LEDS_ALL_LEDS) | LedMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LedMask,
const uint8_t ActiveMask)
{
PORTB = ((PORTB & ~LedMask) | ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= LEDMask;
@@ -126,7 +126,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/XPLAIN/AT45DB642D.h b/LUFA/Drivers/Board/XPLAIN/AT45DB642D.h
index bbac11c89..ce7af9ea4 100644
--- a/LUFA/Drivers/Board/XPLAIN/AT45DB642D.h
+++ b/LUFA/Drivers/Board/XPLAIN/AT45DB642D.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __DATAFLASH_CMDS_H__
#define __DATAFLASH_CMDS_H__
@@ -57,9 +57,9 @@
#define DF_STATUS_COMPMISMATCH (1 << 6)
#define DF_STATUS_SECTORPROTECTION_ON (1 << 1)
#define DF_STATUS_BINARYPAGESIZE_ON (1 << 0)
-
+
#define DF_MANUFACTURER_ATMEL 0x1F
-
+
#define DF_CMD_GETSTATUS 0xD7
#define DF_CMD_POWERDOWN 0xB9
#define DF_CMD_WAKEUP 0xAB
@@ -70,12 +70,12 @@
#define DF_CMD_MAINMEMTOBUFF2COMP 0x61
#define DF_CMD_AUTOREWRITEBUFF1 0x58
#define DF_CMD_AUTOREWRITEBUFF2 0x59
-
+
#define DF_CMD_MAINMEMPAGEREAD 0xD2
#define DF_CMD_CONTARRAYREAD_LF 0x03
#define DF_CMD_BUFF1READ_LF 0xD1
#define DF_CMD_BUFF2READ_LF 0xD3
-
+
#define DF_CMD_BUFF1WRITE 0x84
#define DF_CMD_BUFF2WRITE 0x87
#define DF_CMD_BUFF1TOMAINMEMWITHERASE 0x83
@@ -84,7 +84,7 @@
#define DF_CMD_BUFF2TOMAINMEM 0x89
#define DF_CMD_MAINMEMPAGETHROUGHBUFF1 0x82
#define DF_CMD_MAINMEMPAGETHROUGHBUFF2 0x85
-
+
#define DF_CMD_PAGEERASE 0x81
#define DF_CMD_BLOCKERASE 0x50
#define DF_CMD_SECTORERASE 0x7C
@@ -94,15 +94,16 @@
#define DF_CMD_CHIPERASE_BYTE2 0x94
#define DF_CMD_CHIPERASE_BYTE3 0x80
#define DF_CMD_CHIPERASE_BYTE4 0x9A
-
+
#define DF_CMD_SECTORPROTECTIONOFF ((char[]){0x3D, 0x2A, 0x7F, 0x9A})
#define DF_CMD_SECTORPROTECTIONOFF_BYTE1 0x3D
#define DF_CMD_SECTORPROTECTIONOFF_BYTE2 0x2A
#define DF_CMD_SECTORPROTECTIONOFF_BYTE3 0x7F
#define DF_CMD_SECTORPROTECTIONOFF_BYTE4 0x9A
-
+
#define DF_CMD_READMANUFACTURERDEVICEINFO 0x9F
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/XPLAIN/Dataflash.h b/LUFA/Drivers/Board/XPLAIN/Dataflash.h
index 9edbf2e8a..670633135 100644
--- a/LUFA/Drivers/Board/XPLAIN/Dataflash.h
+++ b/LUFA/Drivers/Board/XPLAIN/Dataflash.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -58,7 +58,7 @@
#if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif
-
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
@@ -66,7 +66,7 @@
#define DATAFLASH_CHIPCS_DDR DDRB
#define DATAFLASH_CHIPCS_PORT PORTB
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Constant indicating the total number of dataflash ICs mounted on the selected board. */
@@ -81,15 +81,15 @@
#if (BOARD == BOARD_XPLAIN_REV1)
#define DATAFLASH_PAGE_SIZE 256
- #define DATAFLASH_PAGES 2048
+ #define DATAFLASH_PAGES 2048
#else
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE 1024
/** Total number of pages inside each of the board's dataflash ICs. */
- #define DATAFLASH_PAGES 8192
+ #define DATAFLASH_PAGES 8192
#endif
-
+
/* Inline Functions: */
/** Initialises the dataflash driver so that commands and data may be sent to an attached dataflash IC.
* The AVR's SPI driver MUST be initialized before any of the dataflash commands are used.
@@ -141,20 +141,20 @@
static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress)
{
Dataflash_DeselectChip();
-
+
if (PageAddress >= DATAFLASH_PAGES)
return;
Dataflash_SelectChip(DATAFLASH_CHIP1);
}
-
+
/** Toggles the select line of the currently selected dataflash IC, so that it is ready to receive
* a new command.
*/
static inline void Dataflash_ToggleSelectedChipCS(void)
{
uint8_t SelectedChipMask = Dataflash_GetSelectedChip();
-
+
Dataflash_DeselectChip();
Dataflash_SelectChip(SelectedChipMask);
}
@@ -167,7 +167,7 @@
Dataflash_ToggleSelectedChipCS();
Dataflash_SendByte(DF_CMD_GETSTATUS);
while (!(Dataflash_ReceiveByte() & DF_STATUS_READY));
- Dataflash_ToggleSelectedChipCS();
+ Dataflash_ToggleSelectedChipCS();
}
/** Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with
@@ -182,8 +182,9 @@
Dataflash_SendByte(PageAddress >> 5);
Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
Dataflash_SendByte(BufferByte);
- }
+ }
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Board/XPLAIN/LEDs.h b/LUFA/Drivers/Board/XPLAIN/LEDs.h
index cf53fa50b..d5f67d1ab 100644
--- a/LUFA/Drivers/Board/XPLAIN/LEDs.h
+++ b/LUFA/Drivers/Board/XPLAIN/LEDs.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __LEDS_XPLAIN_H__
#define __LEDS_XPLAIN_H__
@@ -84,7 +84,7 @@
DDRB |= LEDS_ALL_LEDS;
PORTB |= LEDS_ALL_LEDS;
}
-
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTB &= ~LEDMask;
@@ -99,30 +99,31 @@
{
PORTB = ((PORTB | LEDS_ALL_LEDS) & ~LEDMask);
}
-
+
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
const uint8_t ActiveMask)
{
PORTB = ((PORTB | LEDMask) & ~ActiveMask);
}
-
+
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
PORTB ^= LEDMask;
}
-
+
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
return (~PORTB & LEDS_ALL_LEDS);
}
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Misc/TerminalCodes.h b/LUFA/Drivers/Misc/TerminalCodes.h
index ec35d1262..5048e217d 100644
--- a/LUFA/Drivers/Misc/TerminalCodes.h
+++ b/LUFA/Drivers/Misc/TerminalCodes.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -34,7 +34,7 @@
* ANSI terminal compatible escape sequences. These escape sequences are designed to be concatenated with existing
* strings to modify their display on a compatible terminal application.
*/
-
+
/** \ingroup Group_MiscDrivers
* @defgroup Group_Terminal ANSI Terminal Escape Codes - LUFA/Drivers/Misc/TerminalCodes.h
*
@@ -56,7 +56,7 @@
*
* @{
*/
-
+
#ifndef __TERMINALCODES_H__
#define __TERMINALCODES_H__
@@ -97,8 +97,8 @@
/** Turns off italics so that any following text is printed to the terminal in non italics. */
#define ESC_ITALICS_OFF ANSI_ESCAPE_SEQUENCE("23m")
-
- /** Turns off underline so that any following text is printed to the terminal non underlined. */
+
+ /** Turns off underline so that any following text is printed to the terminal non underlined. */
#define ESC_UNDERLINE_OFF ANSI_ESCAPE_SEQUENCE("24m")
/** Turns off inverse so that any following text is printed to the terminal in non inverted colours. */
@@ -162,7 +162,7 @@
/** Sets the text background colour to the terminal's default. */
#define ESC_BG_DEFAULT ANSI_ESCAPE_SEQUENCE("49m")
-
+
/** Sets the cursor position to the given line and column. */
#define ESC_CURSOR_POS(L, C) ANSI_ESCAPE_SEQUENCE(#L ";" #C "H")
@@ -183,7 +183,7 @@
/** Restores the cursor position to the last position saved with \ref ESC_CURSOR_POS_SAVE. */
#define ESC_CURSOR_POS_RESTORE ANSI_ESCAPE_SEQUENCE("u")
-
+
/** Erases the entire display, returning the cursor to the top left. */
#define ESC_ERASE_DISPLAY ANSI_ESCAPE_SEQUENCE("2J")
@@ -193,3 +193,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Peripheral/ADC.h b/LUFA/Drivers/Peripheral/ADC.h
index 24997f583..762208b34 100644
--- a/LUFA/Drivers/Peripheral/ADC.h
+++ b/LUFA/Drivers/Peripheral/ADC.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -49,7 +49,7 @@
* ADC present on many AVR models, for the conversion of analogue signals into the
* digital domain.
*/
-
+
#ifndef __ADC_H__
#define __ADC_H__
@@ -67,5 +67,6 @@
#else
#error "ADC is not available for the currently selected AVR model."
#endif
-
+
#endif
+
diff --git a/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h b/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
index e927de182..0aaaa9306 100644
--- a/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
+++ b/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -49,16 +49,16 @@
*
* @{
*/
-
+
#ifndef __ADC_AVRU4U6U7_H__
#define __ADC_AVRU4U6U7_H__
/* Includes: */
#include "../../../Common/Common.h"
-
+
#include <avr/io.h>
#include <stdbool.h>
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -70,7 +70,7 @@
#endif
/* Public Interface - May be used in end-application: */
- /* Macros: */
+ /* Macros: */
/** Reference mask, for using the voltage present at the AVR's AREF pin for the ADC reference. */
#define ADC_REFERENCE_AREF 0
@@ -79,7 +79,7 @@
/** Reference mask, for using the internally generated 2.56V reference voltage as the ADC reference. */
#define ADC_REFERENCE_INT2560MV ((1 << REFS1) | (1 << REFS0))
-
+
/** Left-adjusts the 10-bit ADC result, so that the upper 8 bits of the value returned by the
* ADC_GetResult() macro contain the 8 most significant bits of the result. */
#define ADC_LEFT_ADJUSTED (1 << ADLAR)
@@ -87,7 +87,7 @@
/** Right-adjusts the 10-bit ADC result, so that the lower 8 bits of the value returned by the
* ADC_GetResult() macro contain the 8 least significant bits of the result. */
#define ADC_RIGHT_ADJUSTED (0 << ADLAR)
-
+
/** Sets the ADC mode to free running, so that conversions take place continuously as fast as the ADC
* is capable of at the given input clock speed. */
#define ADC_FREE_RUNNING (1 << ADATE)
@@ -95,7 +95,7 @@
/** Sets the ADC mode to single conversion, so that only a single conversion will take place before
* the ADC returns to idle. */
#define ADC_SINGLE_CONVERSION (0 << ADATE)
-
+
/** Sets the ADC input clock to prescale by a factor of 2 the AVR's system clock. */
#define ADC_PRESCALE_2 (1 << ADPS0)
@@ -116,7 +116,7 @@
/** Sets the ADC input clock to prescale by a factor of 128 the AVR's system clock. */
#define ADC_PRESCALE_128 ((1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0))
-
+
//@{
/** MUX mask define for the ADC0 channel of the ADC. See \ref ADC_StartReading and \ref ADC_GetChannelReading. */
#define ADC_CHANNEL0 (0x00 << MUX0)
@@ -152,7 +152,7 @@
/** MUX mask define for the internal 1.1V bandgap channel of the ADC. See \ref ADC_StartReading and \ref ADC_GetChannelReading. */
#define ADC_1100MV_BANDGAP (0x1E << MUX0)
-
+
#if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__DOXYGEN__))
/** MUX mask define for the ADC8 channel of the ADC. See \ref ADC_StartReading and \ref ADC_GetChannelReading.
*
@@ -198,7 +198,7 @@
#define ADC_INT_TEMP_SENS ((1 << 8) | (0x07 << MUX0))
#endif
//@}
-
+
/* Inline Functions: */
/** Configures the given ADC channel, ready for ADC conversions. This function sets the
* associated port pin as an input and disables the digital portion of the I/O to reduce
@@ -216,7 +216,7 @@
{
#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
- defined(__AVR_ATmega32U6__))
+ defined(__AVR_ATmega32U6__))
DDRF &= ~(1 << ChannelIndex);
DIDR0 |= (1 << ChannelIndex);
#elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
@@ -242,7 +242,7 @@
}
#endif
}
-
+
/** De-configures the given ADC channel, re-enabling digital I/O mode instead of analog. This
* function sets the associated port pin as an input and re-enabled the digital portion of
* the I/O.
@@ -259,7 +259,7 @@
{
#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
- defined(__AVR_ATmega32U6__))
+ defined(__AVR_ATmega32U6__))
DDRF &= ~(1 << ChannelIndex);
DIDR0 &= ~(1 << ChannelIndex);
#elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
@@ -299,14 +299,14 @@
static inline void ADC_StartReading(const uint16_t MUXMask)
{
ADMUX = MUXMask;
-
+
#if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__DOXYGEN__))
if (MUXMask & (1 << 8))
ADCSRB |= (1 << MUX5);
else
ADCSRB &= ~(1 << MUX5);
#endif
-
+
ADCSRA |= (1 << ADSC);
}
@@ -320,7 +320,7 @@
{
return ((ADCSRA & (1 << ADIF)) ? true : false);
}
-
+
/** Retrieves the conversion value of the last completed ADC conversion and clears the reading
* completion flag.
*
@@ -346,9 +346,9 @@
static inline uint16_t ADC_GetChannelReading(const uint16_t MUXMask)
{
ADC_StartReading(MUXMask);
-
+
while (!(ADC_IsReadingComplete()));
-
+
return ADC_GetResult();
}
@@ -372,7 +372,7 @@
{
ADCSRA = 0;
}
-
+
/** Indicates if the ADC is currently enabled.
*
* \return Boolean true if the ADC subsystem is currently enabled, false otherwise.
@@ -382,12 +382,13 @@
{
return ((ADCSRA & (1 << ADEN)) ? true : false);
}
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h b/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h
index 511105985..a35f729f3 100644
--- a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h
+++ b/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -53,12 +53,12 @@
/* Includes: */
#include "../../../Common/Common.h"
-
+
#include <avr/io.h>
#include <stdbool.h>
#include <util/twi.h>
#include <util/delay.h>
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -79,10 +79,10 @@
{
TWCR |= (1 << TWEN);
}
-
+
/** Turns off the TWI driver hardware. If this is called, any further TWI operations will require a call to
* \ref TWI_Init() before the TWI can be used again.
- */
+ */
static inline void TWI_ShutDown(void) ATTR_ALWAYS_INLINE;
static inline void TWI_ShutDown(void)
{
@@ -105,7 +105,7 @@
static inline bool TWI_SendByte(const uint8_t Byte)
{
TWDR = Byte;
- TWCR = ((1 << TWINT) | (1 << TWEN));
+ TWCR = ((1 << TWINT) | (1 << TWEN));
while (!(TWCR & (1 << TWINT)));
return ((TWSR & TW_STATUS_MASK) == TW_MT_DATA_ACK);
@@ -122,7 +122,7 @@
const bool LastByte)
{
uint8_t TWCRMask = ((1 << TWINT) | (1 << TWEN));
-
+
if (!(LastByte))
TWCRMask |= (1 << TWEA);
@@ -152,3 +152,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Peripheral/SPI.h b/LUFA/Drivers/Peripheral/SPI.h
index 8c38dcc27..3858acabc 100644
--- a/LUFA/Drivers/Peripheral/SPI.h
+++ b/LUFA/Drivers/Peripheral/SPI.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -64,7 +64,7 @@
/* Macros: */
#define SPI_USE_DOUBLESPEED (1 << SPE)
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** SPI prescaler mask for SPI_Init(). Divides the system clock by a factor of 2. */
@@ -87,7 +87,7 @@
/** SPI prescaler mask for SPI_Init(). Divides the system clock by a factor of 128. */
#define SPI_SPEED_FCPU_DIV_128 ((1 << SPR1) | (1 << SPR0))
-
+
/** SPI clock polarity mask for SPI_Init(). Indicates that the SCK should lead on the rising edge. */
#define SPI_SCK_LEAD_RISING (0 << CPOL)
@@ -124,25 +124,25 @@
DDRB |= ((1 << 1) | (1 << 2));
DDRB &= ((1 << 0) | (1 << 3));
PORTB |= ((1 << 0) | (1 << 3));
-
+
SPCR = ((1 << SPE) | SPIOptions);
-
+
if (SPIOptions & SPI_USE_DOUBLESPEED)
SPSR |= (1 << SPI2X);
else
SPSR &= ~(1 << SPI2X);
}
-
+
/** Turns off the SPI driver, disabling and returning used hardware to their default configuration. */
static inline void SPI_ShutDown(void)
{
DDRB &= ~((1 << 1) | (1 << 2));
PORTB &= ~((1 << 0) | (1 << 3));
-
+
SPCR = 0;
SPSR = 0;
}
-
+
/** Sends and receives a byte through the SPI interface, blocking until the transfer is complete.
*
* \param[in] Byte Byte to send through the SPI interface.
@@ -186,7 +186,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Peripheral/Serial.c b/LUFA/Drivers/Peripheral/Serial.c
index b1141de14..97a1febdc 100644
--- a/LUFA/Drivers/Peripheral/Serial.c
+++ b/LUFA/Drivers/Peripheral/Serial.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -51,3 +51,4 @@ void Serial_TxString(const char* StringPtr)
StringPtr++;
}
}
+
diff --git a/LUFA/Drivers/Peripheral/Serial.h b/LUFA/Drivers/Peripheral/Serial.h
index 47f65ea7b..37722db0a 100644
--- a/LUFA/Drivers/Peripheral/Serial.h
+++ b/LUFA/Drivers/Peripheral/Serial.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -33,7 +33,7 @@
*
* Driver for the USART subsystem on supported USB AVRs.
*/
-
+
/** \ingroup Group_PeripheralDrivers
* @defgroup Group_Serial Serial USART Driver - LUFA/Drivers/Peripheral/Serial.h
*
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __SERIAL_H__
#define __SERIAL_H__
@@ -55,7 +55,7 @@
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <stdbool.h>
-
+
#include "../../Common/Common.h"
#include "../Misc/TerminalCodes.h"
@@ -104,7 +104,7 @@
UCSR1C = ((1 << UCSZ11) | (1 << UCSZ10));
UCSR1A = (DoubleSpeed ? (1 << U2X1) : 0);
UCSR1B = ((1 << TXEN1) | (1 << RXEN1));
-
+
DDRD |= (1 << 3);
PORTD |= (1 << 2);
}
@@ -117,7 +117,7 @@
UCSR1C = 0;
UBRR1 = 0;
-
+
DDRD &= ~(1 << 3);
PORTD &= ~(1 << 2);
}
@@ -131,7 +131,7 @@
{
return ((UCSR1A & (1 << RXC1)) ? true : false);
}
-
+
/** Transmits a given byte through the USART.
*
* \param[in] DataByte Byte to transmit through the USART.
@@ -153,14 +153,15 @@
static inline char Serial_RxByte(void)
{
while (!(UCSR1A & (1 << RXC1)));
- return UDR1;
+ return UDR1;
}
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Peripheral/SerialStream.c b/LUFA/Drivers/Peripheral/SerialStream.c
index 36a054876..9589420a0 100644
--- a/LUFA/Drivers/Peripheral/SerialStream.c
+++ b/LUFA/Drivers/Peripheral/SerialStream.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -37,7 +37,7 @@ static int SerialStream_TxByte(char DataByte,
FILE *Stream)
{
(void)Stream;
-
+
Serial_TxByte(DataByte);
return 0;
}
@@ -45,9 +45,10 @@ static int SerialStream_TxByte(char DataByte,
static int SerialStream_RxByte(FILE *Stream)
{
(void)Stream;
-
+
if (!(Serial_IsCharReceived()))
return _FDEV_EOF;
return Serial_RxByte();
}
+
diff --git a/LUFA/Drivers/Peripheral/SerialStream.h b/LUFA/Drivers/Peripheral/SerialStream.h
index 938d8f016..c0f15658d 100644
--- a/LUFA/Drivers/Peripheral/SerialStream.h
+++ b/LUFA/Drivers/Peripheral/SerialStream.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -59,15 +59,15 @@
/* Includes: */
#include <avr/io.h>
#include <stdio.h>
-
+
#include "Serial.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
- /* Private Interface - For use in library only: */
+ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* External Variables: */
extern FILE USARTStream;
@@ -92,18 +92,18 @@
const bool DoubleSpeed)
{
Serial_Init(BaudRate, DoubleSpeed);
-
+
stdout = &USARTStream;
stdin = &USARTStream;
}
-
+
/** Turns off the serial stream (and regular USART driver), disabling and returning used hardware to
* their default configuration.
*/
static inline void SerialStream_ShutDown(void)
{
Serial_ShutDown();
- }
+ }
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
@@ -113,3 +113,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/Peripheral/TWI.c b/LUFA/Drivers/Peripheral/TWI.c
index b8aec4852..64f847544 100644
--- a/LUFA/Drivers/Peripheral/TWI.c
+++ b/LUFA/Drivers/Peripheral/TWI.c
@@ -1,6 +1,6 @@
/*
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -15,7 +15,7 @@ bool TWI_StartTransmission(const uint8_t SlaveAddress,
bool BusCaptured = false;
uint16_t TimeoutRemaining;
- TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN));
+ TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN));
TimeoutRemaining = (TimeoutMS * 100);
while (TimeoutRemaining-- && !(BusCaptured))
@@ -29,35 +29,35 @@ bool TWI_StartTransmission(const uint8_t SlaveAddress,
BusCaptured = true;
break;
case TW_MT_ARB_LOST:
- TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN));
+ TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN));
continue;
default:
TWCR = (1 << TWEN);
return false;
}
}
-
+
_delay_us(10);
}
-
+
if (!(BusCaptured))
{
TWCR = (1 << TWEN);
return false;
}
-
+
TWDR = SlaveAddress;
TWCR = ((1 << TWINT) | (1 << TWEN));
-
+
TimeoutRemaining = (TimeoutMS * 100);
while (TimeoutRemaining--)
{
if (TWCR & (1 << TWINT))
break;
-
+
_delay_us(10);
}
-
+
if (!(TimeoutRemaining))
return false;
@@ -72,3 +72,4 @@ bool TWI_StartTransmission(const uint8_t SlaveAddress,
}
}
}
+
diff --git a/LUFA/Drivers/Peripheral/TWI.h b/LUFA/Drivers/Peripheral/TWI.h
index 42539203e..87c89a3a0 100644
--- a/LUFA/Drivers/Peripheral/TWI.h
+++ b/LUFA/Drivers/Peripheral/TWI.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -49,7 +49,7 @@
* Master Mode Hardware TWI driver. This module provides an easy to use driver for the hardware
* TWI present on many AVR models, for the transmission and reception of data on a TWI bus.
*/
-
+
#ifndef __TWI_H__
#define __TWI_H__
@@ -67,5 +67,6 @@
#else
#error "TWI is not available for the currently selected AVR model."
#endif
-
+
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Audio.h b/LUFA/Drivers/USB/Class/Audio.h
index a482dfdc5..b28133811 100644
--- a/LUFA/Drivers/USB/Class/Audio.h
+++ b/LUFA/Drivers/USB/Class/Audio.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -46,7 +46,7 @@
*
* \section Module Description
* Audio Class Driver module. This module contains an internal implementation of the USB Audio 1.0 Class, for Device
- * USB mode only. User applications can use this class driver instead of implementing the Audio class manually via
+ * USB mode only. User applications can use this class driver instead of implementing the Audio class manually via
* the low-level LUFA APIs.
*
* This module is designed to simplify the user code by exposing only the required interface needed to interface with
@@ -64,7 +64,7 @@
/* Includes: */
#include "../HighLevel/USBMode.h"
-
+
#if defined(NO_STREAM_CALLBACKS)
#error The NO_STREAM_CALLBACKS compile time option cannot be used in projects using the library Class drivers.
#endif
@@ -72,7 +72,8 @@
#if defined(USB_CAN_BE_DEVICE)
#include "Device/Audio.h"
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/CDC.h b/LUFA/Drivers/USB/Class/CDC.h
index a33ebb179..988edcdd7 100644
--- a/LUFA/Drivers/USB/Class/CDC.h
+++ b/LUFA/Drivers/USB/Class/CDC.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -55,7 +55,7 @@
*
* @{
*/
-
+
#ifndef _CDC_CLASS_H_
#define _CDC_CLASS_H_
@@ -73,11 +73,12 @@
#if defined(USB_CAN_BE_DEVICE)
#include "Device/CDC.h"
#endif
-
+
#if defined(USB_CAN_BE_HOST)
#include "Host/CDC.h"
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Common/Audio.h b/LUFA/Drivers/USB/Class/Common/Audio.h
index 0b023b019..5e65865a0 100644
--- a/LUFA/Drivers/USB/Class/Common/Audio.h
+++ b/LUFA/Drivers/USB/Class/Common/Audio.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -52,7 +52,7 @@
/* Includes: */
#include "../../USB.h"
-
+
#include <string.h>
/* Enable C linkage for C++ Compilers: */
@@ -72,7 +72,7 @@
*/
#define AUDIO_TOTAL_SAMPLE_RATES 1
#endif
-
+
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_LEFT_FRONT (1 << 0)
@@ -139,58 +139,58 @@
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_BASS_LOUDNESS (1 << 9)
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_UNDEFINED 0x0100
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_STREAMING 0x0101
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_VENDOR 0x01FF
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_UNDEFINED 0x0200
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_MIC 0x0201
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_DESKTOP_MIC 0x0202
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_PERSONAL_MIC 0x0203
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_OMNIDIR_MIC 0x0204
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_MIC_ARRAY 0x0205
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_PROCESSING_MIC 0x0206
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_OUT_UNDEFINED 0x0300
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_SPEAKER 0x0301
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_HEADPHONES 0x0302
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_HEAD_MOUNTED 0x0303
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_DESKTOP 0x0304
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_ROOM 0x0305
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_COMMUNICATION 0x0306
- /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
+ /** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_LOWFREQ 0x0307
/** Convenience macro to fill a 24-bit \ref USB_Audio_SampleFreq_t structure with the given sample rate as a 24-bit number.
@@ -198,7 +198,7 @@
* \param[in] freq Required audio sampling frequency in HZ
*/
#define AUDIO_SAMPLE_FREQ(freq) {((uint32_t)freq & 0x00FFFF), (((uint32_t)freq >> 16) & 0x0000FF)}
-
+
/** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint
* accepts only filled endpoint packets of audio samples.
*/
@@ -208,7 +208,7 @@
* will accept partially filled endpoint packets of audio samples.
*/
#define AUDIO_EP_ACCEPTS_SMALL_PACKETS (0 << 7)
-
+
/* Enums: */
/** Audio class specific interface description subtypes, for the Audio Control interface. */
enum Audio_CSInterface_AC_SubTypes_t
@@ -236,7 +236,7 @@
{
AUDIO_DSUBTYPE_CSEndpoint_General = 0x01, /**< Audio class specific endpoint general descriptor. */
};
-
+
/* Type Defines: */
/** \brief Audio class-specific Input Terminal Descriptor (LUFA naming conventions).
*
@@ -252,7 +252,7 @@
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_InputTerminal.
*/
-
+
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */
uint8_t AssociatedOutputTerminal; /**< ID of associated output terminal, for physically grouped terminals
@@ -260,7 +260,7 @@
*/
uint8_t TotalChannels; /**< Total number of separate audio channels within this interface (right, left, etc.) */
uint16_t ChannelConfig; /**< CHANNEL_* masks indicating what channel layout is supported by this terminal. */
-
+
uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device. */
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_Audio_Descriptor_InputTerminal_t;
@@ -291,7 +291,7 @@
*/
uint8_t bNrChannels; /**< Total number of separate audio channels within this interface (right, left, etc.) */
uint16_t wChannelConfig; /**< CHANNEL_* masks indicating what channel layout is supported by this terminal. */
-
+
uint8_t iChannelNames; /**< Index of a string descriptor describing this channel within the device. */
uint8_t iTerminal; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_Audio_StdDescriptor_InputTerminal_t;
@@ -310,14 +310,14 @@
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_OutputTerminal.
*/
-
+
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */
uint8_t AssociatedInputTerminal; /**< ID of associated input terminal, for physically grouped terminals
* such as the speaker and microphone of a phone handset.
*/
uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from. */
-
+
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_Audio_Descriptor_OutputTerminal_t;
@@ -346,7 +346,7 @@
* such as the speaker and microphone of a phone handset.
*/
uint8_t bSourceID; /**< ID value of the unit this terminal's audio is sourced from. */
-
+
uint8_t iTerminal; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_Audio_StdDescriptor_OutputTerminal_t;
@@ -367,7 +367,7 @@
uint16_t ACSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
uint16_t TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
-
+
uint8_t InCollection; /**< Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1). */
uint8_t InterfaceNumber; /**< Interface number of the associated Audio Streaming interface. */
} USB_Audio_Descriptor_Interface_AC_t;
@@ -394,11 +394,11 @@
uint16_t bcdADC; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
uint16_t wTotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
-
+
uint8_t bInCollection; /**< Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1). */
uint8_t bInterfaceNumbers; /**< Interface number of the associated Audio Streaming interface. */
} USB_Audio_StdDescriptor_Interface_AC_t;
-
+
/** \brief Audio class-specific Feature Unit Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific Feature Unit descriptor. This indicates to the host what features
@@ -413,13 +413,13 @@
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_Feature.
*/
-
+
uint8_t UnitID; /**< ID value of this feature unit - must be a unique value within the device. */
uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit. */
-
+
uint8_t ControlSize; /**< Size of each element in the ChanelControlls array. */
uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
-
+
uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_Audio_Descriptor_FeatureUnit_t;
@@ -442,16 +442,16 @@
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_Feature.
*/
-
+
uint8_t bUnitID; /**< ID value of this feature unit - must be a unique value within the device. */
uint8_t bSourceID; /**< Source ID value of the audio source input into this feature unit. */
-
+
uint8_t bControlSize; /**< Size of each element in the ChanelControlls array. */
uint8_t bmaControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
-
+
uint8_t iFeature; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_Audio_StdDescriptor_FeatureUnit_t;
-
+
/** \brief Audio class-specific Streaming Audio Interface Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific streaming interface descriptor. This indicates to the host
@@ -465,9 +465,9 @@
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
-
+
uint8_t TerminalLink; /**< ID value of the output terminal this descriptor is describing. */
-
+
uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output. */
uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification. */
} USB_Audio_Descriptor_Interface_AS_t;
@@ -490,13 +490,13 @@
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
-
+
uint8_t bTerminalLink; /**< ID value of the output terminal this descriptor is describing. */
-
+
uint8_t bDelay; /**< Delay in frames resulting from the complete sample processing from input to output. */
uint16_t wFormatTag; /**< Format of the audio stream, see Audio Device Formats specification. */
} USB_Audio_StdDescriptor_Interface_AS_t;
-
+
/** \brief 24-Bit Audio Frequency Structure.
*
* Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype,
@@ -522,14 +522,14 @@
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_FormatType.
*/
-
+
uint8_t FormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
uint8_t Channels; /**< Total number of discrete channels in the stream. */
-
+
uint8_t SubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */
uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream. */
- uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device. */
+ uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device. */
USB_Audio_SampleFreq_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES]; /**< Sample frequencies supported by the device (must be 24-bit). */
} USB_Audio_Descriptor_Format_t;
@@ -555,17 +555,17 @@
uint8_t bFormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
uint8_t bNrChannels; /**< Total number of discrete channels in the stream. */
-
+
uint8_t bSubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */
uint8_t bBitResolution; /**< Bits of resolution of each channel's samples in the stream. */
- uint8_t bSampleFrequencyType; /**< Total number of sample frequencies supported by the device. */
+ uint8_t bSampleFrequencyType; /**< Total number of sample frequencies supported by the device. */
uint8_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES * 3]; /**< Sample frequencies supported by the device (must be 24-bit). */
} USB_Audio_StdDescriptor_Format_t;
-
+
/** \brief Audio class-specific Streaming Endpoint Descriptor (LUFA naming conventions).
*
- * Type define for an Audio class-specific endpoint descriptor. This contains a regular endpoint
+ * Type define for an Audio class-specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class-specific extensions. See the USB Audio specification for more details.
*
* \see \ref USB_Audio_StdDescriptor_StreamEndpoint_Std_t for the version of this type with standard element names.
@@ -580,7 +580,7 @@
/** \brief Audio class-specific Streaming Endpoint Descriptor (USB-IF naming conventions).
*
- * Type define for an Audio class-specific endpoint descriptor. This contains a regular endpoint
+ * Type define for an Audio class-specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class-specific extensions. See the USB Audio specification for more details.
*
* \see \ref USB_Audio_Descriptor_StreamEndpoint_Std_t for the version of this type with non-standard LUFA specific
@@ -592,10 +592,10 @@
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a
* value given by the specific class.
*/
- uint8_t bEndpointAddress; /**< Logical address of the endpoint within the device for the current
+ uint8_t bEndpointAddress; /**< Logical address of the endpoint within the device for the current
* configuration, including direction mask.
*/
- uint8_t bmAttributes; /**< Endpoint attributes, comprised of a mask of the endpoint type (EP_TYPE_*)
+ uint8_t bmAttributes; /**< Endpoint attributes, comprised of a mask of the endpoint type (EP_TYPE_*)
* and attributes (ENDPOINT_ATTR_*) masks.
*/
uint16_t wMaxPacketSize; /**< Size of the endpoint bank, in bytes. This indicates the maximum packet size
@@ -604,7 +604,7 @@
uint8_t bInterval; /**< Polling interval in milliseconds for the endpoint if it is an INTERRUPT or
* ISOCHRONOUS type.
*/
-
+
uint8_t bRefresh; /**< Always set to zero for Audio class devices. */
uint8_t bSynchAddress; /**< Endpoint address to send synchronization information to, if needed (zero otherwise). */
} USB_Audio_StdDescriptor_StreamEndpoint_Std_t;
@@ -623,7 +623,7 @@
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSEndpoint_SubTypes_t enum.
*/
-
+
uint8_t Attributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */
uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification. */
@@ -649,18 +649,19 @@
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSEndpoint_SubTypes_t enum.
*/
-
+
uint8_t bmAttributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */
uint8_t bLockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification. */
uint16_t wLockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry. */
} USB_Audio_StdDescriptor_StreamEndpoint_Spc_t;
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Common/CDC.h b/LUFA/Drivers/USB/Class/Common/CDC.h
index ac6f9daab..6d2c519b8 100644
--- a/LUFA/Drivers/USB/Class/Common/CDC.h
+++ b/LUFA/Drivers/USB/Class/Common/CDC.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -46,7 +46,7 @@
*
* @{
*/
-
+
#ifndef _CDC_CLASS_COMMON_H_
#define _CDC_CLASS_COMMON_H_
@@ -64,7 +64,7 @@
#if !defined(__INCLUDE_FROM_CDC_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/CDC.h instead.
#endif
-
+
/* Macros: */
/** Mask for the DTR handshake line for use with the \ref CDC_REQ_SetControlLineState class-specific request
* from the host, to indicate that the DTR line state should be high.
@@ -75,7 +75,7 @@
* from the host, to indicate that the RTS line state should be high.
*/
#define CDC_CONTROL_LINE_OUT_RTS (1 << 1)
-
+
/** Mask for the DCD handshake line for use with the \ref CDC_NOTIF_SerialState class-specific notification
* from the device to the host, to indicate that the DCD line state is currently high.
*/
@@ -110,7 +110,7 @@
* to indicate that a data overrun error has occurred on the virtual serial port.
*/
#define CDC_CONTROL_LINE_IN_OVERRUNERROR (1 << 6)
-
+
/** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a
* uniform structure but variable sized data payloads, thus cannot be represented accurately by
* a single typedef struct. A macro is used instead so that functional descriptors can be created
@@ -125,19 +125,19 @@
uint8_t SubType; \
uint8_t Data[DataSize]; \
}
-
+
/* Enums: */
/** Enum for the CDC class specific control requests that can be issued by the USB bus host. */
enum CDC_ClassRequests_t
- {
+ {
CDC_REQ_SendEncapsulatedCommand = 0x00, /**< CDC class-specific request to send an encapsulated command to the device. */
- CDC_REQ_GetEncapsulatedResponse = 0x01, /**< CDC class-specific request to retrieve an encapsulated command response from the device. */
+ CDC_REQ_GetEncapsulatedResponse = 0x01, /**< CDC class-specific request to retrieve an encapsulated command response from the device. */
CDC_REQ_SetLineEncoding = 0x20, /**< CDC class-specific request to set the current virtual serial port configuration settings. */
CDC_REQ_GetLineEncoding = 0x21, /**< CDC class-specific request to get the current virtual serial port configuration settings. */
CDC_REQ_SetControlLineState = 0x22, /**< CDC class-specific request to set the current virtual serial port handshake line states. */
CDC_REQ_SendBreak = 0x23, /**< CDC class-specific request to send a break to the receiver via the carrier channel. */
};
-
+
/** Enum for the CDC class specific notification requests that can be issued by a CDC device to a host. */
enum CDC_ClassNotifications_t
{
@@ -147,7 +147,7 @@
* endpoint.
*/
};
-
+
/** Enum for the CDC class specific interface descriptor subtypes. */
enum CDC_DescriptorSubtypes_t
{
@@ -169,7 +169,7 @@
CDC_DSUBTYPE_CSInterface_Ethernet = 0x0F, /**< CDC class-specific Ethernet functional descriptor. */
CDC_DSUBTYPE_CSInterface_ATM = 0x10, /**< CDC class-specific Asynchronous Transfer Mode functional descriptor. */
};
-
+
/** Enum for the possible line encoding formats of a virtual serial port. */
enum CDC_LineEncodingFormats_t
{
@@ -177,7 +177,7 @@
CDC_LINEENCODING_OneAndAHalfStopBits = 1, /**< Each frame contains one and a half stop bits. */
CDC_LINEENCODING_TwoStopBits = 2, /**< Each frame contains two stop bits. */
};
-
+
/** Enum for the possible line encoding parity settings of a virtual serial port. */
enum CDC_LineEncodingParity_t
{
@@ -270,7 +270,7 @@
* to the CDC ACM specification.
*/
} USB_CDC_StdDescriptor_FunctionalACM_t;
-
+
/** \brief CDC class-specific Functional Union Descriptor (LUFA naming conventions).
*
* Type define for a CDC class-specific functional Union descriptor. This indicates to the host that specific
@@ -287,7 +287,7 @@
uint8_t MasterInterfaceNumber; /**< Interface number of the CDC Control interface. */
uint8_t SlaveInterfaceNumber; /**< Interface number of the CDC Data interface. */
} USB_CDC_Descriptor_FunctionalUnion_t;
-
+
/** \brief CDC class-specific Functional Union Descriptor (USB-IF naming conventions).
*
* Type define for a CDC class-specific functional Union descriptor. This indicates to the host that specific
@@ -313,7 +313,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Common/HID.h b/LUFA/Drivers/USB/Class/Common/HID.h
index 822a8b502..3658c8eba 100644
--- a/LUFA/Drivers/USB/Class/Common/HID.h
+++ b/LUFA/Drivers/USB/Class/Common/HID.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -46,7 +46,7 @@
*
* @{
*/
-
+
#ifndef _HID_CLASS_COMMON_H_
#define _HID_CLASS_COMMON_H_
@@ -59,8 +59,8 @@
#if !defined(__INCLUDE_FROM_HID_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead.
#endif
-
- /* Macros: */
+
+ /* Macros: */
/** Constant for a keyboard report modifier byte, indicating that the keyboard's left control key is currently pressed. */
#define HID_KEYBOARD_MODIFER_LEFTCTRL (1 << 0)
@@ -84,10 +84,10 @@
/** Constant for a keyboard report modifier byte, indicating that the keyboard's right GUI key is currently pressed. */
#define HID_KEYBOARD_MODIFER_RIGHTGUI (1 << 7)
-
+
/** Constant for a keyboard output report LED byte, indicating that the host's NUM LOCK mode is currently set. */
#define HID_KEYBOARD_LED_NUMLOCK (1 << 0)
-
+
/** Constant for a keyboard output report LED byte, indicating that the host's CAPS LOCK mode is currently set. */
#define HID_KEYBOARD_LED_CAPSLOCK (1 << 1)
@@ -108,14 +108,14 @@
HID_REQ_GetProtocol = 0x03, /**< HID class-specific Request to get the current HID report protocol mode. */
HID_REQ_SetProtocol = 0x0B, /**< HID class-specific Request to set the current HID report protocol mode. */
};
-
+
/** Enum for the HID class specific descriptor types. */
enum HID_DescriptorTypes_t
{
HID_DTYPE_HID = 0x21, /**< Descriptor header type value, to indicate a HID class HID descriptor. */
HID_DTYPE_Report = 0x22, /**< Descriptor header type value, to indicate a HID class HID report descriptor. */
};
-
+
/** Enum for the HID class boot protocols that may be supported by HID devices. */
enum HID_BootProtocols_t
{
@@ -132,7 +132,7 @@
* Specification).
*/
};
-
+
/** Enum for the different types of HID reports. */
enum HID_ReportItemTypes_t
{
@@ -151,10 +151,10 @@
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
-
+
uint16_t HIDSpec; /**< BCD encoded version that the HID descriptor and device complies to. */
uint8_t CountryCode; /**< Country code of the localized device, or zero if universal. */
-
+
uint8_t TotalReportDescriptors; /**< Total number of HID report descriptors for the interface. */
uint8_t HIDReportType; /**< Type of HID report, set to \ref HID_DTYPE_Report. */
@@ -175,10 +175,10 @@
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
-
+
uint16_t bcdHID; /**< BCD encoded version that the HID descriptor and device complies to. */
uint8_t bCountryCode; /**< Country code of the localized device, or zero if universal. */
-
+
uint8_t bNumDescriptors; /**< Total number of HID report descriptors for the interface. */
uint8_t bDescriptorType2; /**< Type of HID report, set to \ref HID_DTYPE_Report. */
@@ -195,7 +195,7 @@
int8_t X; /**< Current delta X movement of the mouse. */
int8_t Y; /**< Current delta Y movement on the mouse. */
} USB_MouseReport_Data_t;
-
+
/** \brief Standard HID Boot Protocol Keyboard Report.
*
* Type define for a standard Boot Protocol Keyboard report
@@ -215,3 +215,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Common/MIDI.h b/LUFA/Drivers/USB/Class/Common/MIDI.h
index b3a40385c..ef3f8fcef 100644
--- a/LUFA/Drivers/USB/Class/Common/MIDI.h
+++ b/LUFA/Drivers/USB/Class/Common/MIDI.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -68,7 +68,7 @@
#if !defined(__INCLUDE_FROM_MIDI_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/MIDI.h instead.
#endif
-
+
/* Macros: */
/** MIDI command for a note on (activation) event. */
#define MIDI_COMMAND_NOTE_ON 0x90
@@ -78,21 +78,21 @@
/** Standard key press velocity value used for all note events. */
#define MIDI_STANDARD_VELOCITY 64
-
+
/** Convenience macro. MIDI channels are numbered from 1-10 (natural numbers) however the logical channel
* addresses are zero-indexed. This converts a natural MIDI channel number into the logical channel address.
*
* \param[in] channel MIDI channel number to address.
*/
#define MIDI_CHANNEL(channel) ((channel) - 1)
-
+
/* Enums: */
enum MIDI_JackTypes_t
{
MIDI_JACKTYPE_Embedded = 0x01, /**< MIDI class descriptor jack type value for an embedded (logical) MIDI input or output jack. */
MIDI_JACKTYPE_External = 0x02, /**< MIDI class descriptor jack type value for an external (physical) MIDI input or output jack. */
};
-
+
/* Type Defines: */
/** \brief MIDI class-specific Streaming Interface Descriptor (LUFA naming conventions).
*
@@ -106,13 +106,13 @@
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
-
+
uint16_t AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class
* specification version.
*/
uint16_t TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
} USB_MIDI_Descriptor_AudioInterface_AS_t;
-
+
/** \brief MIDI class-specific Streaming Interface Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific MIDI streaming interface descriptor. This indicates to the host
@@ -130,7 +130,7 @@
*/
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
-
+
uint16_t bcdMSC; /**< Binary coded decimal value, indicating the supported MIDI Class specification version. */
uint16_t wTotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
} USB_MIDI_StdDescriptor_AudioInterface_AS_t;
@@ -149,7 +149,7 @@
uint8_t JackType; /**< Type of jack, one of the JACKTYPE_* mask values. */
uint8_t JackID; /**< ID value of this jack - must be a unique value within the device. */
-
+
uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_MIDI_Descriptor_InputJack_t;
@@ -172,7 +172,7 @@
uint8_t bJackType; /**< Type of jack, one of the JACKTYPE_* mask values. */
uint8_t bJackID; /**< ID value of this jack - must be a unique value within the device. */
-
+
uint8_t iJack; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_MIDI_StdDescriptor_InputJack_t;
@@ -190,14 +190,14 @@
uint8_t JackType; /**< Type of jack, one of the JACKTYPE_* mask values. */
uint8_t JackID; /**< ID value of this jack - must be a unique value within the device. */
-
+
uint8_t NumberOfPins; /**< Number of output channels within the jack, either physical or logical. */
uint8_t SourceJackID[1]; /**< ID of each output pin's source data jack. */
uint8_t SourcePinID[1]; /**< Pin number in the input jack of each output pin's source data. */
-
+
uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_MIDI_Descriptor_OutputJack_t;
-
+
/** \brief MIDI class-specific Output Jack Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific MIDI OUT jack. This gives information to the host on a MIDI output, either
@@ -217,11 +217,11 @@
uint8_t bJackType; /**< Type of jack, one of the JACKTYPE_* mask values. */
uint8_t bJackID; /**< ID value of this jack - must be a unique value within the device. */
-
+
uint8_t bNrInputPins; /**< Number of output channels within the jack, either physical or logical. */
uint8_t baSourceID[1]; /**< ID of each output pin's source data jack. */
uint8_t baSourcePin[1]; /**< Pin number in the input jack of each output pin's source data. */
-
+
uint8_t iJack; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_MIDI_StdDescriptor_OutputJack_t;
@@ -272,17 +272,18 @@
{
unsigned char Command : 4; /**< Upper nibble of the MIDI command being sent or received in the event packet. */
unsigned char CableNumber : 4; /**< Virtual cable number of the event being sent or received in the given MIDI interface. */
-
+
uint8_t Data1; /**< First byte of data in the MIDI event. */
uint8_t Data2; /**< Second byte of data in the MIDI event. */
- uint8_t Data3; /**< Third byte of data in the MIDI event. */
+ uint8_t Data3; /**< Third byte of data in the MIDI event. */
} MIDI_EventPacket_t;
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Common/MassStorage.h b/LUFA/Drivers/USB/Class/Common/MassStorage.h
index ec6c39360..dea847c13 100644
--- a/LUFA/Drivers/USB/Class/Common/MassStorage.h
+++ b/LUFA/Drivers/USB/Class/Common/MassStorage.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -64,14 +64,14 @@
#if !defined(__INCLUDE_FROM_MS_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/MassStorage.h instead.
#endif
-
+
/* Macros: */
/** Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol. */
#define MS_CBW_SIGNATURE 0x43425355UL
/** Magic signature for a Command Status Wrapper used in the Mass Storage Bulk-Only transport protocol. */
#define MS_CSW_SIGNATURE 0x53425355UL
-
+
/** Mask for a Command Block Wrapper's flags attribute to specify a command with data sent from host-to-device. */
#define MS_COMMAND_DIR_DATA_OUT (0 << 7)
@@ -203,7 +203,7 @@
/** SCSI Additional Sense Qualifier Code to indicate that an operation is currently in progress. */
#define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07
-
+
/* Enums: */
/** Enum for the Mass Storage class specific control requests that can be issued by the USB bus host. */
enum MS_ClassRequests_t
@@ -215,7 +215,7 @@
* ready for the next command.
*/
};
-
+
/** Enum for the possible command status wrapper return status codes. */
enum MS_CommandStatusCodes_t
{
@@ -240,7 +240,7 @@
uint8_t SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array. */
uint8_t SCSICommandData[16]; /**< Issued SCSI command in the Command Block. */
} MS_CommandBlockWrapper_t;
-
+
/** \brief Mass Storage Class Command Status Wrapper.
*
* Type define for a Command Status Wrapper, used in the Mass Storage Bulk-Only Transport protocol.
@@ -252,9 +252,9 @@
uint32_t DataTransferResidue; /**< Number of bytes of data not processed in the SCSI command. */
uint8_t Status; /**< Status code of the issued command - a value from the \ref MS_CommandStatusCodes_t enum. */
} MS_CommandStatusWrapper_t;
-
+
/** \brief Mass Storage Class SCSI Sense Structure
- *
+ *
* Type define for a SCSI Sense structure. Structures of this type are filled out by the
* device via the \ref MS_Host_RequestSense() function, indicating the current sense data of the
* device (giving explicit error codes for the last issued command). For details of the
@@ -265,13 +265,13 @@
uint8_t ResponseCode;
uint8_t SegmentNumber;
-
+
unsigned char SenseKey : 4;
unsigned char Reserved : 1;
unsigned char ILI : 1;
unsigned char EOM : 1;
unsigned char FileMark : 1;
-
+
uint8_t Information[4];
uint8_t AdditionalLength;
uint8_t CmdSpecificInformation[4];
@@ -293,12 +293,12 @@
{
unsigned char DeviceType : 5;
unsigned char PeripheralQualifier : 3;
-
+
unsigned char Reserved : 7;
unsigned char Removable : 1;
-
+
uint8_t Version;
-
+
unsigned char ResponseDataFormat : 4;
unsigned char Reserved2 : 1;
unsigned char NormACA : 1;
@@ -316,17 +316,18 @@
unsigned char WideBus16Bit : 1;
unsigned char WideBus32Bit : 1;
unsigned char RelAddr : 1;
-
+
uint8_t VendorID[8];
uint8_t ProductID[16];
uint8_t RevisionID[4];
} SCSI_Inquiry_Response_t;
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Common/Printer.h b/LUFA/Drivers/USB/Class/Common/Printer.h
index 7e89b41be..97e94a3bc 100644
--- a/LUFA/Drivers/USB/Class/Common/Printer.h
+++ b/LUFA/Drivers/USB/Class/Common/Printer.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -64,7 +64,7 @@
#if !defined(__INCLUDE_FROM_PRINTER_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/Printer.h instead.
#endif
-
+
/* Macros: */
/** Port status mask for a printer device, indicating that an error has *not* occurred. */
#define PRNT_PORTSTATUS_NOTERROR (1 << 3)
@@ -74,12 +74,13 @@
/** Port status mask for a printer device, indicating that the device is currently out of paper. */
#define PRNT_PORTSTATUS_PAPEREMPTY (1 << 5)
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Common/RNDIS.h b/LUFA/Drivers/USB/Class/Common/RNDIS.h
index b9d50f93c..6b5234b13 100644
--- a/LUFA/Drivers/USB/Class/Common/RNDIS.h
+++ b/LUFA/Drivers/USB/Class/Common/RNDIS.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -57,9 +57,9 @@
#include "../../USB.h"
#include "RNDISConstants.h"
#include "CDC.h"
-
+
#include <string.h>
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -69,20 +69,20 @@
#if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.
#endif
-
+
/* Macros: */
/** Implemented RNDIS Version Major. */
#define REMOTE_NDIS_VERSION_MAJOR 0x01
/** Implemented RNDIS Version Minor. */
#define REMOTE_NDIS_VERSION_MINOR 0x00
-
+
/** Maximum size in bytes of a RNDIS control message which can be sent or received. */
#define RNDIS_MESSAGE_BUFFER_SIZE 128
/** Maximum size in bytes of an Ethernet frame according to the Ethernet standard. */
#define ETHERNET_FRAME_SIZE_MAX 1500
-
+
/* Enums: */
/** Enum for the RNDIS class specific control requests that can be issued by the USB bus host. */
enum RNDIS_ClassRequests_t
@@ -90,7 +90,7 @@
RNDIS_REQ_SendEncapsulatedCommand = 0x00, /**< RNDIS request to issue a host-to-device NDIS command. */
RNDIS_REQ_GetEncapsulatedResponse = 0x01, /**< RNDIS request to issue a device-to-host NDIS response. */
};
-
+
/** Enum for the possible NDIS adapter states. */
enum RNDIS_States_t
{
@@ -114,7 +114,7 @@
NDIS_HardwareStatus_Closing, /**< Hardware currently closing. */
NDIS_HardwareStatus_NotReady /**< Hardware not ready to accept commands from the host. */
};
-
+
/* Type Defines: */
/** \brief MAC Address Structure.
*
@@ -174,12 +174,12 @@
uint32_t MessageType;
uint32_t MessageLength;
uint32_t RequestId;
-
+
uint32_t MajorVersion;
uint32_t MinorVersion;
uint32_t MaxTransferSize;
} RNDIS_Initialize_Message_t;
-
+
/** \brief RNDIS Initialize Complete Message Structure.
*
* Type define for a RNDIS Initialize Complete response message.
@@ -190,7 +190,7 @@
uint32_t MessageLength;
uint32_t RequestId;
uint32_t Status;
-
+
uint32_t MajorVersion;
uint32_t MinorVersion;
uint32_t DeviceFlags;
@@ -201,7 +201,7 @@
uint32_t AFListOffset;
uint32_t AFListSize;
} RNDIS_Initialize_Complete_t;
-
+
/** \brief RNDIS Keep Alive Message Structure.
*
* Type define for a RNDIS Keep Alive command message.
@@ -237,7 +237,7 @@
uint32_t AddressingReset;
} RNDIS_Reset_Complete_t;
-
+
/** \brief RNDIS OID Property Set Message Structure.
*
* Type define for a RNDIS OID Property Set command message.
@@ -247,7 +247,7 @@
uint32_t MessageType;
uint32_t MessageLength;
uint32_t RequestId;
-
+
uint32_t Oid;
uint32_t InformationBufferLength;
uint32_t InformationBufferOffset;
@@ -265,7 +265,7 @@
uint32_t RequestId;
uint32_t Status;
} RNDIS_Set_Complete_t;
-
+
/** \brief RNDIS OID Property Query Message Structure.
*
* Type define for a RNDIS OID Property Query command message.
@@ -275,13 +275,13 @@
uint32_t MessageType;
uint32_t MessageLength;
uint32_t RequestId;
-
+
uint32_t Oid;
uint32_t InformationBufferLength;
uint32_t InformationBufferOffset;
uint32_t DeviceVcHandle;
} RNDIS_Query_Message_t;
-
+
/** \brief RNDIS OID Property Query Complete Message Structure.
*
* Type define for a RNDIS OID Property Query Complete response message.
@@ -292,16 +292,17 @@
uint32_t MessageLength;
uint32_t RequestId;
uint32_t Status;
-
+
uint32_t InformationBufferLength;
uint32_t InformationBufferOffset;
} RNDIS_Query_Complete_t;
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Common/RNDISConstants.h b/LUFA/Drivers/USB/Class/Common/RNDISConstants.h
index 7cd80aba7..8edbbd701 100644
--- a/LUFA/Drivers/USB/Class/Common/RNDISConstants.h
+++ b/LUFA/Drivers/USB/Class/Common/RNDISConstants.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -42,7 +42,7 @@
* RNDIS specification related constants. For more information on these
* constants, please refer to the Microsoft RNDIS specification.
*/
-
+
#ifndef _RNDIS_CONSTANTS_DEVICE_H_
#define _RNDIS_CONSTANTS_DEVICE_H_
@@ -61,19 +61,19 @@
#define REMOTE_NDIS_SET_CMPLT 0x80000005UL
#define REMOTE_NDIS_RESET_CMPLT 0x80000006UL
#define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008UL
-
+
#define REMOTE_NDIS_STATUS_SUCCESS 0x00000000UL
#define REMOTE_NDIS_STATUS_FAILURE 0xC0000001UL
#define REMOTE_NDIS_STATUS_INVALID_DATA 0xC0010015UL
#define REMOTE_NDIS_STATUS_NOT_SUPPORTED 0xC00000BBUL
#define REMOTE_NDIS_STATUS_MEDIA_CONNECT 0x4001000BUL
#define REMOTE_NDIS_STATUS_MEDIA_DISCONNECT 0x4001000CUL
-
+
#define REMOTE_NDIS_MEDIA_STATE_CONNECTED 0x00000000UL
#define REMOTE_NDIS_MEDIA_STATE_DISCONNECTED 0x00000001UL
-
+
#define REMOTE_NDIS_MEDIUM_802_3 0x00000000UL
-
+
#define REMOTE_NDIS_DF_CONNECTIONLESS 0x00000001UL
#define REMOTE_NDIS_DF_CONNECTION_ORIENTED 0x00000002UL
@@ -88,8 +88,8 @@
#define REMOTE_NDIS_PACKET_GROUP 0x00001000UL
#define REMOTE_NDIS_PACKET_ALL_FUNCTIONAL 0x00002000UL
#define REMOTE_NDIS_PACKET_FUNCTIONAL 0x00004000UL
- #define REMOTE_NDIS_PACKET_MAC_FRAME 0x00008000UL
-
+ #define REMOTE_NDIS_PACKET_MAC_FRAME 0x00008000UL
+
#define OID_GEN_SUPPORTED_LIST 0x00010101UL
#define OID_GEN_HARDWARE_STATUS 0x00010102UL
#define OID_GEN_MEDIA_SUPPORTED 0x00010103UL
@@ -119,3 +119,4 @@
#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103UL
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Common/StillImage.h b/LUFA/Drivers/USB/Class/Common/StillImage.h
index 01cffbddb..2ba4227ac 100644
--- a/LUFA/Drivers/USB/Class/Common/StillImage.h
+++ b/LUFA/Drivers/USB/Class/Common/StillImage.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -54,7 +54,7 @@
#include "../../USB.h"
#include <string.h>
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -64,7 +64,7 @@
#if !defined(__INCLUDE_FROM_SI_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/StillImage.h instead.
#endif
-
+
/* Macros: */
/** Length in bytes of a given Unicode string's character length.
*
@@ -73,7 +73,7 @@
* \return Number of bytes of the given unicode string.
*/
#define UNICODE_STRING_LENGTH(Chars) ((Chars) << 1)
-
+
/** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
* a command container.
*
@@ -97,8 +97,8 @@
SI_PIMA_CONTAINER_DataBlock = 2, /**< Data Block container type. */
SI_PIMA_CONTAINER_ResponseBlock = 3, /**< Response container type. */
SI_PIMA_CONTAINER_EventBlock = 4, /**< Event Block container type. */
- };
-
+ };
+
/* Enums: */
/** Enums for the possible status codes of a returned Response Block from an attached PIMA compliant Still Image device. */
enum SI_PIMA_ResponseCodes_t
@@ -118,7 +118,7 @@
* parameters are not supported by the device.
*/
};
-
+
/* Type Defines: */
/** \brief PIMA Still Image Device Command/Response Container.
*
@@ -133,12 +133,13 @@
uint32_t TransactionID; /**< Unique container ID to link blocks together. */
uint32_t Params[3]; /**< Block parameters to be issued along with the block code (command blocks only). */
} SI_PIMA_Container_t;
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Device/Audio.c b/LUFA/Drivers/USB/Class/Device/Audio.c
index 302853335..106a968dc 100644
--- a/LUFA/Drivers/USB/Class/Device/Audio.c
+++ b/LUFA/Drivers/USB/Class/Device/Audio.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -39,7 +39,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
{
if (!(Endpoint_IsSETUPReceived()))
return;
-
+
if (USB_ControlRequest.wIndex != AudioInterfaceInfo->Config.StreamingInterfaceNumber)
return;
@@ -84,14 +84,14 @@ bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioIn
{
continue;
}
-
+
if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size, ENDPOINT_BANK_DOUBLE)))
{
return false;
}
}
-
+
return true;
}
-#endif \ No newline at end of file
+#endif
diff --git a/LUFA/Drivers/USB/Class/Device/Audio.h b/LUFA/Drivers/USB/Class/Device/Audio.h
index 5491806f0..6520a3379 100644
--- a/LUFA/Drivers/USB/Class/Device/Audio.h
+++ b/LUFA/Drivers/USB/Class/Device/Audio.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -56,7 +56,7 @@
/* Includes: */
#include "../../USB.h"
#include "../Common/Audio.h"
-
+
#include <string.h>
/* Enable C linkage for C++ Compilers: */
@@ -97,7 +97,7 @@
*/
uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing Audio Streaming data endpoint, if available
* (zero if unused).
- */
+ */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
*/
@@ -108,9 +108,9 @@
*/
} State; /**< State data for the USB class interface within the device. All elements in this section
* are reset to their defaults when the interface is enumerated.
- */
+ */
} USB_ClassInfo_Audio_Device_t;
-
+
/* Function Prototypes: */
/** Configures the endpoints of a given Audio interface, ready for use. This should be linked to the library
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the
@@ -132,8 +132,8 @@
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
*/
void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
- /* Inline Functions: */
+
+ /* Inline Functions: */
/** General management task for a given Audio class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
*
@@ -162,8 +162,8 @@
{
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))
return false;
-
- Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataOUTEndpointNumber);
+
+ Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataOUTEndpointNumber);
return Endpoint_IsOUTReceived();
}
@@ -183,7 +183,7 @@
{
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))
return false;
-
+
Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataINEndpointNumber);
return Endpoint_IsINReady();
}
@@ -202,14 +202,14 @@
static inline int8_t Audio_Device_ReadSample8(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
{
int8_t Sample;
-
+
(void)AudioInterfaceInfo;
Sample = Endpoint_Read_Byte();
if (!(Endpoint_BytesInEndpoint()))
Endpoint_ClearOUT();
-
+
return Sample;
}
@@ -231,7 +231,7 @@
(void)AudioInterfaceInfo;
Sample = (int16_t)Endpoint_Read_Word_LE();
-
+
if (!(Endpoint_BytesInEndpoint()))
Endpoint_ClearOUT();
@@ -256,7 +256,7 @@
(void)AudioInterfaceInfo;
Sample = (((uint32_t)Endpoint_Read_Byte() << 16) | Endpoint_Read_Word_LE());
-
+
if (!(Endpoint_BytesInEndpoint()))
Endpoint_ClearOUT();
@@ -325,7 +325,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c
index bb41a125a..f95496ebd 100644
--- a/LUFA/Drivers/USB/Class/Device/CDC.c
+++ b/LUFA/Drivers/USB/Class/Device/CDC.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -45,7 +45,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
{
if (!(Endpoint_IsSETUPReceived()))
return;
-
+
if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber)
return;
@@ -58,7 +58,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
Endpoint_Write_Control_Stream_LE(&CDCInterfaceInfo->State.LineEncoding, sizeof(CDCInterfaceInfo->State.LineEncoding));
Endpoint_ClearOUT();
}
-
+
break;
case CDC_REQ_SetLineEncoding:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
@@ -69,11 +69,11 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo);
}
-
+
break;
case CDC_REQ_SetControlLineState:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
- {
+ {
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
@@ -81,11 +81,11 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo);
}
-
+
break;
case CDC_REQ_SendBreak:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
- {
+ {
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
@@ -132,14 +132,14 @@ bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_Device_t* const CDCInterfac
{
continue;
}
-
+
if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
{
return false;
}
}
-
+
return true;
}
@@ -147,7 +147,7 @@ void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
{
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return;
-
+
CDC_Device_Flush(CDCInterfaceInfo);
}
@@ -157,7 +157,7 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo
{
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return ENDPOINT_RWSTREAM_DeviceDisconnected;
-
+
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
return Endpoint_Write_Stream_LE(Data, Length, NO_STREAM_CALLBACK);
}
@@ -195,11 +195,11 @@ uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
if (!(Endpoint_BytesInEndpoint()))
return ENDPOINT_READYWAIT_NoError;
-
+
bool BankFull = !(Endpoint_IsReadWriteAllowed());
-
+
Endpoint_ClearIN();
-
+
if (BankFull)
{
if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)
@@ -207,7 +207,7 @@ uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
Endpoint_ClearIN();
}
-
+
return ENDPOINT_READYWAIT_NoError;
}
@@ -244,16 +244,16 @@ int16_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInf
int16_t ReceivedByte = -1;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);
-
+
if (Endpoint_IsOUTReceived())
{
if (Endpoint_BytesInEndpoint())
ReceivedByte = Endpoint_Read_Byte();
-
+
if (!(Endpoint_BytesInEndpoint()))
Endpoint_ClearOUT();
}
-
+
return ReceivedByte;
}
@@ -263,7 +263,7 @@ void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDC
return;
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.NotificationEndpointNumber);
-
+
USB_Request_Header_t Notification = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
@@ -313,17 +313,18 @@ static int CDC_Device_getchar(FILE* Stream)
static int CDC_Device_getchar_Blocking(FILE* Stream)
{
int16_t ReceivedByte;
-
+
while ((ReceivedByte = CDC_Device_ReceiveByte((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream))) < 0)
{
if (USB_DeviceState == DEVICE_STATE_Unattached)
return _FDEV_EOF;
-
+
CDC_Device_USBTask((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream));
- USB_USBTask();
+ USB_USBTask();
}
return ReceivedByte;
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.h b/LUFA/Drivers/USB/Class/Device/CDC.h
index b5896f34d..956ff28de 100644
--- a/LUFA/Drivers/USB/Class/Device/CDC.h
+++ b/LUFA/Drivers/USB/Class/Device/CDC.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -50,7 +50,7 @@
* \note There are several major drawbacks to the CDC-ACM standard USB class, however
* it is very standardized and thus usually available as a built-in driver on
* most platforms, and so is a better choice than a proprietary serial class.
- *
+ *
* One major issue with CDC-ACM is that it requires two Interface descriptors,
* which will upset most hosts when part of a multi-function "Composite" USB
* device, as each interface will be loaded into a separate driver instance. To
@@ -66,7 +66,7 @@
*
* @{
*/
-
+
#ifndef _CDC_CLASS_DEVICE_H_
#define _CDC_CLASS_DEVICE_H_
@@ -86,7 +86,7 @@
#if !defined(__INCLUDE_FROM_CDC_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/CDC.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** \brief CDC Class Device Mode Configuration and State Structure.
@@ -140,13 +140,13 @@
uint8_t DataBits; /**< Bits of data per character of the virtual serial port. */
} LineEncoding; /** Line encoding used in the virtual serial port, for the device's information. This is generally
* only used if the virtual serial port data is to be reconstructed on a physical UART.
- */
+ */
} State; /**< State data for the USB class interface within the device. All elements in this section
* are reset to their defaults when the interface is enumerated.
*/
} USB_ClassInfo_CDC_Device_t;
-
- /* Function Prototypes: */
+
+ /* Function Prototypes: */
/** Configures the endpoints of a given CDC interface, ready for use. This should be linked to the library
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing
* the given CDC interface is selected.
@@ -183,7 +183,7 @@
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
*/
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** CDC class driver event for a control line state change on a CDC interface. This event fires each time the host requests a
* control line state change (containing the virtual serial control line states, such as DTR) and may be hooked in the
* user program by declaring a handler function with the same name and parameters listed here. The new control line states
@@ -205,7 +205,7 @@
/** 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. Bytes will be queued for transmission to the host until either the endpoint bank becomes full, or the
- * \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
+ * \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
* packed into a single endpoint packet, increasing data throughput.
*
* \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or
@@ -220,10 +220,10 @@
uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
const char* const Data,
const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
-
+
/** 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. Bytes will be queued for transmission to the host until either the endpoint bank becomes full, or the
- * \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
+ * \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
* packed into a single endpoint packet, increasing data throughput.
*
* \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or
@@ -236,7 +236,7 @@
*/
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. This indicates the number
* of bytes in the OUT endpoint bank only, and thus the number of calls to \ref CDC_Device_ReceiveByte() which are guaranteed to
* succeed immediately. If multiple bytes are to be received, they should be buffered by the user application, as the endpoint
@@ -250,7 +250,7 @@
* \return Total number of buffered bytes received from the host.
*/
uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Reads a byte of data from the host. If no data is waiting to be read of if a USB host is not connected, the function
* returns a negative value. The \ref CDC_Device_BytesReceived() function may be queried in advance to determine how many
* bytes are currently buffered in the CDC interface's data receive endpoint bank, and thus how many repeated calls to this
@@ -264,7 +264,7 @@
* \return Next received byte from the host, or a negative value if no data received.
*/
int16_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.
*
* \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or
@@ -275,10 +275,10 @@
* \return A value from the \ref Endpoint_WaitUntilReady_ErrorCodes_t enum.
*/
uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Sends a Serial Control Line State Change notification to the host. This should be called when the virtual serial
* control lines (DCD, DSR, etc.) have changed states, or to give BREAK notifications to the host. Line states persist
- * until they are cleared via a second notification. This should be called each time the CDC class driver's
+ * 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.
*
* \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or
@@ -323,7 +323,7 @@
FILE* Stream) ATTR_NON_NULL_PTR_ARG(2);
static int CDC_Device_getchar(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1);
static int CDC_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1);
-
+
void CDC_Device_Event_Stub(void);
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub);
@@ -335,12 +335,13 @@
#endif
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c
index 5111eba59..cdfe8497a 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.c
+++ b/LUFA/Drivers/USB/Class/Device/HID.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -39,7 +39,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
{
if (!(Endpoint_IsSETUPReceived()))
return;
-
+
if (USB_ControlRequest.wIndex != HIDInterfaceInfo->Config.InterfaceNumber)
return;
@@ -56,7 +56,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
memset(ReportData, 0, sizeof(ReportData));
CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, ReportType, ReportData, &ReportSize);
-
+
if (HIDInterfaceInfo->Config.PrevReportINBuffer != NULL)
memcpy(HIDInterfaceInfo->Config.PrevReportINBuffer, ReportData, HIDInterfaceInfo->Config.PrevReportINBufferSize);
@@ -66,7 +66,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
Endpoint_Write_Control_Stream_LE(ReportData, ReportSize);
Endpoint_ClearOUT();
}
-
+
break;
case HID_REQ_SetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
@@ -82,7 +82,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
CALLBACK_HID_Device_ProcessHIDReport(HIDInterfaceInfo, ReportID, ReportType, ReportData, ReportSize);
}
-
+
break;
case HID_REQ_GetProtocol:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
@@ -92,7 +92,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
}
-
+
break;
case HID_REQ_SetProtocol:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
@@ -100,9 +100,9 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
- HIDInterfaceInfo->State.UsingReportProtocol = ((USB_ControlRequest.wValue & 0xFF) != 0x00);
+ HIDInterfaceInfo->State.UsingReportProtocol = ((USB_ControlRequest.wValue & 0xFF) != 0x00);
}
-
+
break;
case HID_REQ_SetIdle:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
@@ -112,11 +112,11 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
HIDInterfaceInfo->State.IdleCount = ((USB_ControlRequest.wValue & 0xFF00) >> 6);
}
-
+
break;
case HID_REQ_GetIdle:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
- {
+ {
Endpoint_ClearSETUP();
Endpoint_Write_Byte(HIDInterfaceInfo->State.IdleCount >> 2);
Endpoint_ClearIN();
@@ -139,17 +139,17 @@ bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* const HIDInterfac
{
return false;
}
-
+
return true;
}
-
+
void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
{
if (USB_DeviceState != DEVICE_STATE_Configured)
return;
Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber);
-
+
if (Endpoint_IsReadWriteAllowed())
{
uint8_t ReportINData[HIDInterfaceInfo->Config.PrevReportINBufferSize];
@@ -162,7 +162,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
ReportINData, &ReportINSize);
bool StatesChanged = false;
bool IdlePeriodElapsed = (HIDInterfaceInfo->State.IdleCount && !(HIDInterfaceInfo->State.IdleMSRemaining));
-
+
if (HIDInterfaceInfo->Config.PrevReportINBuffer != NULL)
{
StatesChanged = (memcmp(ReportINData, HIDInterfaceInfo->Config.PrevReportINBuffer, ReportINSize) != 0);
@@ -179,10 +179,11 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
Endpoint_Write_Byte(ReportID);
Endpoint_Write_Stream_LE(ReportINData, ReportINSize, NO_STREAM_CALLBACK);
-
+
Endpoint_ClearIN();
}
}
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h
index 097b12f29..5329e294e 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.h
+++ b/LUFA/Drivers/USB/Class/Device/HID.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -49,7 +49,7 @@
*
* @{
*/
-
+
#ifndef _HID_CLASS_DEVICE_H_
#define _HID_CLASS_DEVICE_H_
@@ -88,14 +88,14 @@
uint8_t InterfaceNumber; /**< Interface number of the HID interface within the device. */
uint8_t ReportINEndpointNumber; /**< Endpoint number of the HID interface's IN report endpoint. */
- uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint. */
+ uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint. */
bool ReportINEndpointDoubleBank; /**< Indicates if the HID interface's IN report endpoint should use double banking. */
-
+
void* PrevReportINBuffer; /**< Pointer to a buffer where the previously created HID input report can be
* stored by the driver, for comparison purposes to detect report changes that
* must be sent immediately to the host. This should point to a buffer big enough
* to hold the largest HID input report sent from the HID interface. If this is set
- * to NULL, it is up to the user to force transfers when needed in the
+ * to NULL, it is up to the user to force transfers when needed in the
* \ref CALLBACK_HID_Device_CreateHIDReport() callback function.
*
* \note Due to the single buffer, the internal driver can only correctly compare
@@ -111,18 +111,18 @@
*/
} Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
- */
+ */
struct
{
bool UsingReportProtocol; /**< Indicates if the HID interface is set to Boot or Report protocol mode. */
uint16_t IdleCount; /**< Report idle period, in milliseconds, set by the host. */
- uint16_t IdleMSRemaining; /**< Total number of milliseconds remaining before the idle period elapsed - this
- * should be decremented by the user application if non-zero each millisecond. */
+ uint16_t IdleMSRemaining; /**< Total number of milliseconds remaining before the idle period elapsed - this
+ * should be decremented by the user application if non-zero each millisecond. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* are reset to their defaults when the interface is enumerated.
*/
} USB_ClassInfo_HID_Device_t;
-
+
/* Function Prototypes: */
/** Configures the endpoints of a given HID interface, ready for use. This should be linked to the library
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration
@@ -137,12 +137,12 @@
* \return Boolean true if the endpoints were successfully configured, false otherwise.
*/
bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Processes incoming control requests from the host, that are directed to the given HID class interface. This should be
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
*
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
- */
+ */
void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** General management task for a given HID class interface, required for the correct operation of the interface. This should
@@ -151,13 +151,13 @@
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
*/
void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** 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
* user is responsible for the creation of the next HID input report to be sent to the host.
*
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
- * \param[in,out] ReportID If preset to a non-zero value, this is the report ID being requested by the host. If zero,
+ * \param[in,out] ReportID If preset to a non-zero value, this is the report ID being requested by the host. If zero,
* this should be set to the report ID of the generated HID input report (if any). If multiple
* reports are not sent via the given HID interface, this parameter should be ignored.
* \param[in] ReportType Type of HID report to generate, either \ref HID_REPORT_ITEM_In or \ref HID_REPORT_ITEM_Feature.
@@ -173,7 +173,7 @@
void* ReportData,
uint16_t* const ReportSize) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(4) ATTR_NON_NULL_PTR_ARG(5);
-
+
/** HID class driver callback for the user processing of a received HID OUT 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 user is responsible for the processing of the received HID output report from the host.
@@ -205,12 +205,13 @@
if (HIDInterfaceInfo->State.IdleMSRemaining)
HIDInterfaceInfo->State.IdleMSRemaining--;
}
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.c b/LUFA/Drivers/USB/Class/Device/MIDI.c
index fcf670aac..783b67ce7 100644
--- a/LUFA/Drivers/USB/Class/Device/MIDI.c
+++ b/LUFA/Drivers/USB/Class/Device/MIDI.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -64,14 +64,14 @@ bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_Device_t* const MIDIInter
{
continue;
}
-
+
if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
{
return false;
}
}
-
+
return true;
}
@@ -80,7 +80,7 @@ uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
{
if (USB_DeviceState != DEVICE_STATE_Configured)
return ENDPOINT_RWSTREAM_DeviceDisconnected;
-
+
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
if (Endpoint_IsReadWriteAllowed())
@@ -93,7 +93,7 @@ uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
if (!(Endpoint_IsReadWriteAllowed()))
Endpoint_ClearIN();
}
-
+
return ENDPOINT_RWSTREAM_NoError;
}
@@ -101,7 +101,7 @@ uint8_t MIDI_Device_Flush(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
{
if (USB_DeviceState != DEVICE_STATE_Configured)
return ENDPOINT_RWSTREAM_DeviceDisconnected;
-
+
uint8_t ErrorCode;
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
@@ -122,18 +122,19 @@ bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
{
if (USB_DeviceState != DEVICE_STATE_Configured)
return false;
-
+
Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataOUTEndpointNumber);
if (!(Endpoint_IsReadWriteAllowed()))
return false;
Endpoint_Read_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NO_STREAM_CALLBACK);
-
+
if (!(Endpoint_IsReadWriteAllowed()))
Endpoint_ClearOUT();
-
+
return true;
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.h b/LUFA/Drivers/USB/Class/Device/MIDI.h
index fbb83498b..5af6e18a2 100644
--- a/LUFA/Drivers/USB/Class/Device/MIDI.h
+++ b/LUFA/Drivers/USB/Class/Device/MIDI.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -92,15 +92,15 @@
bool DataOUTEndpointDoubleBank; /**< Indicates if the MIDI interface's IN data endpoint should use double banking. */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
- */
+ */
struct
{
// No state information for this class
} State; /**< State data for the USB class interface within the device. All elements in this section
* are reset to their defaults when the interface is enumerated.
*/
- } USB_ClassInfo_MIDI_Device_t;
-
+ } USB_ClassInfo_MIDI_Device_t;
+
/* Function Prototypes: */
/** Configures the endpoints of a given MIDI interface, ready for use. This should be linked to the library
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration
@@ -115,7 +115,7 @@
* \return Boolean true if the endpoints were successfully configured, false otherwise.
*/
bool MIDI_Device_ConfigureEndpoints(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. Events are queued into the
* endpoint bank until either the endpoint bank is full, or \ref MIDI_Device_Flush() is called. This allows for multiple
* MIDI events to be packed into a single endpoint packet, increasing data throughput.
@@ -166,12 +166,12 @@
{
(void)MIDIInterfaceInfo;
}
-
+
/** Processes incoming control requests from the host, that are directed to the given MIDI class interface. This should be
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
*
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
- */
+ */
static inline void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static inline void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
{
@@ -182,7 +182,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.c b/LUFA/Drivers/USB/Class/Device/MassStorage.c
index cb276276c..039684437 100644
--- a/LUFA/Drivers/USB/Class/Device/MassStorage.c
+++ b/LUFA/Drivers/USB/Class/Device/MassStorage.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -42,7 +42,7 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac
{
if (!(Endpoint_IsSETUPReceived()))
return;
-
+
if (USB_ControlRequest.wIndex != MSInterfaceInfo->Config.InterfaceNumber)
return;
@@ -62,11 +62,11 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
- Endpoint_Write_Byte(MSInterfaceInfo->Config.TotalLUNs - 1);
- Endpoint_ClearIN();
+ Endpoint_Write_Byte(MSInterfaceInfo->Config.TotalLUNs - 1);
+ Endpoint_ClearIN();
Endpoint_ClearStatusStage();
}
-
+
break;
}
}
@@ -100,14 +100,14 @@ bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
{
continue;
}
-
+
if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
{
return false;
}
}
-
+
return true;
}
@@ -117,14 +117,14 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
return;
Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);
-
+
if (Endpoint_IsReadWriteAllowed())
{
if (MS_Device_ReadInCommandBlock(MSInterfaceInfo))
{
if (MSInterfaceInfo->State.CommandBlock.Flags & MS_COMMAND_DIR_DATA_IN)
Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
-
+
MSInterfaceInfo->State.CommandStatus.Status = CALLBACK_MS_Device_SCSICommandReceived(MSInterfaceInfo) ?
MS_SCSI_COMMAND_Pass : MS_SCSI_COMMAND_Fail;
MSInterfaceInfo->State.CommandStatus.Signature = MS_CSW_SIGNATURE;
@@ -136,16 +136,16 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{
Endpoint_StallTransaction();
}
-
+
MS_Device_ReturnCommandStatus(MSInterfaceInfo);
}
}
-
+
if (MSInterfaceInfo->State.IsMassStoreReset)
{
Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataOUTEndpointNumber);
Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataINEndpointNumber);
-
+
Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);
Endpoint_ClearStall();
Endpoint_ResetDataToggle();
@@ -168,7 +168,7 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
{
return false;
}
-
+
if ((MSInterfaceInfo->State.CommandBlock.Signature != MS_CBW_SIGNATURE) ||
(MSInterfaceInfo->State.CommandBlock.LUN >= MSInterfaceInfo->Config.TotalLUNs) ||
(MSInterfaceInfo->State.CommandBlock.Flags & 0x1F) ||
@@ -178,7 +178,7 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
Endpoint_StallTransaction();
Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
Endpoint_StallTransaction();
-
+
return false;
}
@@ -191,7 +191,7 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
}
Endpoint_ClearOUT();
-
+
return true;
}
@@ -216,11 +216,11 @@ static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInt
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
USB_USBTask();
#endif
-
+
if (MSInterfaceInfo->State.IsMassStoreReset)
return;
}
-
+
CallbackIsResetSource = &MSInterfaceInfo->State.IsMassStoreReset;
if (Endpoint_Write_Stream_LE(&MSInterfaceInfo->State.CommandStatus, sizeof(MS_CommandStatusWrapper_t),
StreamCallback_MS_Device_AbortOnMassStoreReset))
@@ -244,3 +244,4 @@ static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void)
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.h b/LUFA/Drivers/USB/Class/Device/MassStorage.h
index 39a806eee..8201a3ce9 100644
--- a/LUFA/Drivers/USB/Class/Device/MassStorage.h
+++ b/LUFA/Drivers/USB/Class/Device/MassStorage.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -56,7 +56,7 @@
/* Includes: */
#include "../../USB.h"
#include "../Common/MassStorage.h"
-
+
#include <string.h>
/* Enable C linkage for C++ Compilers: */
@@ -70,7 +70,7 @@
#endif
/* Public Interface - May be used in end-application: */
- /* Type Defines: */
+ /* Type Defines: */
/** \brief Mass Storage Class Device Mode Configuration and State Structure.
*
* Class state structure. An instance of this structure should be made for each Mass Storage interface
@@ -125,12 +125,12 @@
* \return Boolean true if the endpoints were successfully configured, false otherwise.
*/
bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Processes incoming control requests from the host, that are directed to the given Mass Storage class interface. This should be
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
*
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.
- */
+ */
void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** General management task for a given Mass Storage class interface, required for the correct operation of the interface. This should
@@ -139,7 +139,7 @@
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage configuration and state.
*/
void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Mass Storage class driver callback for the user processing of a received SCSI command. This callback will fire each time the
* host sends a SCSI command which requires processing by the user application. Inside this callback the user is responsible
* for the processing of the received SCSI command from the host. The SCSI command is available in the CommandBlock structure
@@ -150,7 +150,7 @@
* \return Boolean true if the SCSI command was successfully processed, false otherwise.
*/
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
@@ -159,14 +159,15 @@
static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void);
#endif
-
+
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.c b/LUFA/Drivers/USB/Class/Device/RNDIS.c
index 41e6b265d..7b6719da6 100644
--- a/LUFA/Drivers/USB/Class/Device/RNDIS.c
+++ b/LUFA/Drivers/USB/Class/Device/RNDIS.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -71,7 +71,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
{
if (!(Endpoint_IsSETUPReceived()))
return;
-
+
if (USB_ControlRequest.wIndex != RNDISInterfaceInfo->Config.ControlInterfaceNumber)
return;
@@ -86,7 +86,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
RNDIS_Device_ProcessRNDISControlMessage(RNDISInterfaceInfo);
}
-
+
break;
case RNDIS_REQ_GetEncapsulatedResponse:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
@@ -100,12 +100,12 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
}
Endpoint_ClearSETUP();
- Endpoint_Write_Control_Stream_LE(RNDISInterfaceInfo->State.RNDISMessageBuffer, MessageHeader->MessageLength);
+ Endpoint_Write_Control_Stream_LE(RNDISInterfaceInfo->State.RNDISMessageBuffer, MessageHeader->MessageLength);
Endpoint_ClearOUT();
MessageHeader->MessageLength = 0;
}
-
+
break;
}
}
@@ -146,14 +146,14 @@ bool RNDIS_Device_ConfigureEndpoints(USB_ClassInfo_RNDIS_Device_t* const RNDISIn
{
continue;
}
-
+
if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
{
return false;
}
}
-
+
return true;
}
@@ -176,14 +176,14 @@ void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo
.wIndex = 0,
.wLength = 0,
};
-
+
Endpoint_Write_Stream_LE(&Notification, sizeof(USB_Request_Header_t), NO_STREAM_CALLBACK);
Endpoint_ClearIN();
RNDISInterfaceInfo->State.ResponseReady = false;
}
-
+
if ((RNDISInterfaceInfo->State.CurrRNDISState == RNDIS_Data_Initialized) && !(MessageHeader->MessageLength))
{
RNDIS_Packet_Message_t RNDISPacketHeader;
@@ -199,18 +199,18 @@ void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo
Endpoint_StallTransaction();
return;
}
-
+
Endpoint_Read_Stream_LE(RNDISInterfaceInfo->State.FrameIN.FrameData, RNDISPacketHeader.DataLength, NO_STREAM_CALLBACK);
Endpoint_ClearOUT();
-
+
RNDISInterfaceInfo->State.FrameIN.FrameLength = RNDISPacketHeader.DataLength;
RNDISInterfaceInfo->State.FrameIN.FrameInBuffer = true;
}
-
+
Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataINEndpointNumber);
-
+
if (Endpoint_IsINReady() && RNDISInterfaceInfo->State.FrameOUT.FrameInBuffer)
{
memset(&RNDISPacketHeader, 0, sizeof(RNDIS_Packet_Message_t));
@@ -223,11 +223,11 @@ void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo
Endpoint_Write_Stream_LE(&RNDISPacketHeader, sizeof(RNDIS_Packet_Message_t), NO_STREAM_CALLBACK);
Endpoint_Write_Stream_LE(RNDISInterfaceInfo->State.FrameOUT.FrameData, RNDISPacketHeader.DataLength, NO_STREAM_CALLBACK);
Endpoint_ClearIN();
-
+
RNDISInterfaceInfo->State.FrameOUT.FrameInBuffer = false;
}
}
-}
+}
void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
{
@@ -240,19 +240,19 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const
{
case REMOTE_NDIS_INITIALIZE_MSG:
RNDISInterfaceInfo->State.ResponseReady = true;
-
+
RNDIS_Initialize_Message_t* INITIALIZE_Message =
(RNDIS_Initialize_Message_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
RNDIS_Initialize_Complete_t* INITIALIZE_Response =
(RNDIS_Initialize_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
-
+
INITIALIZE_Response->MessageType = REMOTE_NDIS_INITIALIZE_CMPLT;
INITIALIZE_Response->MessageLength = sizeof(RNDIS_Initialize_Complete_t);
INITIALIZE_Response->RequestId = INITIALIZE_Message->RequestId;
INITIALIZE_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
-
+
INITIALIZE_Response->MajorVersion = REMOTE_NDIS_VERSION_MAJOR;
- INITIALIZE_Response->MinorVersion = REMOTE_NDIS_VERSION_MINOR;
+ INITIALIZE_Response->MinorVersion = REMOTE_NDIS_VERSION_MINOR;
INITIALIZE_Response->DeviceFlags = REMOTE_NDIS_DF_CONNECTIONLESS;
INITIALIZE_Response->Medium = REMOTE_NDIS_MEDIUM_802_3;
INITIALIZE_Response->MaxPacketsPerTransfer = 1;
@@ -260,9 +260,9 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const
INITIALIZE_Response->PacketAlignmentFactor = 0;
INITIALIZE_Response->AFListOffset = 0;
INITIALIZE_Response->AFListSize = 0;
-
+
RNDISInterfaceInfo->State.CurrRNDISState = RNDIS_Initialized;
-
+
break;
case REMOTE_NDIS_HALT_MSG:
RNDISInterfaceInfo->State.ResponseReady = false;
@@ -273,40 +273,40 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const
break;
case REMOTE_NDIS_QUERY_MSG:
RNDISInterfaceInfo->State.ResponseReady = true;
-
+
RNDIS_Query_Message_t* QUERY_Message = (RNDIS_Query_Message_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
RNDIS_Query_Complete_t* QUERY_Response = (RNDIS_Query_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
uint32_t Query_Oid = QUERY_Message->Oid;
-
+
void* QueryData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
QUERY_Message->InformationBufferOffset];
- void* ResponseData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Query_Complete_t)];
+ void* ResponseData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Query_Complete_t)];
uint16_t ResponseSize;
QUERY_Response->MessageType = REMOTE_NDIS_QUERY_CMPLT;
QUERY_Response->MessageLength = sizeof(RNDIS_Query_Complete_t);
-
+
if (RNDIS_Device_ProcessNDISQuery(RNDISInterfaceInfo, Query_Oid, QueryData, QUERY_Message->InformationBufferLength,
ResponseData, &ResponseSize))
{
QUERY_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
QUERY_Response->MessageLength += ResponseSize;
-
+
QUERY_Response->InformationBufferLength = ResponseSize;
QUERY_Response->InformationBufferOffset = (sizeof(RNDIS_Query_Complete_t) - sizeof(RNDIS_Message_Header_t));
}
else
- {
+ {
QUERY_Response->Status = REMOTE_NDIS_STATUS_NOT_SUPPORTED;
QUERY_Response->InformationBufferLength = 0;
QUERY_Response->InformationBufferOffset = 0;
}
-
+
break;
case REMOTE_NDIS_SET_MSG:
RNDISInterfaceInfo->State.ResponseReady = true;
-
+
RNDIS_Set_Message_t* SET_Message = (RNDIS_Set_Message_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
RNDIS_Set_Complete_t* SET_Response = (RNDIS_Set_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
uint32_t SET_Oid = SET_Message->Oid;
@@ -317,14 +317,14 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const
void* SetData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
SET_Message->InformationBufferOffset];
-
+
SET_Response->Status = RNDIS_Device_ProcessNDISSet(RNDISInterfaceInfo, SET_Oid, SetData,
SET_Message->InformationBufferLength) ?
REMOTE_NDIS_STATUS_SUCCESS : REMOTE_NDIS_STATUS_NOT_SUPPORTED;
break;
case REMOTE_NDIS_RESET_MSG:
RNDISInterfaceInfo->State.ResponseReady = true;
-
+
RNDIS_Reset_Complete_t* RESET_Response = (RNDIS_Reset_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
RESET_Response->MessageType = REMOTE_NDIS_RESET_CMPLT;
@@ -335,7 +335,7 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const
break;
case REMOTE_NDIS_KEEPALIVE_MSG:
RNDISInterfaceInfo->State.ResponseReady = true;
-
+
RNDIS_KeepAlive_Message_t* KEEPALIVE_Message =
(RNDIS_KeepAlive_Message_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
RNDIS_KeepAlive_Complete_t* KEEPALIVE_Response =
@@ -345,7 +345,7 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const
KEEPALIVE_Response->MessageLength = sizeof(RNDIS_KeepAlive_Complete_t);
KEEPALIVE_Response->RequestId = KEEPALIVE_Message->RequestId;
KEEPALIVE_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
-
+
break;
}
}
@@ -364,60 +364,60 @@ static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RN
{
case OID_GEN_SUPPORTED_LIST:
*ResponseSize = sizeof(AdapterSupportedOIDList);
-
+
memcpy_P(ResponseData, AdapterSupportedOIDList, sizeof(AdapterSupportedOIDList));
-
+
return true;
case OID_GEN_PHYSICAL_MEDIUM:
*ResponseSize = sizeof(uint32_t);
-
+
/* Indicate that the device is a true ethernet link */
*((uint32_t*)ResponseData) = 0;
-
+
return true;
case OID_GEN_HARDWARE_STATUS:
*ResponseSize = sizeof(uint32_t);
-
+
*((uint32_t*)ResponseData) = NDIS_HardwareStatus_Ready;
-
+
return true;
case OID_GEN_MEDIA_SUPPORTED:
case OID_GEN_MEDIA_IN_USE:
*ResponseSize = sizeof(uint32_t);
-
+
*((uint32_t*)ResponseData) = REMOTE_NDIS_MEDIUM_802_3;
-
+
return true;
case OID_GEN_VENDOR_ID:
*ResponseSize = sizeof(uint32_t);
-
+
/* Vendor ID 0x0xFFFFFF is reserved for vendors who have not purchased a NDIS VID */
*((uint32_t*)ResponseData) = 0x00FFFFFF;
-
+
return true;
case OID_GEN_MAXIMUM_FRAME_SIZE:
case OID_GEN_TRANSMIT_BLOCK_SIZE:
case OID_GEN_RECEIVE_BLOCK_SIZE:
*ResponseSize = sizeof(uint32_t);
-
+
*((uint32_t*)ResponseData) = ETHERNET_FRAME_SIZE_MAX;
-
+
return true;
case OID_GEN_VENDOR_DESCRIPTION:
*ResponseSize = (strlen(RNDISInterfaceInfo->Config.AdapterVendorDescription) + 1);
-
+
memcpy(ResponseData, RNDISInterfaceInfo->Config.AdapterVendorDescription, *ResponseSize);
-
+
return true;
case OID_GEN_MEDIA_CONNECT_STATUS:
*ResponseSize = sizeof(uint32_t);
-
+
*((uint32_t*)ResponseData) = REMOTE_NDIS_MEDIA_STATE_CONNECTED;
-
+
return true;
case OID_GEN_LINK_SPEED:
*ResponseSize = sizeof(uint32_t);
-
+
/* Indicate 10Mb/s link speed */
*((uint32_t*)ResponseData) = 100000;
@@ -425,23 +425,23 @@ static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RN
case OID_802_3_PERMANENT_ADDRESS:
case OID_802_3_CURRENT_ADDRESS:
*ResponseSize = sizeof(MAC_Address_t);
-
+
memcpy(ResponseData, &RNDISInterfaceInfo->Config.AdapterMACAddress, sizeof(MAC_Address_t));
return true;
case OID_802_3_MAXIMUM_LIST_SIZE:
*ResponseSize = sizeof(uint32_t);
-
+
/* Indicate only one multicast address supported */
*((uint32_t*)ResponseData) = 1;
-
+
return true;
case OID_GEN_CURRENT_PACKET_FILTER:
*ResponseSize = sizeof(uint32_t);
-
+
*((uint32_t*)ResponseData) = RNDISInterfaceInfo->State.CurrPacketFilter;
-
- return true;
+
+ return true;
case OID_GEN_XMIT_OK:
case OID_GEN_RCV_OK:
case OID_GEN_XMIT_ERROR:
@@ -451,17 +451,17 @@ static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RN
case OID_802_3_XMIT_ONE_COLLISION:
case OID_802_3_XMIT_MORE_COLLISIONS:
*ResponseSize = sizeof(uint32_t);
-
+
/* Unused statistic OIDs - always return 0 for each */
*((uint32_t*)ResponseData) = 0;
-
+
return true;
case OID_GEN_MAXIMUM_TOTAL_SIZE:
*ResponseSize = sizeof(uint32_t);
-
+
/* Indicate maximum overall buffer (Ethernet frame and RNDIS header) the adapter can handle */
*((uint32_t*)ResponseData) = (RNDIS_MESSAGE_BUFFER_SIZE + ETHERNET_FRAME_SIZE_MAX);
-
+
return true;
default:
return false;
@@ -481,11 +481,11 @@ static bool RNDIS_Device_ProcessNDISSet(USB_ClassInfo_RNDIS_Device_t* const RNDI
RNDISInterfaceInfo->State.CurrPacketFilter = *((uint32_t*)SetData);
RNDISInterfaceInfo->State.CurrRNDISState = ((RNDISInterfaceInfo->State.CurrPacketFilter) ?
RNDIS_Data_Initialized : RNDIS_Data_Initialized);
-
+
return true;
case OID_802_3_MULTICAST_LIST:
/* Do nothing - throw away the value from the host as it is unused */
-
+
return true;
default:
return false;
@@ -493,3 +493,4 @@ static bool RNDIS_Device_ProcessNDISSet(USB_ClassInfo_RNDIS_Device_t* const RNDI
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.h b/LUFA/Drivers/USB/Class/Device/RNDIS.h
index ba958b4c2..5aebcc63a 100644
--- a/LUFA/Drivers/USB/Class/Device/RNDIS.h
+++ b/LUFA/Drivers/USB/Class/Device/RNDIS.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -56,9 +56,9 @@
/* Includes: */
#include "../../USB.h"
#include "../Common/RNDIS.h"
-
+
#include <string.h>
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -68,9 +68,9 @@
#if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
- /* Type Defines: */
+ /* Type Defines: */
/** \brief RNDIS Class Device Mode Configuration and State Structure.
*
* Class state structure. An instance of this structure should be made for each RNDIS interface
@@ -94,7 +94,7 @@
uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used. */
uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used. */
bool NotificationEndpointDoubleBank; /**< Indicates if the RNDIS interface's notification endpoint should use double banking. */
-
+
char* AdapterVendorDescription; /**< String description of the adapter vendor. */
MAC_Address_t AdapterMACAddress; /**< MAC address of the adapter. */
} Config; /**< Config data for the USB class interface within the device. All elements in this section.
@@ -118,7 +118,7 @@
* are reset to their defaults when the interface is enumerated.
*/
} USB_ClassInfo_RNDIS_Device_t;
-
+
/* Function Prototypes: */
/** Configures the endpoints of a given RNDIS interface, ready for use. This should be linked to the library
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration
@@ -138,23 +138,23 @@
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
*
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state.
- */
+ */
void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** General management task for a given HID class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
*
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state.
*/
void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
#if defined(__INCLUDE_FROM_RNDIS_CLASS_DEVICE_C)
static void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
ATTR_NON_NULL_PTR_ARG(1);
- static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo,
+ static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo,
const uint32_t OId,
void* const QueryData,
const uint16_t QuerySize,
@@ -167,14 +167,15 @@
const uint16_t SetSize) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(3);
#endif
-
+
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/HID.h b/LUFA/Drivers/USB/Class/HID.h
index 6def55d59..3fb74f379 100644
--- a/LUFA/Drivers/USB/Class/HID.h
+++ b/LUFA/Drivers/USB/Class/HID.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -47,8 +47,8 @@
* - LUFA/Drivers/USB/Class/Host/HIDParser.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
*
* \section Module Description
- * HID Class Driver module. This module contains an internal implementation of the USB HID Class, for both Device
- * and Host USB modes. User applications can use this class driver instead of implementing the HID class manually
+ * HID Class Driver module. This module contains an internal implementation of the USB HID Class, for both Device
+ * and Host USB modes. User applications can use this class driver instead of implementing the HID class manually
* via the low-level LUFA APIs.
*
* This module is designed to simplify the user code by exposing only the required interface needed to interface with
@@ -56,14 +56,14 @@
*
* @{
*/
-
+
#ifndef _HID_CLASS_H_
#define _HID_CLASS_H_
/* Macros: */
#define __INCLUDE_FROM_HID_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
-
+
/* Includes: */
#include "../HighLevel/USBMode.h"
@@ -74,11 +74,12 @@
#if defined(USB_CAN_BE_DEVICE)
#include "Device/HID.h"
#endif
-
+
#if defined(USB_CAN_BE_HOST)
#include "Host/HID.h"
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c
index 0f81d0ea4..57ca35cdc 100644
--- a/LUFA/Drivers/USB/Class/Host/CDC.c
+++ b/LUFA/Drivers/USB/Class/Host/CDC.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -62,7 +62,7 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
DCOMP_CDC_Host_NextCDCDataInterface) != DESCRIPTOR_SEARCH_COMP_Found)
{
return CDC_ENUMERROR_NoCompatibleInterfaceFound;
- }
+ }
DataINEndpoint = NULL;
DataOUTEndpoint = NULL;
@@ -79,10 +79,10 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
NotificationEndpoint = NULL;
}
-
+
continue;
}
-
+
USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
@@ -97,7 +97,7 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
DataOUTEndpoint = EndpointData;
}
}
-
+
for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
{
if (PipeNum == CDCInterfaceInfo->Config.DataINPipeNumber)
@@ -141,7 +141,7 @@ static uint8_t DCOMP_CDC_Host_NextCDCControlInterface(void* const CurrentDescrip
{
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Interface_t);
-
+
if ((CurrentInterface->Class == CDC_CONTROL_CLASS) &&
(CurrentInterface->SubClass == CDC_CONTROL_SUBCLASS) &&
(CurrentInterface->Protocol == CDC_CONTROL_PROTOCOL))
@@ -149,7 +149,7 @@ static uint8_t DCOMP_CDC_Host_NextCDCControlInterface(void* const CurrentDescrip
return DESCRIPTOR_SEARCH_Found;
}
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -159,7 +159,7 @@ static uint8_t DCOMP_CDC_Host_NextCDCDataInterface(void* const CurrentDescriptor
{
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Interface_t);
-
+
if ((CurrentInterface->Class == CDC_DATA_CLASS) &&
(CurrentInterface->SubClass == CDC_DATA_SUBCLASS) &&
(CurrentInterface->Protocol == CDC_DATA_PROTOCOL))
@@ -167,7 +167,7 @@ static uint8_t DCOMP_CDC_Host_NextCDCDataInterface(void* const CurrentDescriptor
return DESCRIPTOR_SEARCH_Found;
}
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -177,9 +177,9 @@ static uint8_t DCOMP_CDC_Host_NextCDCInterfaceEndpoint(void* const CurrentDescri
{
USB_Descriptor_Endpoint_t* CurrentEndpoint = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Endpoint_t);
-
+
uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);
-
+
if (((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT)) &&
!(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress)))
{
@@ -198,7 +198,7 @@ void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
{
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return;
-
+
Pipe_SelectPipe(CDCInterfaceInfo->Config.NotificationPipeNumber);
Pipe_Unfreeze();
@@ -206,14 +206,14 @@ void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
{
USB_Request_Header_t Notification;
Pipe_Read_Stream_LE(&Notification, sizeof(USB_Request_Header_t), NO_STREAM_CALLBACK);
-
+
if ((Notification.bRequest == CDC_NOTIF_SerialState) &&
(Notification.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)))
{
Pipe_Read_Stream_LE(&CDCInterfaceInfo->State.ControlLineStates.DeviceToHost,
sizeof(CDCInterfaceInfo->State.ControlLineStates.DeviceToHost),
NO_STREAM_CALLBACK);
-
+
Pipe_ClearIN();
EVENT_CDC_Host_ControLineStateChanged(CDCInterfaceInfo);
@@ -223,7 +223,7 @@ void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
Pipe_ClearIN();
}
}
-
+
Pipe_Freeze();
CDC_Host_Flush(CDCInterfaceInfo);
@@ -241,7 +241,7 @@ uint8_t CDC_Host_SetLineEncoding(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInf
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
return USB_Host_SendControlRequest(&CDCInterfaceInfo->State.LineEncoding);
}
@@ -257,7 +257,7 @@ uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* const CDCI
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
return USB_Host_SendControlRequest(NULL);
}
@@ -274,7 +274,7 @@ uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
return USB_Host_SendControlRequest(NULL);
}
@@ -287,12 +287,12 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
uint8_t ErrorCode;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
ErrorCode = Pipe_Write_Stream_LE(Data, Length, NO_STREAM_CALLBACK);
Pipe_Freeze();
-
+
return ErrorCode;
}
@@ -301,12 +301,12 @@ uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
{
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return PIPE_READYWAIT_DeviceDisconnected;
-
+
uint8_t ErrorCode;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
-
+
if (!(Pipe_IsReadWriteAllowed()))
{
Pipe_ClearOUT();
@@ -315,9 +315,9 @@ uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
return ErrorCode;
}
- Pipe_Write_Byte(Data);
+ Pipe_Write_Byte(Data);
Pipe_Freeze();
-
+
return PIPE_READYWAIT_NoError;
}
@@ -325,7 +325,7 @@ uint16_t CDC_Host_BytesReceived(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
{
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return 0;
-
+
Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
@@ -346,7 +346,7 @@ uint16_t CDC_Host_BytesReceived(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
else
{
Pipe_Freeze();
-
+
return 0;
}
}
@@ -355,7 +355,7 @@ int16_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
{
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return -1;
-
+
int16_t ReceivedByte = -1;
Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipeNumber);
@@ -369,7 +369,7 @@ int16_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
if (!(Pipe_BytesInPipe()))
Pipe_ClearIN();
}
-
+
Pipe_Freeze();
return ReceivedByte;
@@ -379,12 +379,12 @@ uint8_t CDC_Host_Flush(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
{
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return PIPE_READYWAIT_DeviceDisconnected;
-
+
uint8_t ErrorCode;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
-
+
if (!(Pipe_BytesInPipe()))
return PIPE_READYWAIT_NoError;
@@ -401,7 +401,7 @@ uint8_t CDC_Host_Flush(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
}
Pipe_Freeze();
-
+
return PIPE_READYWAIT_NoError;
}
@@ -438,7 +438,7 @@ static int CDC_Host_getchar(FILE* Stream)
static int CDC_Host_getchar_Blocking(FILE* Stream)
{
int16_t ReceivedByte;
-
+
while ((ReceivedByte = CDC_Host_ReceiveByte((USB_ClassInfo_CDC_Host_t*)fdev_get_udata(Stream))) < 0)
{
if (USB_HostState == HOST_STATE_Unattached)
@@ -457,3 +457,4 @@ void CDC_Host_Event_Stub(void)
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Host/CDC.h b/LUFA/Drivers/USB/Class/Host/CDC.h
index e80d01423..8a4b576ca 100644
--- a/LUFA/Drivers/USB/Class/Host/CDC.h
+++ b/LUFA/Drivers/USB/Class/Host/CDC.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -59,7 +59,7 @@
#include <stdio.h>
#include <string.h>
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -88,7 +88,7 @@
uint8_t DataOUTPipeNumber; /**< Pipe number of the CDC interface's OUT data pipe. */
bool DataOUTPipeDoubleBank; /**< Indicates if the CDC interface's OUT data pipe should use double banking. */
- uint8_t NotificationPipeNumber; /**< Pipe number of the CDC interface's IN notification endpoint, if used. */
+ uint8_t NotificationPipeNumber; /**< Pipe number of the CDC interface's IN notification endpoint, if used. */
bool NotificationPipeDoubleBank; /**< Indicates if the CDC interface's notification pipe should use double banking. */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
@@ -100,11 +100,11 @@
* Configured state.
*/
uint8_t ControlInterfaceNumber; /**< Interface index of the CDC-ACM control interface within the attached device. */
-
+
uint16_t DataINPipeSize; /**< Size in bytes of the CDC interface's IN data pipe. */
uint16_t DataOUTPipeSize; /**< Size in bytes of the CDC interface's OUT data pipe. */
uint16_t NotificationPipeSize; /**< Size in bytes of the CDC interface's IN notification pipe, if used. */
-
+
struct
{
uint8_t HostToDevice; /**< Control line states from the host to device, as a set of CDC_CONTROL_LINE_OUT_*
@@ -115,7 +115,7 @@
* masks. This value is updated each time \ref CDC_Host_USBTask() is called.
*/
} ControlLineStates; /**< Current states of the virtual serial port's control lines between the device and host. */
-
+
struct
{
uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second. */
@@ -136,7 +136,7 @@
* the interface is enumerated.
*/
} USB_ClassInfo_CDC_Host_t;
-
+
/* Enums: */
/** Enum for the possible error codes returned by the \ref CDC_Host_ConfigurePipes() function. */
enum CDC_Host_EnumerationFailure_ErrorCodes_t
@@ -145,7 +145,7 @@
CDC_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
CDC_ENUMERROR_NoCompatibleInterfaceFound = 2, /**< A compatible CDC interface was not found in the device's Configuration Descriptor. */
};
-
+
/* Function Prototypes: */
/** General management task for a given CDC host class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
@@ -153,7 +153,7 @@
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing an CDC Class host configuration and state.
*/
void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Host interface configuration routine, to configure a given CDC host interface instance using the Configuration
* Descriptor read from an attached USB device. This function automatically updates the given CDC Host instance's
* state values and configures the pipes required to communicate with the interface if it is found within the device.
@@ -173,7 +173,7 @@
uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
uint16_t ConfigDescriptorSize,
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
-
+
/** Sets the line encoding for the attached device's virtual serial port. This should be called when the LineEncoding
* values of the interface have been changed to push the new settings to the USB device.
*
@@ -193,7 +193,7 @@
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
*/
uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Sends a Send Break request to the device. This is generally used to separate data data or to indicate a special condition
* to the receiving device.
*
@@ -204,10 +204,10 @@
*/
uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
const uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** 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. Bytes will be queued for transmission to the device until either the pipe bank becomes full, or the
- * \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
+ * \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
* packed into a single pipe packet, increasing data throughput.
*
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
@@ -222,10 +222,10 @@
uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
const char* const Data,
const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
-
+
/** Sends a given byte to the attached USB device, if connected. If a device is not connected when the function is called, the
* byte is discarded. Bytes will be queued for transmission to the device until either the pipe bank becomes full, or the
- * \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
+ * \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
* packed into a single pipe packet, increasing data throughput.
*
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
@@ -265,7 +265,7 @@
* \return Next received byte from the device, or a negative value if no data received.
*/
int16_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.
*
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
@@ -335,7 +335,7 @@
static uint8_t DCOMP_CDC_Host_NextCDCInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
@@ -344,3 +344,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c
index ce1ceb1ca..e5afca06c 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.c
+++ b/LUFA/Drivers/USB/Class/Host/HID.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -44,9 +44,9 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
USB_Descriptor_Endpoint_t* DataOUTEndpoint = NULL;
USB_Descriptor_Interface_t* HIDInterface = NULL;
USB_HID_Descriptor_HID_t* HIDDescriptor = NULL;
-
+
memset(&HIDInterfaceInfo->State, 0x00, sizeof(HIDInterfaceInfo->State));
-
+
if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
return HID_ENUMERROR_InvalidConfigDescriptor;
@@ -58,7 +58,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
{
if (DataINEndpoint || DataOUTEndpoint)
break;
-
+
do
{
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
@@ -66,11 +66,11 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
{
return HID_ENUMERROR_NoCompatibleInterfaceFound;
}
-
+
HIDInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t);
} while (HIDInterfaceInfo->Config.HIDInterfaceProtocol &&
(HIDInterface->Protocol != HIDInterfaceInfo->Config.HIDInterfaceProtocol));
-
+
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
DCOMP_HID_Host_NextHID) != DESCRIPTOR_SEARCH_COMP_Found)
{
@@ -84,15 +84,15 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
continue;
}
-
+
USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
DataINEndpoint = EndpointData;
else
- DataOUTEndpoint = EndpointData;
+ DataOUTEndpoint = EndpointData;
}
-
+
for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
{
if (PipeNum == HIDInterfaceInfo->Config.DataINPipeNumber)
@@ -101,7 +101,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize,
HIDInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS);
-
+
HIDInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
}
else if (PipeNum == HIDInterfaceInfo->Config.DataOUTPipeNumber)
@@ -115,13 +115,13 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
HIDInterfaceInfo->State.DeviceUsesOUTPipe = true;
}
}
-
+
HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber;
HIDInterfaceInfo->State.HIDReportSize = HIDDescriptor->HIDReportLength;
HIDInterfaceInfo->State.SupportsBootProtocol = (HIDInterface->SubClass != HID_BOOTP_NonBootProtocol);
HIDInterfaceInfo->State.LargestReportSize = 8;
HIDInterfaceInfo->State.IsActive = true;
-
+
return HID_ENUMERROR_NoError;
}
@@ -131,11 +131,11 @@ static uint8_t DCOMP_HID_Host_NextHIDInterface(void* const CurrentDescriptor)
{
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Interface_t);
-
+
if (CurrentInterface->Class == HID_INTERFACE_CLASS)
return DESCRIPTOR_SEARCH_Found;
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -154,7 +154,7 @@ static uint8_t DCOMP_HID_Host_NextHIDInterfaceEndpoint(void* const CurrentDescri
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
{
USB_Descriptor_Endpoint_t* CurrentEndpoint = DESCRIPTOR_PCAST(CurrentDescriptor,
- USB_Descriptor_Endpoint_t);
+ USB_Descriptor_Endpoint_t);
if (!(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress)))
return DESCRIPTOR_SEARCH_Found;
@@ -182,11 +182,11 @@ uint8_t HID_Host_ReceiveReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
return USB_Host_SendControlRequest(Buffer);
}
#endif
-
+
uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
void* Buffer)
{
@@ -197,7 +197,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
Pipe_SelectPipe(HIDInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
-
+
uint16_t ReportSize;
uint8_t* BufferPos = Buffer;
@@ -205,13 +205,13 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
if (!(HIDInterfaceInfo->State.UsingBootProtocol))
{
uint8_t ReportID = 0;
-
+
if (HIDInterfaceInfo->Config.HIDParserData->UsingReportIDs)
{
ReportID = Pipe_Read_Byte();
*(BufferPos++) = ReportID;
}
-
+
ReportSize = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, HID_REPORT_ITEM_In);
}
else
@@ -222,10 +222,10 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
if ((ErrorCode = Pipe_Read_Stream_LE(BufferPos, ReportSize, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
-
+
Pipe_ClearIN();
Pipe_Freeze();
-
+
return PIPE_RWSTREAM_NoError;
}
@@ -244,19 +244,19 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
if (HIDInterfaceInfo->State.DeviceUsesOUTPipe && (ReportType == HID_REPORT_ITEM_Out))
{
uint8_t ErrorCode;
-
+
Pipe_SelectPipe(HIDInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
-
+
if (ReportID)
Pipe_Write_Stream_LE(&ReportID, sizeof(ReportID), NO_STREAM_CALLBACK);
-
+
if ((ErrorCode = Pipe_Write_Stream_LE(Buffer, ReportSize, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
-
+
Pipe_ClearOUT();
Pipe_Freeze();
-
+
return PIPE_RWSTREAM_NoError;
}
else
@@ -276,7 +276,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
return USB_Host_SendControlRequest(Buffer);
}
}
@@ -290,11 +290,11 @@ bool HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)
Pipe_SelectPipe(HIDInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
-
+
ReportReceived = Pipe_IsINReceived();
-
+
Pipe_Freeze();
-
+
return ReportReceived;
}
@@ -312,7 +312,7 @@ uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInf
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
if (!(HIDInterfaceInfo->State.SupportsBootProtocol))
return HID_ERROR_LOGICAL;
@@ -321,7 +321,7 @@ uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInf
HIDInterfaceInfo->State.LargestReportSize = 8;
HIDInterfaceInfo->State.UsingBootProtocol = true;
-
+
return HOST_SENDCONTROL_Successful;
}
@@ -331,7 +331,7 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
uint8_t ErrorCode;
uint8_t HIDReportData[HIDInterfaceInfo->State.HIDReportSize];
-
+
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
@@ -345,7 +345,7 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
if ((ErrorCode = USB_Host_SendControlRequest(HIDReportData)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
-
+
if (HIDInterfaceInfo->State.UsingBootProtocol)
{
USB_ControlRequest = (USB_Request_Header_t)
@@ -362,10 +362,10 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
HIDInterfaceInfo->State.UsingBootProtocol = false;
}
-
+
if (HIDInterfaceInfo->Config.HIDParserData == NULL)
return HID_ERROR_LOGICAL;
-
+
if ((ErrorCode = USB_ProcessHIDReport(HIDReportData, HIDInterfaceInfo->State.HIDReportSize,
HIDInterfaceInfo->Config.HIDParserData)) != HID_PARSE_Successful)
{
@@ -380,3 +380,4 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
#endif
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h
index eca94fbd8..0ef3674d8 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.h
+++ b/LUFA/Drivers/USB/Class/Host/HID.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -58,7 +58,7 @@
#include "../../USB.h"
#include "../Common/HID.h"
#include "HIDParser.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -73,7 +73,7 @@
/* Macros: */
/** Error code for some HID Host functions, indicating a logical (and not hardware) error. */
#define HID_ERROR_LOGICAL 0x80
-
+
/* Type Defines: */
/** \brief HID Class Host Mode Configuration and State Structure.
*
@@ -116,7 +116,7 @@
uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe. */
uint16_t DataOUTPipeSize; /**< Size in bytes of the HID interface's OUT data pipe. */
-
+
bool SupportsBootProtocol; /**< Indicates if the current interface instance supports the HID Boot
* Protocol when enabled via \ref HID_Host_SetBootProtocol().
*/
@@ -125,7 +125,7 @@
*/
bool UsingBootProtocol; /**< Indicates that the interface is currently initialized in Boot Protocol mode */
uint16_t HIDReportSize; /**< Size in bytes of the HID report descriptor in the device. */
-
+
uint8_t LargestReportSize; /**< Largest report the device will send, in bytes. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
@@ -141,7 +141,7 @@
HID_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
HID_ENUMERROR_NoCompatibleInterfaceFound = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor. */
};
-
+
/* Function Prototypes: */
/** Host interface configuration routine, to configure a given HID host interface instance using the Configuration
* Descriptor read from an attached USB device. This function automatically updates the given HID Host instance's
@@ -169,7 +169,7 @@
/** Receives a HID IN report from the attached HID device, when a report has been received on the HID IN Data pipe.
- *
+ *
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
* call will fail.
*
@@ -202,7 +202,7 @@
const uint8_t ReportID,
void* Buffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
#endif
-
+
/** Sends an OUT or FEATURE report to the currently attached HID device, using the device's OUT pipe if available,
* or the device's Control pipe if not.
*
@@ -244,7 +244,7 @@
* \return Boolean true if a report has been received, false otherwise.
*/
bool HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Switches the attached HID device's reporting protocol over to the Boot Report protocol mode, on supported devices.
*
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method must still be called
@@ -276,7 +276,7 @@
*/
uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
#endif
-
+
/* Inline Functions: */
/** General management task for a given Human Interface Class host class interface, required for the correct operation of
* the interface. This should be called frequently in the main program loop, before the master USB management task
@@ -288,7 +288,7 @@
static inline void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)
{
(void)HIDInterfaceInfo;
- }
+ }
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
@@ -300,9 +300,9 @@
static uint8_t DCOMP_HID_Host_NextHIDInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DCOMP_HID_Host_NextHID(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DCOMP_HID_Host_NextHIDInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
- #endif
- #endif
-
+ #endif
+ #endif
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
@@ -311,3 +311,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c
index c5d5f948a..43f703a93 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDParser.c
+++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -41,7 +41,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
HID_StateTable_t StateTable[HID_STATETABLE_STACK_DEPTH];
HID_StateTable_t* CurrStateTable = &StateTable[0];
HID_CollectionPath_t* CurrCollectionPath = NULL;
- HID_ReportSizeInfo_t* CurrReportIDInfo = &ParserData->ReportIDSizes[0];
+ HID_ReportSizeInfo_t* CurrReportIDInfo = &ParserData->ReportIDSizes[0];
uint16_t UsageList[HID_USAGE_STACK_DEPTH];
uint8_t UsageListSize = 0;
HID_MinMax_t UsageMinMax = {0, 0};
@@ -50,16 +50,16 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
memset(CurrStateTable, 0x00, sizeof(HID_StateTable_t));
memset(CurrReportIDInfo, 0x00, sizeof(HID_ReportSizeInfo_t));
- ParserData->TotalDeviceReports = 1;
+ ParserData->TotalDeviceReports = 1;
while (ReportSize)
{
uint8_t HIDReportItem = *ReportData;
uint32_t ReportItemData = 0;
-
+
ReportData++;
ReportSize--;
-
+
switch (HIDReportItem & DATA_SIZE_MASK)
{
case DATA_SIZE_4:
@@ -84,7 +84,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
case (TYPE_GLOBAL | TAG_GLOBAL_PUSH):
if (CurrStateTable == &StateTable[HID_STATETABLE_STACK_DEPTH - 1])
return HID_PARSE_HIDStackOverflow;
-
+
memcpy((CurrStateTable + 1),
CurrStateTable,
sizeof(HID_ReportItem_t));
@@ -94,7 +94,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
case (TYPE_GLOBAL | TAG_GLOBAL_POP):
if (CurrStateTable == &StateTable[0])
return HID_PARSE_HIDStackUnderflow;
-
+
CurrStateTable--;
break;
case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE):
@@ -139,25 +139,25 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
break;
}
}
-
+
if (CurrReportIDInfo == NULL)
{
if (ParserData->TotalDeviceReports == HID_MAX_REPORT_IDS)
return HID_PARSE_InsufficientReportIDItems;
-
+
CurrReportIDInfo = &ParserData->ReportIDSizes[ParserData->TotalDeviceReports++];
memset(CurrReportIDInfo, 0x00, sizeof(HID_ReportSizeInfo_t));
}
}
-
+
ParserData->UsingReportIDs = true;
-
+
CurrReportIDInfo->ReportID = CurrStateTable->ReportID;
break;
case (TYPE_LOCAL | TAG_LOCAL_USAGE):
if (UsageListSize == HID_USAGE_STACK_DEPTH)
return HID_PARSE_UsageListOverflow;
-
+
UsageList[UsageListSize++] = ReportItemData;
break;
case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
@@ -174,42 +174,42 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
else
{
HID_CollectionPath_t* ParentCollectionPath = CurrCollectionPath;
-
+
CurrCollectionPath = &ParserData->CollectionPaths[1];
-
+
while (CurrCollectionPath->Parent != NULL)
{
if (CurrCollectionPath == &ParserData->CollectionPaths[HID_MAX_COLLECTIONS - 1])
return HID_PARSE_InsufficientCollectionPaths;
-
+
CurrCollectionPath++;
}
-
+
CurrCollectionPath->Parent = ParentCollectionPath;
}
-
+
CurrCollectionPath->Type = ReportItemData;
CurrCollectionPath->Usage.Page = CurrStateTable->Attributes.Usage.Page;
-
+
if (UsageListSize)
{
CurrCollectionPath->Usage.Usage = UsageList[0];
for (uint8_t i = 0; i < UsageListSize; i++)
UsageList[i] = UsageList[i + 1];
-
+
UsageListSize--;
}
else if (UsageMinMax.Minimum <= UsageMinMax.Maximum)
{
CurrCollectionPath->Usage.Usage = UsageMinMax.Minimum++;
}
-
+
break;
case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION):
if (CurrCollectionPath == NULL)
return HID_PARSE_UnexpectedEndCollection;
-
+
CurrCollectionPath = CurrCollectionPath->Parent;
break;
case (TYPE_MAIN | TAG_MAIN_INPUT):
@@ -218,60 +218,60 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
for (uint8_t ReportItemNum = 0; ReportItemNum < CurrStateTable->ReportCount; ReportItemNum++)
{
HID_ReportItem_t NewReportItem;
-
+
memcpy(&NewReportItem.Attributes,
&CurrStateTable->Attributes,
sizeof(HID_ReportItem_Attributes_t));
-
+
NewReportItem.ItemFlags = ReportItemData;
NewReportItem.CollectionPath = CurrCollectionPath;
NewReportItem.ReportID = CurrStateTable->ReportID;
-
+
if (UsageListSize)
{
NewReportItem.Attributes.Usage.Usage = UsageList[0];
-
+
for (uint8_t i = 0; i < UsageListSize; i++)
UsageList[i] = UsageList[i + 1];
-
+
UsageListSize--;
}
else if (UsageMinMax.Minimum <= UsageMinMax.Maximum)
{
NewReportItem.Attributes.Usage.Usage = UsageMinMax.Minimum++;
}
-
+
uint8_t ItemTag = (HIDReportItem & TAG_MASK);
-
+
if (ItemTag == TAG_MAIN_INPUT)
NewReportItem.ItemType = HID_REPORT_ITEM_In;
else if (ItemTag == TAG_MAIN_OUTPUT)
NewReportItem.ItemType = HID_REPORT_ITEM_Out;
else
NewReportItem.ItemType = HID_REPORT_ITEM_Feature;
-
+
NewReportItem.BitOffset = CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType];
-
+
CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType] += CurrStateTable->Attributes.BitSize;
-
+
if (ParserData->LargestReportSizeBits < NewReportItem.BitOffset)
ParserData->LargestReportSizeBits = NewReportItem.BitOffset;
-
+
if (!(ReportItemData & IOF_CONSTANT) && CALLBACK_HIDParser_FilterHIDReportItem(&NewReportItem))
{
if (ParserData->TotalReportItems == HID_MAX_REPORTITEMS)
return HID_PARSE_InsufficientReportItems;
-
+
memcpy(&ParserData->ReportItems[ParserData->TotalReportItems],
&NewReportItem, sizeof(HID_ReportItem_t));
-
+
ParserData->TotalReportItems++;
}
}
-
+
break;
}
-
+
if ((HIDReportItem & TYPE_MASK) == TYPE_MAIN)
{
UsageMinMax.Minimum = 0;
@@ -279,10 +279,10 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
UsageListSize = 0;
}
}
-
+
if (!(ParserData->TotalReportItems))
return HID_PARSE_NoUnfilteredReportItems;
-
+
return HID_PARSE_Successful;
}
@@ -292,27 +292,27 @@ bool USB_GetHIDReportItemInfo(const uint8_t* ReportData,
uint16_t DataBitsRem = ReportItem->Attributes.BitSize;
uint16_t CurrentBit = ReportItem->BitOffset;
uint32_t BitMask = (1 << 0);
-
+
if (ReportItem->ReportID)
{
if (ReportItem->ReportID != ReportData[0])
return false;
-
+
ReportData++;
}
-
+
ReportItem->PreviousValue = ReportItem->Value;
ReportItem->Value = 0;
-
+
while (DataBitsRem--)
{
if (ReportData[CurrentBit / 8] & (1 << (CurrentBit % 8)))
ReportItem->Value |= BitMask;
-
+
CurrentBit++;
BitMask <<= 1;
}
-
+
return true;
}
@@ -322,20 +322,20 @@ void USB_SetHIDReportItemInfo(uint8_t* ReportData,
uint16_t DataBitsRem = ReportItem->Attributes.BitSize;
uint16_t CurrentBit = ReportItem->BitOffset;
uint32_t BitMask = (1 << 0);
-
+
if (ReportItem->ReportID)
{
ReportData[0] = ReportItem->ReportID;
ReportData++;
}
-
+
ReportItem->PreviousValue = ReportItem->Value;
-
+
while (DataBitsRem--)
{
if (ReportItem->Value & (1 << (CurrentBit % 8)))
ReportData[CurrentBit / 8] |= BitMask;
-
+
CurrentBit++;
BitMask <<= 1;
}
@@ -348,7 +348,7 @@ uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData,
for (uint8_t i = 0; i < HID_MAX_REPORT_IDS; i++)
{
uint16_t ReportSizeBits = ParserData->ReportIDSizes[i].ReportSizeBits[ReportType];
-
+
if (ParserData->ReportIDSizes[i].ReportID == ReportID)
return ((ReportSizeBits >> 3) + ((ReportSizeBits & 0x07) ? 1 : 0));
}
@@ -357,3 +357,4 @@ uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData,
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.h b/LUFA/Drivers/USB/Class/Host/HIDParser.h
index f772fed20..ba7346968 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDParser.h
+++ b/LUFA/Drivers/USB/Class/Host/HIDParser.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -35,7 +35,7 @@
* a HID device transmits to the host. It also provides an easy API for extracting and processing the data
* elements inside a HID report sent from an attached HID device.
*/
-
+
/** \ingroup Group_USB
* @defgroup Group_HIDParser HID Report Parser
*
@@ -86,7 +86,7 @@
*/
#define HID_STATETABLE_STACK_DEPTH 2
#endif
-
+
#if !defined(HID_USAGE_STACK_DEPTH) || defined(__DOXYGEN__)
/** Constant indicating the maximum stack depth of the usage table. A larger usage table
* allows for more USAGE items to be indicated sequentially for REPORT COUNT entries of more than
@@ -107,17 +107,17 @@
*/
#define HID_MAX_COLLECTIONS 10
#endif
-
+
#if !defined(HID_MAX_REPORTITEMS) || defined(__DOXYGEN__)
- /** Constant indicating the maximum number of report items (IN, OUT or FEATURE) that can be processed
+ /** Constant indicating the maximum number of report items (IN, OUT or FEATURE) that can be processed
* in the report item descriptor and stored in the user HID Report Info structure. A large value allows
- * for more report items to be stored, but consumes more memory. By default this is set to 20 items,
+ * for more report items to be stored, but consumes more memory. By default this is set to 20 items,
* but this can be overridden by defining HID_MAX_REPORTITEMS to another value in the user project
* makefile, and passing the define to the compiler using the -D compiler switch.
*/
#define HID_MAX_REPORTITEMS 20
#endif
-
+
#if !defined(HID_MAX_REPORT_IDS) || defined(__DOXYGEN__)
/** Constant indicating the maximum number of unique report IDs that can be processed in the report item
* descriptor for the report size information array in the user HID Report Info structure. A large value
@@ -141,12 +141,12 @@
#define HID_ALIGN_DATA(ReportItem, Type) ((Type)(ReportItem->Value << ((8 * sizeof(Type)) - ReportItem->Attributes.BitSize)))
/* Public Interface - May be used in end-application: */
- /* Enums: */
+ /* Enums: */
/** Enum for the possible error codes in the return value of the \ref USB_ProcessHIDReport() function. */
enum HID_Parse_ErrorCodes_t
{
HID_PARSE_Successful = 0, /**< Successful parse of the HID report descriptor, no error. */
- HID_PARSE_HIDStackOverflow = 1, /**< More than \ref HID_STATETABLE_STACK_DEPTH nested PUSHes in the report. */
+ HID_PARSE_HIDStackOverflow = 1, /**< More than \ref HID_STATETABLE_STACK_DEPTH nested PUSHes in the report. */
HID_PARSE_HIDStackUnderflow = 2, /**< A POP was found when the state table stack was empty. */
HID_PARSE_InsufficientReportItems = 3, /**< More than \ref HID_MAX_REPORTITEMS report items in the report. */
HID_PARSE_UnexpectedEndCollection = 4, /**< An END COLLECTION item found without matching COLLECTION item. */
@@ -155,8 +155,8 @@
HID_PARSE_InsufficientReportIDItems = 7, /**< More than \ref HID_MAX_REPORT_IDS report IDs in the device. */
HID_PARSE_NoUnfilteredReportItems = 8, /**< All report items from the device were filtered by the filtering callback routine. */
};
-
- /* Type Defines: */
+
+ /* Type Defines: */
/** \brief HID Parser Report Item Min/Max Structure.
*
* Type define for an attribute with both minimum and maximum values (e.g. Logical Min/Max).
@@ -176,7 +176,7 @@
uint32_t Type; /**< Unit type (refer to HID specifications for details). */
uint8_t Exponent; /**< Unit exponent (refer to HID specifications for details). */
} HID_Unit_t;
-
+
/** \brief HID Parser Report Item Usage Structure.
*
* Type define for the Usage attributes of a report item.
@@ -206,13 +206,13 @@
typedef struct
{
uint8_t BitSize; /**< Size in bits of the report item's data. */
-
+
HID_Usage_t Usage; /**< Usage of the report item. */
HID_Unit_t Unit; /**< Unit type and exponent of the report item. */
HID_MinMax_t Logical; /**< Logical minimum and maximum of the report item. */
HID_MinMax_t Physical; /**< Physical minimum and maximum of the report item. */
} HID_ReportItem_Attributes_t;
-
+
/** \brief HID Parser Report Item Details Structure.
*
* Type define for a report item (IN, OUT or FEATURE) layout attributes and other details.
@@ -226,13 +226,13 @@
HID_CollectionPath_t* CollectionPath; /**< Collection path of the item. */
HID_ReportItem_Attributes_t Attributes; /**< Report item attributes. */
-
+
uint32_t Value; /**< Current value of the report item - use \ref HID_ALIGN_DATA() when processing
* a retrieved value so that it is aligned to a specific type.
*/
- uint32_t PreviousValue; /**< Previous value of the report item. */
+ uint32_t PreviousValue; /**< Previous value of the report item. */
} HID_ReportItem_t;
-
+
/** \brief HID Parser Report Size Structure.
*
* Type define for a report item size information structure, to retain the size of a device's reports by ID.
@@ -267,7 +267,7 @@
* element in its HID report descriptor.
*/
} HID_ReportInfo_t;
-
+
/* Function Prototypes: */
/** Function to process a given HID report returned from an attached device, and store it into a given
* \ref HID_ReportInfo_t structure.
@@ -285,7 +285,7 @@
/** Extracts the given report item's value out of the given HID report and places it into the Value
* member of the report item's \ref HID_ReportItem_t structure.
*
- * When called on a report with an item that exists in that report, this copies the report item's Value
+ * When called on a report with an item that exists in that report, this copies the report item's Value
* to it's PreviousValue element for easy checking to see if an item's value has changed before processing
* a report. If the given item does not exist in the report, the function does not modify the report item's
* data.
@@ -348,7 +348,7 @@
uint8_t ReportID;
} HID_StateTable_t;
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
@@ -357,3 +357,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Host/HIDReportData.h b/LUFA/Drivers/USB/Class/Host/HIDReportData.h
index dca1ebb3a..848bfb5d4 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDReportData.h
+++ b/LUFA/Drivers/USB/Class/Host/HIDReportData.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -42,7 +42,7 @@
*
* @{
*/
-
+
#ifndef __HIDREPORTDATA_H__
#define __HIDREPORTDATA_H__
@@ -107,11 +107,11 @@
#define DATA_SIZE_1 0x01
#define DATA_SIZE_2 0x02
#define DATA_SIZE_4 0x03
-
+
#define TYPE_MAIN 0x00
#define TYPE_GLOBAL 0x04
#define TYPE_LOCAL 0x08
-
+
#define TAG_MAIN_INPUT 0x80
#define TAG_MAIN_OUTPUT 0x90
#define TAG_MAIN_COLLECTION 0xA0
@@ -130,12 +130,13 @@
#define TAG_GLOBAL_REPORTCOUNT 0x90
#define TAG_GLOBAL_PUSH 0xA0
#define TAG_GLOBAL_POP 0xB0
-
+
#define TAG_LOCAL_USAGE 0x00
#define TAG_LOCAL_USAGEMIN 0x10
#define TAG_LOCAL_USAGEMAX 0x20
#endif
/** @} */
-
+
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.c b/LUFA/Drivers/USB/Class/Host/MIDI.c
index cf59193c2..99ae8a8ab 100644
--- a/LUFA/Drivers/USB/Class/Host/MIDI.c
+++ b/LUFA/Drivers/USB/Class/Host/MIDI.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -68,7 +68,7 @@ uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceI
continue;
}
-
+
USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
@@ -76,7 +76,7 @@ uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceI
else
DataOUTEndpoint = EndpointData;
}
-
+
for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
{
if (PipeNum == MIDIInterfaceInfo->Config.DataINPipeNumber)
@@ -84,16 +84,16 @@ uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceI
Pipe_ConfigurePipe(PipeNum, EP_TYPE_BULK, PIPE_TOKEN_IN,
DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize,
MIDIInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
-
- MIDIInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
+
+ MIDIInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
}
else if (PipeNum == MIDIInterfaceInfo->Config.DataOUTPipeNumber)
{
Pipe_ConfigurePipe(PipeNum, EP_TYPE_BULK, PIPE_TOKEN_OUT,
DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize,
MIDIInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
-
- MIDIInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
+
+ MIDIInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
}
}
@@ -117,7 +117,7 @@ static uint8_t DCOMP_MIDI_Host_NextMIDIStreamingInterface(void* const CurrentDes
return DESCRIPTOR_SEARCH_Found;
}
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -127,9 +127,9 @@ static uint8_t DCOMP_MIDI_Host_NextMIDIStreamingDataEndpoint(void* const Current
{
USB_Descriptor_Endpoint_t* CurrentEndpoint = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Endpoint_t);
-
+
uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);
-
+
if ((EndpointType == EP_TYPE_BULK) && !(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress)))
return DESCRIPTOR_SEARCH_Found;
}
@@ -145,7 +145,7 @@ uint8_t MIDI_Host_Flush(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)
{
if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive))
return PIPE_RWSTREAM_DeviceDisconnected;
-
+
uint8_t ErrorCode;
Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipeNumber);
@@ -166,7 +166,7 @@ uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface
{
if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive))
return HOST_SENDCONTROL_DeviceDisconnected;
-
+
Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipeNumber);
if (Pipe_IsReadWriteAllowed())
@@ -179,7 +179,7 @@ uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface
if (!(Pipe_IsReadWriteAllowed()))
Pipe_ClearOUT();
}
-
+
return PIPE_RWSTREAM_NoError;
}
@@ -188,7 +188,7 @@ bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface
{
if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive))
return HOST_SENDCONTROL_DeviceDisconnected;
-
+
Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataINPipeNumber);
if (!(Pipe_IsReadWriteAllowed()))
@@ -198,8 +198,9 @@ bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface
if (!(Pipe_IsReadWriteAllowed()))
Pipe_ClearIN();
-
+
return true;
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.h b/LUFA/Drivers/USB/Class/Host/MIDI.h
index 4aa6eb8e5..e77487db4 100644
--- a/LUFA/Drivers/USB/Class/Host/MIDI.h
+++ b/LUFA/Drivers/USB/Class/Host/MIDI.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -56,7 +56,7 @@
/* Includes: */
#include "../../USB.h"
#include "../Common/MIDI.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -66,7 +66,7 @@
#if !defined(__INCLUDE_FROM_MIDI_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/MIDI.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** \brief MIDI Class Host Mode Configuration and State Structure.
@@ -81,7 +81,7 @@
{
uint8_t DataINPipeNumber; /**< Pipe number of the MIDI interface's streaming IN data pipe. */
bool DataINPipeDoubleBank; /**< Indicates if the MIDI interface's IN data pipe should use double banking. */
-
+
uint8_t DataOUTPipeNumber; /**< Pipe number of the MIDI interface's streaming OUT data pipe. */
bool DataOUTPipeDoubleBank; /**< Indicates if the MIDI interface's OUT data pipe should use double banking. */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
@@ -102,7 +102,7 @@
* the interface is enumerated.
*/
} USB_ClassInfo_MIDI_Host_t;
-
+
/* Enums: */
/** Enum for the possible error codes returned by the \ref MIDI_Host_ConfigurePipes() function. */
enum MIDI_Host_EnumerationFailure_ErrorCodes_t
@@ -111,7 +111,7 @@
MIDI_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
MIDI_ENUMERROR_NoCompatibleInterfaceFound = 2, /**< A compatible MIDI interface was not found in the device's Configuration Descriptor. */
};
-
+
/* Function Prototypes: */
/** Host interface configuration routine, to configure a given MIDI host interface instance using the Configuration
* Descriptor read from an attached USB device. This function automatically updates the given MIDI Host instance's
@@ -156,7 +156,7 @@
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum.
*/
uint8_t MIDI_Host_Flush(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Receives a MIDI event packet from the device.
*
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
@@ -193,9 +193,9 @@
#if defined(__INCLUDE_FROM_MIDI_CLASS_HOST_C)
static uint8_t DCOMP_MIDI_Host_NextMIDIStreamingInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DCOMP_MIDI_Host_NextMIDIStreamingDataEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
- #endif
+ #endif
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
@@ -204,3 +204,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c
index 2d7956e9f..26d096b4f 100644
--- a/LUFA/Drivers/USB/Class/Host/MassStorage.c
+++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -68,7 +68,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
continue;
}
-
+
USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
@@ -76,7 +76,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
else
DataOUTEndpoint = EndpointData;
}
-
+
for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
{
if (PipeNum == MSInterfaceInfo->Config.DataINPipeNumber)
@@ -84,16 +84,16 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
Pipe_ConfigurePipe(PipeNum, EP_TYPE_BULK, PIPE_TOKEN_IN,
DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize,
MSInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
-
- MSInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
+
+ MSInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
}
else if (PipeNum == MSInterfaceInfo->Config.DataOUTPipeNumber)
{
Pipe_ConfigurePipe(PipeNum, EP_TYPE_BULK, PIPE_TOKEN_OUT,
DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize,
MSInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
-
- MSInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
+
+ MSInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
}
}
@@ -117,7 +117,7 @@ static uint8_t DCOMP_MS_Host_NextMSInterface(void* const CurrentDescriptor)
return DESCRIPTOR_SEARCH_Found;
}
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -174,7 +174,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
Pipe_Freeze();
return ErrorCode;
}
-
+
return ErrorCode;
}
@@ -189,7 +189,7 @@ static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInte
while (!(Pipe_IsINReceived()))
{
uint16_t CurrentFrameNumber = USB_Host_GetFrameNumber();
-
+
if (CurrentFrameNumber != PreviousFrameNumber)
{
PreviousFrameNumber = CurrentFrameNumber;
@@ -197,7 +197,7 @@ static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInte
if (!(TimeoutMSRem--))
return PIPE_RWSTREAM_Timeout;
}
-
+
Pipe_Freeze();
Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
@@ -208,7 +208,7 @@ static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInte
return PIPE_RWSTREAM_PipeStalled;
}
-
+
Pipe_Freeze();
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
@@ -219,14 +219,14 @@ static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInte
return PIPE_RWSTREAM_PipeStalled;
}
-
+
if (USB_HostState == HOST_STATE_Unattached)
return PIPE_RWSTREAM_DeviceDisconnected;
};
-
+
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
Pipe_Freeze();
-
+
Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Freeze();
@@ -250,7 +250,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* const MSInterfac
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
-
+
if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
@@ -265,7 +265,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* const MSInterfac
return ErrorCode;
Pipe_ClearOUT();
-
+
while (!(Pipe_IsOUTReady()))
{
if (USB_HostState == HOST_STATE_Unattached)
@@ -288,19 +288,19 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* const MSInterf
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
-
+
if ((ErrorCode = Pipe_Read_Stream_LE(SCSICommandStatus, sizeof(MS_CommandStatusWrapper_t),
NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
{
return ErrorCode;
}
-
+
Pipe_ClearIN();
Pipe_Freeze();
-
+
if (SCSICommandStatus->Status != MS_SCSI_COMMAND_Pass)
ErrorCode = MS_ERROR_LOGICAL_CMD_FAILED;
-
+
return ErrorCode;
}
@@ -314,7 +314,7 @@ uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
.wIndex = MSInterfaceInfo->State.InterfaceNumber,
.wLength = 0,
};
-
+
Pipe_SelectPipe(PIPE_CONTROLPIPE);
return USB_Host_SendControlRequest(NULL);
@@ -333,7 +333,7 @@ uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
.wIndex = MSInterfaceInfo->State.InterfaceNumber,
.wLength = 1,
};
-
+
Pipe_SelectPipe(PIPE_CONTROLPIPE);
if ((ErrorCode = USB_Host_SendControlRequest(MaxLUNIndex)) != HOST_SENDCONTROL_Successful)
@@ -341,7 +341,7 @@ uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
*MaxLUNIndex = 0;
ErrorCode = HOST_SENDCONTROL_Successful;
}
-
+
return ErrorCode;
}
@@ -351,7 +351,7 @@ uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
{
if ((USB_HostState != HOST_STATE_Configured) || !(MSInterfaceInfo->State.IsActive))
return HOST_SENDCONTROL_DeviceDisconnected;
-
+
uint8_t ErrorCode;
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)
@@ -370,12 +370,12 @@ uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
0x00 // Unused (control)
}
};
-
+
MS_CommandStatusWrapper_t SCSICommandStatus;
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, InquiryData)) != PIPE_RWSTREAM_NoError)
- return ErrorCode;
-
+ return ErrorCode;
+
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
@@ -406,12 +406,12 @@ uint8_t MS_Host_TestUnitReady(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
0x00 // Unused (control)
}
};
-
+
MS_CommandStatusWrapper_t SCSICommandStatus;
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, NULL)) != PIPE_RWSTREAM_NoError)
- return ErrorCode;
-
+ return ErrorCode;
+
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
@@ -447,7 +447,7 @@ uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
0x00 // Unused (control)
}
};
-
+
MS_CommandStatusWrapper_t SCSICommandStatus;
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, DeviceCapacity)) != PIPE_RWSTREAM_NoError)
@@ -455,7 +455,7 @@ uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
SwapEndian_n(&DeviceCapacity->Blocks, sizeof(DeviceCapacity->Blocks));
SwapEndian_n(&DeviceCapacity->BlockSize, sizeof(DeviceCapacity->BlockSize));
-
+
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
@@ -487,7 +487,7 @@ uint8_t MS_Host_RequestSense(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
0x00 // Unused (control)
}
};
-
+
MS_CommandStatusWrapper_t SCSICommandStatus;
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, SenseData)) != PIPE_RWSTREAM_NoError)
@@ -524,12 +524,12 @@ uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* const MSInter
0x00 // Unused (control)
}
};
-
+
MS_CommandStatusWrapper_t SCSICommandStatus;
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, NULL)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
-
+
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
@@ -617,7 +617,7 @@ uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo
if ((ErrorCode = MS_Host_SendCommand(MSInterfaceInfo, &SCSICommandBlock, BlockBuffer)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
-
+
if ((ErrorCode = MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSICommandStatus)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
@@ -625,3 +625,4 @@ uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.h b/LUFA/Drivers/USB/Class/Host/MassStorage.h
index 4feac0e7b..f442db846 100644
--- a/LUFA/Drivers/USB/Class/Host/MassStorage.h
+++ b/LUFA/Drivers/USB/Class/Host/MassStorage.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -56,7 +56,7 @@
/* Includes: */
#include "../../USB.h"
#include "../Common/MassStorage.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -71,7 +71,7 @@
/* Macros: */
/** Error code for some Mass Storage Host functions, indicating a logical (and not hardware) error. */
#define MS_ERROR_LOGICAL_CMD_FAILED 0x80
-
+
/* Type Defines: */
/** \brief Mass Storage Class Host Mode Configuration and State Structure.
*
@@ -101,14 +101,14 @@
uint16_t DataINPipeSize; /**< Size in bytes of the Mass Storage interface's IN data pipe. */
uint16_t DataOUTPipeSize; /**< Size in bytes of the Mass Storage interface's OUT data pipe. */
-
+
uint32_t TransactionTag; /**< Current transaction tag for data synchronizing of packets. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
* the interface is enumerated.
*/
} USB_ClassInfo_MS_Host_t;
-
+
/** \brief SCSI Device LUN Capacity Structure.
*
* SCSI capacity structure, to hold the total capacity of the device in both the number
@@ -128,7 +128,7 @@
MS_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
MS_ENUMERROR_NoCompatibleInterfaceFound = 2, /**< A compatible Mass Storage interface was not found in the device's Configuration Descriptor. */
};
-
+
/* Function Prototypes: */
/** Host interface configuration routine, to configure a given Mass Storage host interface instance using the
* Configuration Descriptor read from an attached USB device. This function automatically updates the given Mass
@@ -217,7 +217,7 @@
const uint8_t LUNIndex,
SCSI_Capacity_t* const DeviceCapacity) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(3);
-
+
/** Retrieves the device sense data, indicating the current device state and error codes for the previously
* issued command.
*
@@ -234,7 +234,7 @@
const uint8_t LUNIndex,
SCSI_Request_Sense_Response_t* const SenseData) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(3);
-
+
/** 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.
*
@@ -250,7 +250,7 @@
uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
const uint8_t LUNIndex,
const bool PreventRemoval) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Reads blocks of data from the attached Mass Storage device's medium.
*
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
@@ -271,7 +271,7 @@
const uint8_t Blocks,
const uint16_t BlockSize,
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.
*
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
@@ -318,22 +318,22 @@
#define CBW_SIGNATURE 0x43425355UL
#define CSW_SIGNATURE 0x53425355UL
-
+
#define COMMAND_DIRECTION_DATA_OUT (0 << 7)
#define COMMAND_DIRECTION_DATA_IN (1 << 7)
-
+
#define COMMAND_DATA_TIMEOUT_MS 10000
-
+
/* Function Prototypes: */
- #if defined(__INCLUDE_FROM_MS_CLASS_HOST_C)
+ #if defined(__INCLUDE_FROM_MS_CLASS_HOST_C)
static uint8_t DCOMP_MS_Host_NextMSInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DCOMP_MS_Host_NextMSInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
-
+
static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
MS_CommandBlockWrapper_t* const SCSICommandBlock,
const void* const BufferPtr) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
- static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
+ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
MS_CommandBlockWrapper_t* const SCSICommandBlock,
void* BufferPtr) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
@@ -341,7 +341,7 @@
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
#endif
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
@@ -350,3 +350,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Host/Printer.c b/LUFA/Drivers/USB/Class/Host/Printer.c
index 2c9a4eb8b..6cbd892dc 100644
--- a/LUFA/Drivers/USB/Class/Host/Printer.c
+++ b/LUFA/Drivers/USB/Class/Host/Printer.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -48,7 +48,7 @@ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI
if (DESCRIPTOR_TYPE(DeviceConfigDescriptor) != DTYPE_Configuration)
return PRNT_ENUMERROR_InvalidConfigDescriptor;
-
+
while (!(DataINEndpoint) || !(DataOUTEndpoint))
{
if (!(PrinterInterface) ||
@@ -60,15 +60,15 @@ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI
{
return PRNT_ENUMERROR_NoCompatibleInterfaceFound;
}
-
- PrinterInterface = DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t);
+
+ PrinterInterface = DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t);
DataINEndpoint = NULL;
DataOUTEndpoint = NULL;
continue;
}
-
+
USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Endpoint_t);
if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
@@ -76,7 +76,7 @@ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI
else
DataOUTEndpoint = EndpointData;
}
-
+
for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
{
if (PipeNum == PRNTInterfaceInfo->Config.DataINPipeNumber)
@@ -84,16 +84,16 @@ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI
Pipe_ConfigurePipe(PipeNum, EP_TYPE_BULK, PIPE_TOKEN_IN,
DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize,
PRNTInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
-
- PRNTInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
+
+ PRNTInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
}
else if (PipeNum == PRNTInterfaceInfo->Config.DataOUTPipeNumber)
{
Pipe_ConfigurePipe(PipeNum, EP_TYPE_BULK, PIPE_TOKEN_OUT,
DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize,
PRNTInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);
-
- PRNTInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
+
+ PRNTInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
}
}
@@ -118,7 +118,7 @@ static uint8_t DCOMP_PRNT_Host_NextPRNTInterface(void* CurrentDescriptor)
return DESCRIPTOR_SEARCH_Found;
}
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -150,7 +150,7 @@ uint8_t PRNT_Host_SetBidirectionalMode(USB_ClassInfo_PRNT_Host_t* const PRNTInte
if (PRNTInterfaceInfo->State.AlternateSetting)
{
uint8_t ErrorCode;
-
+
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE),
@@ -159,13 +159,13 @@ uint8_t PRNT_Host_SetBidirectionalMode(USB_ClassInfo_PRNT_Host_t* const PRNTInte
.wIndex = PRNTInterfaceInfo->State.InterfaceNumber,
.wLength = 0,
};
-
+
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
}
-
+
return HOST_SENDCONTROL_Successful;
}
@@ -206,12 +206,12 @@ uint8_t PRNT_Host_Flush(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)
{
if ((USB_HostState != HOST_STATE_Configured) || !(PRNTInterfaceInfo->State.IsActive))
return PIPE_READYWAIT_DeviceDisconnected;
-
+
uint8_t ErrorCode;
- Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
-
+
if (!(Pipe_BytesInPipe()))
return PIPE_READYWAIT_NoError;
@@ -228,7 +228,7 @@ uint8_t PRNT_Host_Flush(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)
}
Pipe_Freeze();
-
+
return PIPE_READYWAIT_NoError;
}
@@ -237,12 +237,12 @@ uint8_t PRNT_Host_SendByte(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
{
if ((USB_HostState != HOST_STATE_Configured) || !(PRNTInterfaceInfo->State.IsActive))
return PIPE_READYWAIT_DeviceDisconnected;
-
+
uint8_t ErrorCode;
- Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
-
+
if (!(Pipe_IsReadWriteAllowed()))
{
Pipe_ClearOUT();
@@ -251,9 +251,9 @@ uint8_t PRNT_Host_SendByte(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
return ErrorCode;
}
- Pipe_Write_Byte(Data);
+ Pipe_Write_Byte(Data);
Pipe_Freeze();
-
+
return PIPE_READYWAIT_NoError;
}
@@ -268,14 +268,14 @@ uint8_t PRNT_Host_SendString(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
-
+
if ((ErrorCode = Pipe_Write_Stream_LE(Buffer, Length, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
Pipe_ClearOUT();
-
+
ErrorCode = Pipe_WaitUntilReady();
-
+
Pipe_Freeze();
return ErrorCode;
@@ -285,7 +285,7 @@ uint16_t PRNT_Host_BytesReceived(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI
{
if ((USB_HostState != HOST_STATE_Configured) || !(PRNTInterfaceInfo->State.IsActive))
return 0;
-
+
Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
@@ -306,7 +306,7 @@ uint16_t PRNT_Host_BytesReceived(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI
else
{
Pipe_Freeze();
-
+
return 0;
}
}
@@ -329,7 +329,7 @@ int16_t PRNT_Host_ReceiveByte(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo
if (!(Pipe_BytesInPipe()))
Pipe_ClearIN();
}
-
+
Pipe_Freeze();
return ReceivedByte;
@@ -350,33 +350,34 @@ uint8_t PRNT_Host_GetDeviceID(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo
.wIndex = PRNTInterfaceInfo->State.InterfaceNumber,
.wLength = sizeof(DeviceIDStringLength),
};
-
+
Pipe_SelectPipe(PIPE_CONTROLPIPE);
if ((ErrorCode = USB_Host_SendControlRequest(&DeviceIDStringLength)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
-
+
if (!(DeviceIDStringLength))
{
DeviceIDString[0] = 0x00;
return HOST_SENDCONTROL_Successful;
}
-
+
DeviceIDStringLength = SwapEndian_16(DeviceIDStringLength);
if (DeviceIDStringLength > BufferSize)
DeviceIDStringLength = BufferSize;
USB_ControlRequest.wLength = DeviceIDStringLength;
-
+
if ((ErrorCode = USB_Host_SendControlRequest(DeviceIDString)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
-
+
memmove(&DeviceIDString[0], &DeviceIDString[2], DeviceIDStringLength - 2);
DeviceIDString[DeviceIDStringLength - 2] = 0x00;
-
+
return HOST_SENDCONTROL_Successful;
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Host/Printer.h b/LUFA/Drivers/USB/Class/Host/Printer.h
index b6298daae..96ecd0fd6 100644
--- a/LUFA/Drivers/USB/Class/Host/Printer.h
+++ b/LUFA/Drivers/USB/Class/Host/Printer.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -56,7 +56,7 @@
/* Includes: */
#include "../../USB.h"
#include "../Common/Printer.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -111,7 +111,7 @@
PRNT_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
PRNT_ENUMERROR_NoCompatibleInterfaceFound = 2, /**< A compatible Printer interface was not found in the device's Configuration Descriptor. */
};
-
+
/* Function Prototypes: */
/** General management task for a given Printer host class interface, required for the correct operation of
* the interface. This should be called frequently in the main program loop, before the master USB management task
@@ -140,7 +140,7 @@
uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
uint16_t ConfigDescriptorSize,
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
-
+
/** Configures the printer to enable Bidirectional mode, if it is not already in this mode. This should be called
* once the connected device's configuration has been set, to ensure the printer is ready to accept commands.
*
@@ -149,7 +149,7 @@
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
*/
uint8_t PRNT_Host_SetBidirectionalMode(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** Retrieves the status of the virtual Printer port's inbound status lines. The result can then be masked against the
* PRNT_PORTSTATUS_* macros to determine the printer port's status.
*
@@ -195,12 +195,12 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/
uint8_t PRNT_Host_SendString(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
- void* Buffer,
+ void* Buffer,
const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
/** Sends a given byte to the attached USB device, if connected. If a device is not connected when the function is called, the
* byte is discarded. Bytes will be queued for transmission to the device until either the pipe bank becomes full, or the
- * \ref PRNT_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
+ * \ref PRNT_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
* packed into a single pipe packet, increasing data throughput.
*
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
@@ -226,8 +226,8 @@
*
* \return Total number of buffered bytes received from the device.
*/
- uint16_t PRNT_Host_BytesReceived(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo);
-
+ uint16_t PRNT_Host_BytesReceived(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo);
+
/** Reads a byte of data from the device. If no data is waiting to be read of if a USB device is not connected, the function
* returns a negative value. The \ref PRNT_Host_BytesReceived() function may be queried in advance to determine how many bytes
* are currently buffered in the Printer interface's data receive pipe.
@@ -240,7 +240,7 @@
* \return Next received byte from the device, or a negative value if no data received.
*/
int16_t PRNT_Host_ReceiveByte(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo);
-
+
/** Retrieves the attached printer device's ID string, formatted according to IEEE 1284. This string is sent as a
* Unicode string from the device and is automatically converted to an ASCII encoded C string by this function, thus
* the maximum reportable string length is two less than the size given (to accommodate the Unicode string length
@@ -268,14 +268,14 @@
#define REQ_GetDeviceID 0
#define REQ_GetPortStatus 1
#define REQ_SoftReset 2
-
+
/* Function Prototypes: */
- #if defined(__INCLUDE_FROM_PRINTER_CLASS_HOST_C)
+ #if defined(__INCLUDE_FROM_PRINTER_CLASS_HOST_C)
static uint8_t DCOMP_PRNT_Host_NextPRNTInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DCOMP_PRNT_Host_NextPRNTInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
@@ -284,3 +284,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.c b/LUFA/Drivers/USB/Class/Host/RNDIS.c
index 7663b6301..541b7d3d1 100644
--- a/LUFA/Drivers/USB/Class/Host/RNDIS.c
+++ b/LUFA/Drivers/USB/Class/Host/RNDIS.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -64,7 +64,7 @@ uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfa
DCOMP_RNDIS_Host_NextRNDISDataInterface) != DESCRIPTOR_SEARCH_COMP_Found)
{
return RNDIS_ENUMERROR_NoCompatibleInterfaceFound;
- }
+ }
DataINEndpoint = NULL;
DataOUTEndpoint = NULL;
@@ -76,15 +76,15 @@ uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfa
{
return RNDIS_ENUMERROR_NoCompatibleInterfaceFound;
}
-
+
RNDISControlInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t);
NotificationEndpoint = NULL;
}
-
+
continue;
}
-
+
USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
@@ -99,7 +99,7 @@ uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfa
DataOUTEndpoint = EndpointData;
}
}
-
+
for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
{
if (PipeNum == RNDISInterfaceInfo->Config.DataINPipeNumber)
@@ -141,7 +141,7 @@ static uint8_t DCOMP_RNDIS_Host_NextRNDISControlInterface(void* const CurrentDes
{
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Interface_t);
-
+
if ((CurrentInterface->Class == RNDIS_CONTROL_CLASS) &&
(CurrentInterface->SubClass == RNDIS_CONTROL_SUBCLASS) &&
(CurrentInterface->Protocol == RNDIS_CONTROL_PROTOCOL))
@@ -149,7 +149,7 @@ static uint8_t DCOMP_RNDIS_Host_NextRNDISControlInterface(void* const CurrentDes
return DESCRIPTOR_SEARCH_Found;
}
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -159,7 +159,7 @@ static uint8_t DCOMP_RNDIS_Host_NextRNDISDataInterface(void* const CurrentDescri
{
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Interface_t);
-
+
if ((CurrentInterface->Class == RNDIS_DATA_CLASS) &&
(CurrentInterface->SubClass == RNDIS_DATA_SUBCLASS) &&
(CurrentInterface->Protocol == RNDIS_DATA_PROTOCOL))
@@ -167,7 +167,7 @@ static uint8_t DCOMP_RNDIS_Host_NextRNDISDataInterface(void* const CurrentDescri
return DESCRIPTOR_SEARCH_Found;
}
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -177,9 +177,9 @@ static uint8_t DCOMP_RNDIS_Host_NextRNDISInterfaceEndpoint(void* const CurrentDe
{
USB_Descriptor_Endpoint_t* CurrentEndpoint = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Endpoint_t);
-
+
uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);
-
+
if (((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT)) &&
!(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress)))
{
@@ -223,7 +223,7 @@ static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const R
.wIndex = RNDISInterfaceInfo->State.ControlInterfaceNumber,
.wLength = Length,
};
-
+
Pipe_SelectPipe(PIPE_CONTROLPIPE);
return USB_Host_SendControlRequest(Buffer);
}
@@ -234,7 +234,7 @@ uint8_t RNDIS_Host_SendKeepAlive(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfac
RNDIS_KeepAlive_Message_t KeepAliveMessage;
RNDIS_KeepAlive_Complete_t KeepAliveMessageResponse;
-
+
KeepAliveMessage.MessageType = REMOTE_NDIS_KEEPALIVE_MSG;
KeepAliveMessage.MessageLength = sizeof(RNDIS_KeepAlive_Message_t);
KeepAliveMessage.RequestId = RNDISInterfaceInfo->State.RequestID++;
@@ -244,13 +244,13 @@ uint8_t RNDIS_Host_SendKeepAlive(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfac
{
return ErrorCode;
}
-
+
if ((ErrorCode = RNDIS_GetEncapsulatedResponse(RNDISInterfaceInfo, &KeepAliveMessageResponse,
sizeof(RNDIS_KeepAlive_Complete_t))) != HOST_SENDCONTROL_Successful)
{
return ErrorCode;
}
-
+
return HOST_SENDCONTROL_Successful;
}
@@ -268,13 +268,13 @@ uint8_t RNDIS_Host_InitializeDevice(USB_ClassInfo_RNDIS_Host_t* const RNDISInter
InitMessage.MajorVersion = REMOTE_NDIS_VERSION_MAJOR;
InitMessage.MinorVersion = REMOTE_NDIS_VERSION_MINOR;
InitMessage.MaxTransferSize = RNDISInterfaceInfo->Config.HostMaxPacketSize;
-
+
if ((ErrorCode = RNDIS_SendEncapsulatedCommand(RNDISInterfaceInfo, &InitMessage,
sizeof(RNDIS_Initialize_Message_t))) != HOST_SENDCONTROL_Successful)
{
return ErrorCode;
}
-
+
if ((ErrorCode = RNDIS_GetEncapsulatedResponse(RNDISInterfaceInfo, &InitMessageResponse,
sizeof(RNDIS_Initialize_Complete_t))) != HOST_SENDCONTROL_Successful)
{
@@ -283,9 +283,9 @@ uint8_t RNDIS_Host_InitializeDevice(USB_ClassInfo_RNDIS_Host_t* const RNDISInter
if (InitMessageResponse.Status != REMOTE_NDIS_STATUS_SUCCESS)
return RNDIS_COMMAND_FAILED;
-
+
RNDISInterfaceInfo->State.DeviceMaxPacketSize = InitMessageResponse.MaxTransferSize;
-
+
return HOST_SENDCONTROL_Successful;
}
@@ -301,18 +301,18 @@ uint8_t RNDIS_Host_SetRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInter
RNDIS_Set_Message_t SetMessage;
uint8_t ContiguousBuffer[Length];
} SetMessageData;
-
+
RNDIS_Set_Complete_t SetMessageResponse;
-
+
SetMessageData.SetMessage.MessageType = REMOTE_NDIS_SET_MSG;
SetMessageData.SetMessage.MessageLength = sizeof(RNDIS_Set_Message_t) + Length;
SetMessageData.SetMessage.RequestId = RNDISInterfaceInfo->State.RequestID++;
-
+
SetMessageData.SetMessage.Oid = Oid;
SetMessageData.SetMessage.InformationBufferLength = Length;
SetMessageData.SetMessage.InformationBufferOffset = (sizeof(RNDIS_Set_Message_t) - sizeof(RNDIS_Message_Header_t));
SetMessageData.SetMessage.DeviceVcHandle = 0;
-
+
memcpy(&SetMessageData.ContiguousBuffer, Buffer, Length);
if ((ErrorCode = RNDIS_SendEncapsulatedCommand(RNDISInterfaceInfo, &SetMessageData,
@@ -320,7 +320,7 @@ uint8_t RNDIS_Host_SetRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInter
{
return ErrorCode;
}
-
+
if ((ErrorCode = RNDIS_GetEncapsulatedResponse(RNDISInterfaceInfo, &SetMessageResponse,
sizeof(RNDIS_Set_Complete_t))) != HOST_SENDCONTROL_Successful)
{
@@ -329,7 +329,7 @@ uint8_t RNDIS_Host_SetRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInter
if (SetMessageResponse.Status != REMOTE_NDIS_STATUS_SUCCESS)
return RNDIS_COMMAND_FAILED;
-
+
return HOST_SENDCONTROL_Successful;
}
@@ -351,7 +351,7 @@ uint8_t RNDIS_Host_QueryRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInt
QueryMessage.MessageType = REMOTE_NDIS_QUERY_MSG;
QueryMessage.MessageLength = sizeof(RNDIS_Query_Message_t);
QueryMessage.RequestId = RNDISInterfaceInfo->State.RequestID++;
-
+
QueryMessage.Oid = Oid;
QueryMessage.InformationBufferLength = 0;
QueryMessage.InformationBufferOffset = 0;
@@ -362,7 +362,7 @@ uint8_t RNDIS_Host_QueryRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInt
{
return ErrorCode;
}
-
+
if ((ErrorCode = RNDIS_GetEncapsulatedResponse(RNDISInterfaceInfo, &QueryMessageResponseData,
sizeof(QueryMessageResponseData))) != HOST_SENDCONTROL_Successful)
{
@@ -385,11 +385,11 @@ bool RNDIS_Host_IsPacketReceived(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfac
return false;
Pipe_SelectPipe(RNDISInterfaceInfo->Config.DataINPipeNumber);
-
+
Pipe_Unfreeze();
- PacketWaiting = Pipe_IsINReceived();
+ PacketWaiting = Pipe_IsINReceived();
Pipe_Freeze();
-
+
return PacketWaiting;
}
@@ -404,19 +404,19 @@ uint8_t RNDIS_Host_ReadPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceIn
Pipe_SelectPipe(RNDISInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
-
+
if (!(Pipe_IsReadWriteAllowed()))
{
if (Pipe_IsINReceived())
Pipe_ClearIN();
-
+
*PacketLength = 0;
Pipe_Freeze();
return PIPE_RWSTREAM_NoError;
}
RNDIS_Packet_Message_t DeviceMessage;
-
+
if ((ErrorCode = Pipe_Read_Stream_LE(&DeviceMessage, sizeof(RNDIS_Packet_Message_t),
NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
{
@@ -424,17 +424,17 @@ uint8_t RNDIS_Host_ReadPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceIn
}
*PacketLength = (uint16_t)DeviceMessage.DataLength;
-
+
Pipe_Discard_Stream(DeviceMessage.DataOffset - (sizeof(RNDIS_Packet_Message_t) - sizeof(RNDIS_Message_Header_t)),
NO_STREAM_CALLBACK);
-
+
Pipe_Read_Stream_LE(Buffer, *PacketLength, NO_STREAM_CALLBACK);
-
+
if (!(Pipe_BytesInPipe()))
Pipe_ClearIN();
Pipe_Freeze();
-
+
return PIPE_RWSTREAM_NoError;
}
@@ -454,7 +454,7 @@ uint8_t RNDIS_Host_SendPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceIn
DeviceMessage.MessageLength = (sizeof(RNDIS_Packet_Message_t) + PacketLength);
DeviceMessage.DataOffset = (sizeof(RNDIS_Packet_Message_t) - sizeof(RNDIS_Message_Header_t));
DeviceMessage.DataLength = PacketLength;
-
+
Pipe_SelectPipe(RNDISInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
@@ -468,8 +468,9 @@ uint8_t RNDIS_Host_SendPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceIn
Pipe_ClearOUT();
Pipe_Freeze();
-
+
return PIPE_RWSTREAM_NoError;
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.h b/LUFA/Drivers/USB/Class/Host/RNDIS.h
index 71f96eb5d..5ff2e1b84 100644
--- a/LUFA/Drivers/USB/Class/Host/RNDIS.h
+++ b/LUFA/Drivers/USB/Class/Host/RNDIS.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -60,7 +60,7 @@
#include <stdio.h>
#include <string.h>
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -89,9 +89,9 @@
uint8_t DataOUTPipeNumber; /**< Pipe number of the RNDIS interface's OUT data pipe. */
bool DataOUTPipeDoubleBank; /**< Indicates if the RNDIS interface's OUT data pipe should use double banking. */
- uint8_t NotificationPipeNumber; /**< Pipe number of the RNDIS interface's IN notification endpoint, if used. */
+ uint8_t NotificationPipeNumber; /**< Pipe number of the RNDIS interface's IN notification endpoint, if used. */
bool NotificationPipeDoubleBank; /**< Indicates if the RNDIS interface's notification pipe should use double banking. */
-
+
uint32_t HostMaxPacketSize; /**< Maximum size of a packet which can be buffered by the host. */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
@@ -103,20 +103,20 @@
* Configured state.
*/
uint8_t ControlInterfaceNumber; /**< Interface index of the RNDIS control interface within the attached device. */
-
+
uint16_t DataINPipeSize; /**< Size in bytes of the RNDIS interface's IN data pipe. */
uint16_t DataOUTPipeSize; /**< Size in bytes of the RNDIS interface's OUT data pipe. */
- uint16_t NotificationPipeSize; /**< Size in bytes of the RNDIS interface's IN notification pipe, if used. */
+ uint16_t NotificationPipeSize; /**< Size in bytes of the RNDIS interface's IN notification pipe, if used. */
uint32_t DeviceMaxPacketSize; /**< Maximum size of a packet which can be buffered by the attached RNDIS device. */
-
+
uint32_t RequestID; /**< Request ID counter to give a unique ID for each command/response pair. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
* the interface is enumerated.
*/
} USB_ClassInfo_RNDIS_Host_t;
-
+
/* Enums: */
/** Enum for the possible error codes returned by the \ref RNDIS_Host_ConfigurePipes() function. */
enum RNDIS_Host_EnumerationFailure_ErrorCodes_t
@@ -211,7 +211,7 @@
* \return Boolean true if a packet is waiting to be read in by the host, false otherwise.
*/
bool RNDIS_Host_IsPacketReceived(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-
+
/** 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.
*
@@ -268,7 +268,7 @@
/* Function Prototypes: */
#if defined(__INCLUDE_FROM_RNDIS_CLASS_HOST_C)
- static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
+ static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
void* Buffer,
const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(2);
@@ -291,3 +291,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.c b/LUFA/Drivers/USB/Class/Host/StillImage.c
index c3ade3b55..f7f8637a2 100644
--- a/LUFA/Drivers/USB/Class/Host/StillImage.c
+++ b/LUFA/Drivers/USB/Class/Host/StillImage.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -46,7 +46,7 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
USB_Descriptor_Interface_t* StillImageInterface = NULL;
memset(&SIInterfaceInfo->State, 0x00, sizeof(SIInterfaceInfo->State));
-
+
if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
return SI_ENUMERROR_InvalidConfigDescriptor;
@@ -63,7 +63,7 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
}
StillImageInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t);
-
+
DataINEndpoint = NULL;
DataOUTEndpoint = NULL;
EventsEndpoint = NULL;
@@ -85,7 +85,7 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
DataOUTEndpoint = EndpointData;
}
}
-
+
for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
{
if (PipeNum == SIInterfaceInfo->Config.DataINPipeNumber)
@@ -113,8 +113,8 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SIInterfaceInfo->State.EventsPipeSize = EventsEndpoint->EndpointSize;
}
- }
-
+ }
+
SIInterfaceInfo->State.InterfaceNumber = StillImageInterface->InterfaceNumber;
SIInterfaceInfo->State.IsActive = true;
@@ -135,7 +135,7 @@ uint8_t DCOMP_SI_Host_NextSIInterface(void* const CurrentDescriptor)
return DESCRIPTOR_SEARCH_Found;
}
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -145,7 +145,7 @@ uint8_t DCOMP_SI_Host_NextSIInterfaceEndpoint(void* const CurrentDescriptor)
{
USB_Descriptor_Endpoint_t* CurrentEndpoint = DESCRIPTOR_PCAST(CurrentDescriptor,
USB_Descriptor_Endpoint_t);
-
+
uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);
if (((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT)) &&
@@ -166,7 +166,7 @@ uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t* const PIMAHeader)
{
uint8_t ErrorCode;
-
+
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
return PIPE_RWSTREAM_DeviceDisconnected;
@@ -178,7 +178,7 @@ uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
if ((ErrorCode = Pipe_Write_Stream_LE(PIMAHeader, PIMA_COMMAND_SIZE(0), NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
-
+
uint8_t ParamBytes = (PIMAHeader->DataLength - PIMA_COMMAND_SIZE(0));
if (ParamBytes)
@@ -186,10 +186,10 @@ uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
if ((ErrorCode = Pipe_Write_Stream_LE(&PIMAHeader->Params, ParamBytes, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
}
-
+
Pipe_ClearOUT();
Pipe_Freeze();
-
+
return PIPE_RWSTREAM_NoError;
}
@@ -204,11 +204,11 @@ uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInf
Pipe_SelectPipe(SIInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze();
-
+
while (!(Pipe_IsINReceived()))
{
uint16_t CurrentFrameNumber = USB_Host_GetFrameNumber();
-
+
if (CurrentFrameNumber != PreviousFrameNumber)
{
PreviousFrameNumber = CurrentFrameNumber;
@@ -216,7 +216,7 @@ uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInf
if (!(TimeoutMSRem--))
return PIPE_RWSTREAM_Timeout;
}
-
+
Pipe_Freeze();
Pipe_SelectPipe(SIInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
@@ -236,25 +236,25 @@ uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInf
USB_Host_ClearPipeStall(SIInterfaceInfo->Config.DataINPipeNumber);
return PIPE_RWSTREAM_PipeStalled;
}
-
+
if (USB_HostState == HOST_STATE_Unattached)
return PIPE_RWSTREAM_DeviceDisconnected;
}
-
+
Pipe_Read_Stream_LE(PIMAHeader, PIMA_COMMAND_SIZE(0), NO_STREAM_CALLBACK);
-
+
if (PIMAHeader->Type == SI_PIMA_CONTAINER_ResponseBlock)
{
uint8_t ParamBytes = (PIMAHeader->DataLength - PIMA_COMMAND_SIZE(0));
if (ParamBytes)
Pipe_Read_Stream_LE(&PIMAHeader->Params, ParamBytes, NO_STREAM_CALLBACK);
-
+
Pipe_ClearIN();
}
-
+
Pipe_Freeze();
-
+
return PIPE_RWSTREAM_NoError;
}
@@ -269,12 +269,12 @@ uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
Pipe_SelectPipe(SIInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
-
+
ErrorCode = Pipe_Write_Stream_LE(Buffer, Bytes, NO_STREAM_CALLBACK);
Pipe_ClearOUT();
Pipe_Freeze();
-
+
return ErrorCode;
}
@@ -293,7 +293,7 @@ uint8_t SI_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
ErrorCode = Pipe_Read_Stream_LE(Buffer, Bytes, NO_STREAM_CALLBACK);
Pipe_Freeze();
-
+
return ErrorCode;
}
@@ -306,12 +306,12 @@ bool SI_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
Pipe_SelectPipe(SIInterfaceInfo->Config.EventsPipeNumber);
Pipe_Unfreeze();
-
+
if (Pipe_BytesInPipe())
IsEventReceived = true;
-
+
Pipe_Freeze();
-
+
return IsEventReceived;
}
@@ -325,12 +325,12 @@ uint8_t SI_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInf
Pipe_SelectPipe(SIInterfaceInfo->Config.EventsPipeNumber);
Pipe_Unfreeze();
-
+
ErrorCode = Pipe_Read_Stream_LE(PIMAHeader, sizeof(SI_PIMA_Container_t), NO_STREAM_CALLBACK);
-
+
Pipe_ClearIN();
Pipe_Freeze();
-
+
return ErrorCode;
}
@@ -351,16 +351,16 @@ uint8_t SI_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
.Code = 0x1002,
.Params = {1},
};
-
+
if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
-
+
if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
-
+
if ((PIMABlock.Type != SI_PIMA_CONTAINER_ResponseBlock) || (PIMABlock.Code != 0x2001))
return SI_ERROR_LOGICAL_CMD_FAILED;
-
+
SIInterfaceInfo->State.IsSessionOpen = true;
return PIPE_RWSTREAM_NoError;
@@ -380,10 +380,10 @@ uint8_t SI_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
.Code = 0x1003,
.Params = {1},
};
-
+
if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
-
+
if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
@@ -411,9 +411,9 @@ uint8_t SI_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
.Type = SI_PIMA_CONTAINER_CommandBlock,
.Code = Operation,
};
-
+
memcpy(&PIMABlock.Params, Params, sizeof(uint32_t) * TotalParams);
-
+
if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
@@ -433,8 +433,9 @@ uint8_t SI_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
if ((PIMABlock.Type != SI_PIMA_CONTAINER_ResponseBlock) || (PIMABlock.Code != 0x2001))
return SI_ERROR_LOGICAL_CMD_FAILED;
-
+
return PIPE_RWSTREAM_NoError;
}
#endif
+
diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.h b/LUFA/Drivers/USB/Class/Host/StillImage.h
index 0e1e8ac16..d2e6fe0d2 100644
--- a/LUFA/Drivers/USB/Class/Host/StillImage.h
+++ b/LUFA/Drivers/USB/Class/Host/StillImage.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -56,7 +56,7 @@
/* Includes: */
#include "../../USB.h"
#include "../Common/StillImage.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -66,7 +66,7 @@
#if !defined(__INCLUDE_FROM_SI_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/StillImage.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Error code for some Still Image Host functions, indicating a logical (and not hardware) error. */
@@ -89,7 +89,7 @@
uint8_t DataOUTPipeNumber; /**< Pipe number of the Still Image interface's OUT data pipe. */
bool DataOUTPipeDoubleBank; /**< Indicates if the Still Image interface's OUT data pipe should use double banking. */
- uint8_t EventsPipeNumber; /**< Pipe number of the Still Image interface's IN events endpoint, if used. */
+ uint8_t EventsPipeNumber; /**< Pipe number of the Still Image interface's IN events endpoint, if used. */
bool EventsPipeDoubleBank; /**< Indicates if the Still Image interface's events data pipe should use double banking. */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
@@ -105,7 +105,7 @@
uint16_t DataINPipeSize; /**< Size in bytes of the Still Image interface's IN data pipe. */
uint16_t DataOUTPipeSize; /**< Size in bytes of the Still Image interface's OUT data pipe. */
uint16_t EventsPipeSize; /**< Size in bytes of the Still Image interface's IN events pipe. */
-
+
bool IsSessionOpen; /**< Indicates if a PIMA session is currently open with the attached device. */
uint32_t TransactionID; /**< Transaction ID for the next transaction to send to the device. */
} State; /**< State data for the USB class interface within the device. All elements in this section
@@ -113,7 +113,7 @@
* the interface is enumerated.
*/
} USB_ClassInfo_SI_Host_t;
-
+
/* Enums: */
/** Enum for the possible error codes returned by the \ref SI_Host_ConfigurePipes() function. */
enum SI_Host_EnumerationFailure_ErrorCodes_t
@@ -148,7 +148,7 @@
/** 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.
- *
+ *
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
* call will fail.
*
@@ -186,7 +186,7 @@
uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(2);
-
+
/** 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.
*
@@ -203,7 +203,7 @@
ATTR_NON_NULL_PTR_ARG(2);
/** Sends a given PIMA command to the attached device, filling out the PIMA command header's Transaction ID automatically.
- *
+ *
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
* call will fail.
*
@@ -258,7 +258,7 @@
uint8_t SI_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(2);
-
+
/** 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.
*
@@ -290,7 +290,7 @@
uint8_t SI_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
void* Buffer,
const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
-
+
/* Inline Functions: */
/** General management task for a given Still Image host class interface, required for the correct operation of the
* interface. This should be called frequently in the main program loop, before the master USB management task
@@ -302,7 +302,7 @@
static inline void SI_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
{
(void)SIInterfaceInfo;
- }
+ }
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
@@ -312,14 +312,14 @@
#define STILL_IMAGE_PROTOCOL 0x01
#define COMMAND_DATA_TIMEOUT_MS 10000
-
+
/* Function Prototypes: */
#if defined(__INCLUDE_FROM_SI_CLASS_HOST_C)
static uint8_t DCOMP_SI_Host_NextSIInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DCOMP_SI_Host_NextSIInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
@@ -328,3 +328,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/MIDI.h b/LUFA/Drivers/USB/Class/MIDI.h
index 33be2b793..c7de15cfc 100644
--- a/LUFA/Drivers/USB/Class/MIDI.h
+++ b/LUFA/Drivers/USB/Class/MIDI.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -65,7 +65,7 @@
/* Macros: */
#define __INCLUDE_FROM_MIDI_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
-
+
/* Includes: */
#include "../HighLevel/USBMode.h"
@@ -80,7 +80,8 @@
#if defined(USB_CAN_BE_HOST)
#include "Host/MIDI.h"
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/MassStorage.h b/LUFA/Drivers/USB/Class/MassStorage.h
index 9d61d380d..985300f00 100644
--- a/LUFA/Drivers/USB/Class/MassStorage.h
+++ b/LUFA/Drivers/USB/Class/MassStorage.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -62,7 +62,7 @@
/* Macros: */
#define __INCLUDE_FROM_MS_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
-
+
/* Includes: */
#include "../HighLevel/USBMode.h"
@@ -73,11 +73,12 @@
#if defined(USB_CAN_BE_DEVICE)
#include "Device/MassStorage.h"
#endif
-
+
#if defined(USB_CAN_BE_HOST)
#include "Host/MassStorage.h"
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/Printer.h b/LUFA/Drivers/USB/Class/Printer.h
index 74ee6e613..9bd3b5257 100644
--- a/LUFA/Drivers/USB/Class/Printer.h
+++ b/LUFA/Drivers/USB/Class/Printer.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -66,7 +66,7 @@
/* Includes: */
#include "../HighLevel/USBMode.h"
-
+
#if defined(NO_STREAM_CALLBACKS)
#error The NO_STREAM_CALLBACKS compile time option cannot be used in projects using the library Class drivers.
#endif
@@ -74,7 +74,8 @@
#if defined(USB_CAN_BE_HOST)
#include "Host/Printer.h"
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/RNDIS.h b/LUFA/Drivers/USB/Class/RNDIS.h
index 5f3bb5684..1b0381e8c 100644
--- a/LUFA/Drivers/USB/Class/RNDIS.h
+++ b/LUFA/Drivers/USB/Class/RNDIS.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -62,7 +62,7 @@
/* Macros: */
#define __INCLUDE_FROM_RNDIS_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
-
+
/* Includes: */
#include "../HighLevel/USBMode.h"
@@ -73,11 +73,12 @@
#if defined(USB_CAN_BE_DEVICE)
#include "Device/RNDIS.h"
#endif
-
+
#if defined(USB_CAN_BE_HOST)
#include "Host/RNDIS.h"
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/Class/StillImage.h b/LUFA/Drivers/USB/Class/StillImage.h
index 4c64e2d89..85a2eef48 100644
--- a/LUFA/Drivers/USB/Class/StillImage.h
+++ b/LUFA/Drivers/USB/Class/StillImage.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -61,10 +61,10 @@
/* Macros: */
#define __INCLUDE_FROM_SI_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
-
+
/* Includes: */
#include "../HighLevel/USBMode.h"
-
+
#if defined(NO_STREAM_CALLBACKS)
#error The NO_STREAM_CALLBACKS compile time option cannot be used in projects using the library Class drivers.
#endif
@@ -72,7 +72,8 @@
#if defined(USB_CAN_BE_HOST)
#include "Host/StillImage.h"
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c
index b5d98c04d..a025e6184 100644
--- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c
+++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -46,7 +46,7 @@ uint8_t USB_Host_GetDeviceConfigDescriptor(uint8_t ConfigNumber, uint16_t* const
.wIndex = 0,
.wLength = sizeof(USB_Descriptor_Configuration_Header_t),
};
-
+
Pipe_SelectPipe(PIPE_CONTROLPIPE);
if ((ErrorCode = USB_Host_SendControlRequest(ConfigHeader)) != HOST_SENDCONTROL_Successful)
@@ -56,15 +56,15 @@ uint8_t USB_Host_GetDeviceConfigDescriptor(uint8_t ConfigNumber, uint16_t* const
if (*ConfigSizePtr > BufferSize)
return HOST_GETCONFIG_BuffOverflow;
-
+
USB_ControlRequest.wLength = *ConfigSizePtr;
-
+
if ((ErrorCode = USB_Host_SendControlRequest(BufferPtr)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
if (DESCRIPTOR_TYPE(BufferPtr) != DTYPE_Configuration)
return HOST_GETCONFIG_InvalidData;
-
+
return HOST_GETCONFIG_Successful;
}
#endif
@@ -75,7 +75,7 @@ void USB_GetNextDescriptorOfType(uint16_t* const BytesRem,
{
while (*BytesRem)
{
- USB_GetNextDescriptor(BytesRem, CurrConfigLoc);
+ USB_GetNextDescriptor(BytesRem, CurrConfigLoc);
if (DESCRIPTOR_TYPE(*CurrConfigLoc) == Type)
return;
@@ -109,22 +109,22 @@ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
const uint8_t AfterType)
{
USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, AfterType);
-
+
if (*BytesRem)
USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);
}
-
+
uint8_t USB_GetNextDescriptorComp(uint16_t* const BytesRem, void** const CurrConfigLoc, ConfigComparatorPtr_t const ComparatorRoutine)
{
uint8_t ErrorCode;
-
+
while (*BytesRem)
{
uint8_t* PrevDescLoc = *CurrConfigLoc;
uint16_t PrevBytesRem = *BytesRem;
USB_GetNextDescriptor(BytesRem, CurrConfigLoc);
-
+
if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != DESCRIPTOR_SEARCH_NotFound)
{
if (ErrorCode == DESCRIPTOR_SEARCH_Fail)
@@ -132,10 +132,11 @@ uint8_t USB_GetNextDescriptorComp(uint16_t* const BytesRem, void** const CurrCon
*CurrConfigLoc = PrevDescLoc;
*BytesRem = PrevBytesRem;
}
-
+
return ErrorCode;
}
}
-
+
return DESCRIPTOR_SEARCH_COMP_EndOfDescriptor;
}
+
diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
index 001653b52..7c7540d52 100644
--- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
+++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -52,12 +52,12 @@
/* Includes: */
#include <stdint.h>
-
+
#include "../../../Common/Common.h"
#include "HostStandardReq.h"
#include "USBMode.h"
#include "StdDescriptors.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -67,8 +67,8 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
- /* Public Interface - May be used in end-application: */
+
+ /* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for determining the type of an endpoint from an endpoint descriptor. This should then be compared
* with the EP_TYPE_* masks to determine the exact type of the endpoint.
@@ -108,7 +108,7 @@
* values can be accessed in the \ref USB_DescriptorTypes_t enum.
*/
#define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Type
-
+
/** Returns the descriptor's size, expressed as the 8-bit value indicating the number of bytes. */
#define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Size
@@ -119,7 +119,7 @@
* \see \ref USB_GetNextDescriptorComp function for more details.
*/
typedef uint8_t (* ConfigComparatorPtr_t)(void*);
-
+
/* Enums: */
/** Enum for the possible return codes of the \ref USB_Host_GetDeviceConfigDescriptor() function. */
enum USB_Host_GetConfigDescriptor_ErrorCodes_t
@@ -138,7 +138,7 @@
*/
HOST_GETCONFIG_InvalidData = 6, /**< The device returned invalid configuration descriptor data. */
};
-
+
/** Enum for return values of a descriptor comparator function. */
enum DSearch_Return_ErrorCodes_t
{
@@ -155,7 +155,7 @@
DESCRIPTOR_SEARCH_COMP_Fail = 1, /**< Comparator function returned Descriptor_Search_Fail. */
DESCRIPTOR_SEARCH_COMP_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */
};
-
+
/* Function Prototypes: */
/** Retrieves the configuration descriptor data from an attached device via a standard request into a buffer,
* including validity and size checking to prevent a buffer overflow.
@@ -266,16 +266,16 @@
* \param[in,out] CurrConfigLoc Pointer to the current descriptor inside the configuration descriptor.
*/
static inline void USB_GetNextDescriptor(uint16_t* const BytesRem,
- void** CurrConfigLoc) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
+ void** CurrConfigLoc) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
static inline void USB_GetNextDescriptor(uint16_t* const BytesRem,
void** CurrConfigLoc)
{
uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size;
-
+
*CurrConfigLoc = ((uint8_t*)*CurrConfigLoc) + CurrDescriptorSize;
*BytesRem -= CurrDescriptorSize;
}
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
@@ -284,3 +284,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c b/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c
index e15a48d50..960e24367 100644
--- a/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c
+++ b/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -50,12 +50,12 @@ void USB_Device_ProcessControlRequest(void)
{
bool RequestHandled = false;
uint8_t* RequestHeader = (uint8_t*)&USB_ControlRequest;
-
+
for (uint8_t RequestHeaderByte = 0; RequestHeaderByte < sizeof(USB_Request_Header_t); RequestHeaderByte++)
*(RequestHeader++) = Endpoint_Read_Byte();
-
+
uint8_t bmRequestType = USB_ControlRequest.bmRequestType;
-
+
switch (USB_ControlRequest.bRequest)
{
case REQ_GetStatus:
@@ -92,7 +92,7 @@ void USB_Device_ProcessControlRequest(void)
USB_Device_GetDescriptor();
RequestHandled = true;
}
-
+
break;
case REQ_GetConfiguration:
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE))
@@ -114,11 +114,11 @@ void USB_Device_ProcessControlRequest(void)
if (!(RequestHandled))
EVENT_USB_Device_UnhandledControlRequest();
-
+
if (Endpoint_IsSETUPReceived())
{
Endpoint_StallTransaction();
- Endpoint_ClearSETUP();
+ Endpoint_ClearSETUP();
}
}
@@ -129,9 +129,9 @@ static void USB_Device_SetAddress(void)
ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
{
Endpoint_ClearSETUP();
-
+
Endpoint_ClearStatusStage();
-
+
while (!(Endpoint_IsINReady()));
USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default;
@@ -157,7 +157,7 @@ static void USB_Device_SetConfiguration(void)
#else
uint8_t MemoryAddressSpace;
#endif
-
+
if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DevDescriptorPtr
#if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS)
, &MemoryAddressSpace
@@ -166,7 +166,7 @@ static void USB_Device_SetConfiguration(void)
{
return;
}
-
+
if (MemoryAddressSpace == MEMSPACE_FLASH)
{
if (((uint8_t)USB_ControlRequest.wValue > pgm_read_byte(&DevDescriptorPtr->NumberOfConfigurations)))
@@ -183,7 +183,7 @@ static void USB_Device_SetConfiguration(void)
return;
}
#endif
-
+
Endpoint_ClearSETUP();
USB_ConfigurationNumber = (uint8_t)USB_ControlRequest.wValue;
@@ -225,7 +225,7 @@ static void USB_Device_GetInternalSerialDescriptor(void)
SignatureDescriptor.Header.Type = DTYPE_String;
SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor);
-
+
uint8_t SigReadAddress = 0x0E;
ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
@@ -233,17 +233,17 @@ static void USB_Device_GetInternalSerialDescriptor(void)
for (uint8_t SerialCharNum = 0; SerialCharNum < 20; SerialCharNum++)
{
uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
-
+
if (SerialCharNum & 0x01)
{
SerialByte >>= 4;
SigReadAddress++;
}
-
+
SignatureDescriptor.UnicodeString[SerialCharNum] = USB_Device_NibbleToASCII(SerialByte);
}
}
-
+
Endpoint_ClearSETUP();
Endpoint_Write_Control_Stream_LE(&SignatureDescriptor, sizeof(SignatureDescriptor));
@@ -256,11 +256,11 @@ static void USB_Device_GetDescriptor(void)
{
const void* DescriptorPointer;
uint16_t DescriptorSize;
-
+
#if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS)
uint8_t DescriptorAddressSpace;
#endif
-
+
#if !defined(NO_INTERNAL_SERIAL) && (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
if (USB_ControlRequest.wValue == ((DTYPE_String << 8) | USE_INTERNAL_SERIAL))
{
@@ -268,7 +268,7 @@ static void USB_Device_GetDescriptor(void)
return;
}
#endif
-
+
if ((DescriptorSize = CALLBACK_USB_GetDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,
&DescriptorPointer
#if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS)
@@ -278,7 +278,7 @@ static void USB_Device_GetDescriptor(void)
{
return;
}
-
+
Endpoint_ClearSETUP();
#if defined(USE_RAM_DESCRIPTORS)
@@ -286,14 +286,14 @@ static void USB_Device_GetDescriptor(void)
#elif defined(USE_EEPROM_DESCRIPTORS)
Endpoint_Write_Control_EStream_LE(DescriptorPointer, DescriptorSize);
#elif defined(USE_FLASH_DESCRIPTORS)
- Endpoint_Write_Control_PStream_LE(DescriptorPointer, DescriptorSize);
+ Endpoint_Write_Control_PStream_LE(DescriptorPointer, DescriptorSize);
#else
if (DescriptorAddressSpace == MEMSPACE_FLASH)
- Endpoint_Write_Control_PStream_LE(DescriptorPointer, DescriptorSize);
+ Endpoint_Write_Control_PStream_LE(DescriptorPointer, DescriptorSize);
else if (DescriptorAddressSpace == MEMSPACE_EEPROM)
Endpoint_Write_Control_EStream_LE(DescriptorPointer, DescriptorSize);
else
- Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize);
+ Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize);
#endif
Endpoint_ClearOUT();
@@ -305,14 +305,14 @@ static void USB_Device_GetStatus(void)
switch (USB_ControlRequest.bmRequestType)
{
- #if !defined(NO_DEVICE_SELF_POWER) || !defined(NO_DEVICE_REMOTE_WAKEUP)
+ #if !defined(NO_DEVICE_SELF_POWER) || !defined(NO_DEVICE_REMOTE_WAKEUP)
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE):
#if !defined(NO_DEVICE_SELF_POWER)
if (USB_CurrentlySelfPowered)
CurrentStatus |= FEATURE_SELFPOWERED_ENABLED;
#endif
- #if !defined(NO_DEVICE_REMOTE_WAKEUP)
+ #if !defined(NO_DEVICE_REMOTE_WAKEUP)
if (USB_RemoteWakeupEnabled)
CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
#endif
@@ -324,7 +324,7 @@ static void USB_Device_GetStatus(void)
CurrentStatus = Endpoint_IsStalled();
- Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
break;
#endif
@@ -336,7 +336,7 @@ static void USB_Device_GetStatus(void)
Endpoint_Write_Word_LE(CurrentStatus);
Endpoint_ClearIN();
-
+
Endpoint_ClearStatusStage();
}
@@ -344,28 +344,28 @@ static void USB_Device_ClearSetFeature(void)
{
switch (USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT)
{
- #if !defined(NO_DEVICE_REMOTE_WAKEUP)
+ #if !defined(NO_DEVICE_REMOTE_WAKEUP)
case REQREC_DEVICE:
if ((uint8_t)USB_ControlRequest.wValue == FEATURE_REMOTE_WAKEUP)
USB_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature);
else
return;
-
- break;
+
+ break;
#endif
#if !defined(CONTROL_ONLY_DEVICE)
case REQREC_ENDPOINT:
if ((uint8_t)USB_ControlRequest.wValue == FEATURE_ENDPOINT_HALT)
{
uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);
-
+
if (EndpointIndex == ENDPOINT_CONTROLEP)
return;
Endpoint_SelectEndpoint(EndpointIndex);
if (Endpoint_IsEnabled())
- {
+ {
if (USB_ControlRequest.bRequest == REQ_SetFeature)
{
Endpoint_StallTransaction();
@@ -375,10 +375,10 @@ static void USB_Device_ClearSetFeature(void)
Endpoint_ClearStall();
Endpoint_ResetFIFO(EndpointIndex);
Endpoint_ResetDataToggle();
- }
+ }
}
}
-
+
break;
#endif
default:
@@ -393,3 +393,4 @@ static void USB_Device_ClearSetFeature(void)
}
#endif
+
diff --git a/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.h b/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.h
index a65b93b62..43a8d2011 100644
--- a/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.h
+++ b/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -48,7 +48,7 @@
#include <util/atomic.h>
#include <stdint.h>
#include <stdbool.h>
-
+
#include "StdDescriptors.h"
#include "Events.h"
#include "StdRequestType.h"
@@ -64,13 +64,13 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
#if defined(USE_SINGLE_DEVICE_CONFIGURATION)
#define FIXED_NUM_CONFIGURATIONS 1
#endif
-
+
/* Enums: */
#if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS)
/** Enum for the possible descriptor memory spaces, for the MemoryAddressSpace of the
@@ -86,7 +86,7 @@
MEMSPACE_RAM = 2, /**< Indicates the requested descriptor is located in RAM memory. */
};
#endif
-
+
/* Global Variables: */
/** Indicates the currently set configuration number of the device. USB devices may have several
* different configurations which the host can select between; this indicates the currently selected
@@ -98,7 +98,7 @@
* \ingroup Group_Device
*/
extern uint8_t USB_ConfigurationNumber;
-
+
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
/** Indicates if the host is currently allowing the device to issue remote wakeup events. If this
* flag is cleared, the device should not issue remote wakeup events to the host.
@@ -108,7 +108,7 @@
* \n\n
*
* \note To reduce FLASH usage of the compiled applications where Remote Wakeup is not supported,
- * this global and the underlying management code can be disabled by defining the
+ * this global and the underlying management code can be disabled by defining the
* NO_DEVICE_REMOTE_WAKEUP token in the project makefile and passing it to the compiler via
* the -D switch.
*
@@ -116,7 +116,7 @@
*/
extern bool USB_RemoteWakeupEnabled;
#endif
-
+
#if !defined(NO_DEVICE_SELF_POWER)
/** Indicates if the device is currently being powered by its own power supply, rather than being
* powered by the host's USB supply. This flag should remain cleared if the device does not
@@ -126,7 +126,7 @@
*/
extern bool USB_CurrentlySelfPowered;
#endif
-
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
#if defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS)
@@ -138,10 +138,10 @@
#elif defined(USE_FLASH_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS) && defined(USE_RAM_DESCRIPTORS)
#error Only one of the USE_*_DESCRIPTORS modes should be selected.
#endif
-
+
/* Function Prototypes: */
void USB_Device_ProcessControlRequest(void);
-
+
#if defined(__INCLUDE_FROM_DEVICESTDREQ_C)
static void USB_Device_SetAddress(void);
static void USB_Device_SetConfiguration(void);
@@ -149,11 +149,11 @@
static void USB_Device_GetDescriptor(void);
static void USB_Device_GetStatus(void);
static void USB_Device_ClearSetFeature(void);
-
+
#if !defined(NO_INTERNAL_SERIAL) && (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
static char USB_Device_NibbleToASCII(uint8_t Nibble) ATTR_ALWAYS_INLINE;
static void USB_Device_GetInternalSerialDescriptor(void);
- #endif
+ #endif
#endif
#endif
@@ -161,5 +161,6 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
+
diff --git a/LUFA/Drivers/USB/HighLevel/EndpointStream.c b/LUFA/Drivers/USB/HighLevel/EndpointStream.c
index 841f661be..794c9179f 100644
--- a/LUFA/Drivers/USB/HighLevel/EndpointStream.c
+++ b/LUFA/Drivers/USB/HighLevel/EndpointStream.c
@@ -230,4 +230,4 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte((uint8_t*)BufferPtr--, Endpoint_Read_Byte())
#include "Template/Template_Endpoint_Control_R.c"
-#endif \ No newline at end of file
+#endif
diff --git a/LUFA/Drivers/USB/HighLevel/EndpointStream.h b/LUFA/Drivers/USB/HighLevel/EndpointStream.h
index ba2cce8de..49099980a 100644
--- a/LUFA/Drivers/USB/HighLevel/EndpointStream.h
+++ b/LUFA/Drivers/USB/HighLevel/EndpointStream.h
@@ -522,3 +522,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/HighLevel/Events.c b/LUFA/Drivers/USB/HighLevel/Events.c
index ee2030e1a..9bd217f1e 100644
--- a/LUFA/Drivers/USB/HighLevel/Events.c
+++ b/LUFA/Drivers/USB/HighLevel/Events.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,3 +36,4 @@ void USB_Event_Stub(void)
{
}
+
diff --git a/LUFA/Drivers/USB/HighLevel/Events.h b/LUFA/Drivers/USB/HighLevel/Events.h
index f1d6f0316..5f74a95ec 100644
--- a/LUFA/Drivers/USB/HighLevel/Events.h
+++ b/LUFA/Drivers/USB/HighLevel/Events.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -64,13 +64,13 @@
*
* @{
*/
-
+
#ifndef __USBEVENTS_H__
#define __USBEVENTS_H__
/* Includes: */
#include <stdint.h>
-
+
#include "../../../Common/Common.h"
#include "USBMode.h"
@@ -83,8 +83,8 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
- /* Public Interface - May be used in end-application: */
+
+ /* Public Interface - May be used in end-application: */
/* Pseudo-Functions for Doxygen: */
#if !defined(__INCLUDE_FROM_EVENTS_C) || defined(__DOXYGEN__)
/** Event for USB mode pin level change. This event fires when the USB interface is set to dual role
@@ -112,7 +112,7 @@
* \ref Group_USBManagement documentation).
*/
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
-
+
/** Event for USB device attachment. This event fires when a the USB interface is in host mode, and
* a USB device has been connected to the USB interface. This is interrupt driven, thus fires before
* the standard \ref EVENT_USB_Device_Connect() event and so can be used to programmatically start the USB
@@ -141,11 +141,11 @@
* \see \ref USB_USBTask() for more information on the USB management task and reducing CPU usage.
*/
void EVENT_USB_Host_DeviceUnattached(void);
-
+
/** Event for USB device enumeration failure. This event fires when a the USB interface is
* in host mode, and an attached USB device has failed to enumerate completely.
*
- * \param[in] ErrorCode Error code indicating the failure reason, a value in
+ * \param[in] ErrorCode Error code indicating the failure reason, a value in
* \ref USB_Host_EnumerationErrorCodes_t.
*
* \param[in] SubErrorCode Sub error code indicating the reason for failure - for example, if the
@@ -327,17 +327,17 @@
*/
void EVENT_USB_Device_StartOfFrame(void);
#endif
-
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
#if defined(__INCLUDE_FROM_EVENTS_C)
void USB_Event_Stub(void) ATTR_CONST;
-
+
#if defined(USB_CAN_BE_BOTH)
void EVENT_USB_UIDChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
#endif
-
+
#if defined(USB_CAN_BE_HOST)
void EVENT_USB_Host_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
void EVENT_USB_Host_DeviceAttached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
@@ -366,7 +366,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/HighLevel/HostStandardReq.c b/LUFA/Drivers/USB/HighLevel/HostStandardReq.c
index 182cd6979..42688b9e1 100644
--- a/LUFA/Drivers/USB/HighLevel/HostStandardReq.c
+++ b/LUFA/Drivers/USB/HighLevel/HostStandardReq.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -45,7 +45,7 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
uint16_t DataLen = USB_ControlRequest.wLength;
USB_Host_ResumeBus();
-
+
if ((ReturnStatus = USB_Host_WaitMS(1)) != HOST_WAITERROR_Successful)
goto End_Of_Control_Send;
@@ -58,7 +58,7 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
Pipe_Write_Byte(*(HeaderStream++));
Pipe_ClearSETUP();
-
+
if ((ReturnStatus = USB_Host_WaitForIOS(USB_HOST_WAITFOR_SetupSent)) != HOST_SENDCONTROL_Successful)
goto End_Of_Control_Send;
@@ -70,7 +70,7 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_DIRECTION) == REQDIR_DEVICETOHOST)
{
Pipe_SetPipeToken(PIPE_TOKEN_IN);
-
+
if (DataStream != NULL)
{
while (DataLen)
@@ -79,10 +79,10 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
if ((ReturnStatus = USB_Host_WaitForIOS(USB_HOST_WAITFOR_InReceived)) != HOST_SENDCONTROL_Successful)
goto End_Of_Control_Send;
-
+
if (!(Pipe_BytesInPipe()))
DataLen = 0;
-
+
while (Pipe_BytesInPipe() && DataLen)
{
*(DataStream++) = Pipe_Read_Byte();
@@ -96,7 +96,7 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
Pipe_SetPipeToken(PIPE_TOKEN_OUT);
Pipe_Unfreeze();
-
+
if ((ReturnStatus = USB_Host_WaitForIOS(USB_HOST_WAITFOR_OutReady)) != HOST_SENDCONTROL_Successful)
goto End_Of_Control_Send;
@@ -110,7 +110,7 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
if (DataStream != NULL)
{
Pipe_SetPipeToken(PIPE_TOKEN_OUT);
- Pipe_Unfreeze();
+ Pipe_Unfreeze();
while (DataLen)
{
@@ -118,11 +118,11 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
goto End_Of_Control_Send;
while (DataLen && (Pipe_BytesInPipe() < USB_ControlPipeSize))
- {
+ {
Pipe_Write_Byte(*(DataStream++));
DataLen--;
}
-
+
Pipe_ClearOUT();
}
@@ -131,7 +131,7 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
Pipe_Freeze();
}
-
+
Pipe_SetPipeToken(PIPE_TOKEN_IN);
Pipe_Unfreeze();
@@ -143,7 +143,7 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
End_Of_Control_Send:
Pipe_Freeze();
-
+
if (BusSuspended)
USB_Host_SuspendBus();
@@ -155,11 +155,11 @@ End_Of_Control_Send:
static uint8_t USB_Host_WaitForIOS(const uint8_t WaitType)
{
#if (USB_HOST_TIMEOUT_MS < 0xFF)
- uint8_t TimeoutCounter = USB_HOST_TIMEOUT_MS;
+ uint8_t TimeoutCounter = USB_HOST_TIMEOUT_MS;
#else
uint16_t TimeoutCounter = USB_HOST_TIMEOUT_MS;
#endif
-
+
while (!(((WaitType == USB_HOST_WAITFOR_SetupSent) && Pipe_IsSETUPSent()) ||
((WaitType == USB_HOST_WAITFOR_InReceived) && Pipe_IsINReceived()) ||
((WaitType == USB_HOST_WAITFOR_OutReady) && Pipe_IsOUTReady())))
@@ -168,7 +168,7 @@ static uint8_t USB_Host_WaitForIOS(const uint8_t WaitType)
if ((ErrorCode = USB_Host_WaitMS(1)) != HOST_WAITERROR_Successful)
return ErrorCode;
-
+
if (!(TimeoutCounter--))
return HOST_SENDCONTROL_SoftwareTimeOut;
}
@@ -177,3 +177,4 @@ static uint8_t USB_Host_WaitForIOS(const uint8_t WaitType)
}
#endif
+
diff --git a/LUFA/Drivers/USB/HighLevel/HostStandardReq.h b/LUFA/Drivers/USB/HighLevel/HostStandardReq.h
index 358f3d3ad..02b8bb81a 100644
--- a/LUFA/Drivers/USB/HighLevel/HostStandardReq.h
+++ b/LUFA/Drivers/USB/HighLevel/HostStandardReq.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -44,11 +44,11 @@
/* Includes: */
#include <stdint.h>
#include <stdbool.h>
-
+
#include "USBMode.h"
#include "StdRequestType.h"
#include "../LowLevel/USBController.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -58,7 +58,7 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Enums: */
/** Enum for the \ref USB_Host_SendControlRequest() return code, indicating the reason for the error
@@ -78,7 +78,7 @@
*/
HOST_SENDCONTROL_SoftwareTimeOut = 4, /**< The request or data transfer timed out. */
};
-
+
/* Function Prototypes: */
/** Sends the request stored in the \ref USB_ControlRequest global structure to the attached device,
* and transfers the data stored in the buffer to the device, or from the device to the buffer
@@ -92,7 +92,7 @@
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result.
*/
uint8_t USB_Host_SendControlRequest(void* const BufferPtr);
-
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Enums: */
@@ -102,7 +102,7 @@
USB_HOST_WAITFOR_InReceived,
USB_HOST_WAITFOR_OutReady,
};
-
+
/* Function Prototypes: */
#if defined(__INCLUDE_FROM_HOSTSTDREQ_C)
static uint8_t USB_Host_WaitForIOS(const uint8_t WaitType);
@@ -113,5 +113,6 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
+
diff --git a/LUFA/Drivers/USB/HighLevel/PipeStream.c b/LUFA/Drivers/USB/HighLevel/PipeStream.c
index 72a7e64d3..c5f9e8286 100644
--- a/LUFA/Drivers/USB/HighLevel/PipeStream.c
+++ b/LUFA/Drivers/USB/HighLevel/PipeStream.c
@@ -193,3 +193,4 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
#include "Template/Template_Pipe_RW.c"
#endif
+
diff --git a/LUFA/Drivers/USB/HighLevel/PipeStream.h b/LUFA/Drivers/USB/HighLevel/PipeStream.h
index ba5df5788..3e2a3c324 100644
--- a/LUFA/Drivers/USB/HighLevel/PipeStream.h
+++ b/LUFA/Drivers/USB/HighLevel/PipeStream.h
@@ -296,3 +296,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
index 00b60c3d3..2a87619b4 100644
--- a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
+++ b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -45,7 +45,7 @@
*
* @{
*/
-
+
#ifndef __USBDESCRIPTORS_H__
#define __USBDESCRIPTORS_H__
@@ -58,7 +58,7 @@
#include "../../../Common/Common.h"
#include "USBMode.h"
#include "Events.h"
-
+
#if defined(USB_CAN_BE_DEVICE)
#include "../LowLevel/Device.h"
#endif
@@ -72,7 +72,7 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Indicates that a given descriptor does not exist in the device. This can be used inside descriptors
@@ -98,7 +98,7 @@
#else
#define USE_INTERNAL_SERIAL NO_DESCRIPTOR
#endif
-
+
/** Macro to calculate the power value for the configuration descriptor, from a given number of milliamperes. */
#define USB_CONFIG_POWER_MA(mA) ((mA) >> 1)
@@ -106,7 +106,7 @@
* Should be used in string descriptor's headers for giving the string descriptor's byte length.
*/
#define USB_STRING_LEN(str) (sizeof(USB_Descriptor_Header_t) + ((str) << 1))
-
+
/** Macro to encode a given four digit floating point version number (e.g. 01.23) into Binary Coded
* Decimal format for descriptor fields requiring BCD encoding, such as the USB version number in the
* standard device descriptor.
@@ -129,7 +129,7 @@
* EndpointAddress value to indicate to the host that the endpoint is of the OUT direction (i.e, from
* host to device).
*/
- #define ENDPOINT_DESCRIPTOR_DIR_OUT 0x00
+ #define ENDPOINT_DESCRIPTOR_DIR_OUT 0x00
/** Can be masked with other configuration descriptor attributes for a \ref USB_Descriptor_Configuration_Header_t
* descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
@@ -177,7 +177,7 @@
* \see The USB specification for more details on the possible Endpoint attributes.
*/
#define ENDPOINT_ATTR_SYNC (3 << 2)
-
+
/** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
* Attributes value to indicate that the specified endpoint is used for data transfers.
*
@@ -198,7 +198,7 @@
* \see The USB specification for more details on the possible Endpoint usage attributes.
*/
#define ENDPOINT_USAGE_IMPLICIT_FEEDBACK (2 << 4)
-
+
/* Enums: */
/** Enum for the possible standard descriptor types, as given in each descriptor's header. */
enum USB_DescriptorTypes_t
@@ -231,7 +231,7 @@
* given by the specific class.
*/
} USB_Descriptor_Header_t;
-
+
/** \brief Standard USB Descriptor Header (USB-IF naming conventions).
*
* Type define for all descriptors' standard header, indicating the descriptor's length and type. This structure
@@ -246,7 +246,7 @@
* given by the specific class.
*/
} USB_StdDescriptor_Header_t;
-
+
/** \brief Standard USB Device Descriptor (LUFA naming conventions).
*
* Type define for a standard Device Descriptor. This structure uses LUFA-specific element names to make each
@@ -262,13 +262,13 @@
uint8_t Class; /**< USB device class. */
uint8_t SubClass; /**< USB device subclass. */
uint8_t Protocol; /**< USB device protocol. */
-
+
uint8_t Endpoint0Size; /**< Size of the control (address 0) endpoint's bank in bytes. */
-
+
uint16_t VendorID; /**< Vendor ID for the USB product. */
uint16_t ProductID; /**< Unique product ID for the USB product. */
uint16_t ReleaseNumber; /**< Product release (version) number. */
-
+
uint8_t ManufacturerStrIndex; /**< String index for the manufacturer's name. The
* host will request this string via a separate
* control request for the string descriptor.
@@ -354,7 +354,7 @@
typedef struct
{
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
-
+
uint16_t TotalConfigurationSize; /**< Size of the configuration descriptor header,
* and all sub descriptors inside the configuration.
*/
@@ -362,17 +362,17 @@
uint8_t ConfigurationNumber; /**< Configuration index of the current configuration. */
uint8_t ConfigurationStrIndex; /**< Index of a string descriptor describing the configuration. */
-
+
uint8_t ConfigAttributes; /**< Configuration attributes, comprised of a mask of zero or
* more USB_CONFIG_ATTR_* masks.
*/
-
+
uint8_t MaxPowerConsumption; /**< Maximum power consumption of the device while in the
* current configuration, calculated by the \ref USB_CONFIG_POWER_MA()
* macro.
*/
} USB_Descriptor_Configuration_Header_t;
-
+
/** \brief Standard USB Configuration Descriptor (USB-IF naming conventions).
*
* Type define for a standard Configuration Descriptor header. This structure uses the relevant standard's given element names
@@ -419,14 +419,14 @@
* selected by the host.
*/
uint8_t TotalEndpoints; /**< Total number of endpoints in the interface. */
-
+
uint8_t Class; /**< Interface class ID. */
uint8_t SubClass; /**< Interface subclass ID. */
uint8_t Protocol; /**< Interface protocol ID. */
uint8_t InterfaceStrIndex; /**< Index of the string descriptor describing the interface. */
} USB_Descriptor_Interface_t;
-
+
/** \brief Standard USB Interface Descriptor (USB-IF naming conventions).
*
* Type define for a standard Interface Descriptor. This structure uses the relevant standard's given element names
@@ -471,7 +471,7 @@
typedef struct
{
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
-
+
uint8_t FirstInterfaceIndex; /**< Index of the first associated interface. */
uint8_t TotalInterfaces; /**< Total number of associated interfaces. */
@@ -483,7 +483,7 @@
* interface association.
*/
} USB_Descriptor_Interface_Association_t;
-
+
/** \brief Standard USB Interface Association Descriptor (USB-IF naming conventions).
*
* Type define for a standard Interface Association Descriptor. This structure uses the relevant standard's given
@@ -538,7 +538,7 @@
* or ISOCHRONOUS type.
*/
} USB_Descriptor_Endpoint_t;
-
+
/** \brief Standard USB Endpoint Descriptor (USB-IF naming conventions).
*
* Type define for a standard Endpoint Descriptor. This structure uses the relevant standard's given
@@ -553,10 +553,10 @@
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a
* value given by the specific class.
*/
- uint8_t bEndpointAddress; /**< Logical address of the endpoint within the device for the current
+ uint8_t bEndpointAddress; /**< Logical address of the endpoint within the device for the current
* configuration, including direction mask.
*/
- uint8_t bmAttributes; /**< Endpoint attributes, comprised of a mask of the endpoint type (EP_TYPE_*)
+ uint8_t bmAttributes; /**< Endpoint attributes, comprised of a mask of the endpoint type (EP_TYPE_*)
* and attributes (ENDPOINT_ATTR_*) masks.
*/
uint16_t wMaxPacketSize; /**< Size of the endpoint bank, in bytes. This indicates the maximum packet size
@@ -583,7 +583,7 @@
typedef struct
{
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
-
+
wchar_t UnicodeString[]; /**< String data, as unicode characters (alternatively,
* string language IDs). If normal ASCII characters are
* to be used, they must be added as an array of characters
@@ -636,12 +636,13 @@
#define VERSION_TENTHS(x) (int)(((x) - (int)(x)) * 10)
#define VERSION_HUNDREDTHS(x) (int)((((x) - (int)(x)) * 100) - (10 * VERSION_TENTHS(x)))
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/HighLevel/StdRequestType.h b/LUFA/Drivers/USB/HighLevel/StdRequestType.h
index abb5431f7..3729c0a97 100644
--- a/LUFA/Drivers/USB/HighLevel/StdRequestType.h
+++ b/LUFA/Drivers/USB/HighLevel/StdRequestType.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
* \note This file should not be included directly. It is automatically included as needed by the USB driver
* dispatch header located in LUFA/Drivers/USB/USB.h.
*/
-
+
/** \ingroup Group_USB
* @defgroup Group_StdRequest Standard USB Requests
*
@@ -56,7 +56,7 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the request type parameter, to indicate the direction of the request data (Host to Device
@@ -137,7 +137,7 @@
* \see \ref CONTROL_REQTYPE_RECIPIENT macro.
*/
#define REQREC_OTHER (3 << 0)
-
+
/** Feature indicator for Clear Feature or Set Feature commands. When used in a Clear Feature
* request this indicates that an endpoint (whose address is given elsewhere in the request
* should have its stall condition cleared. If used in a similar manner inside a Set Feature
@@ -229,3 +229,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h b/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h
index dc3495285..991544cec 100644
--- a/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h
+++ b/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -37,7 +37,7 @@
* \note This file should not be included directly. It is automatically included as needed by the USB driver
* dispatch header located in LUFA/Drivers/USB/USB.h.
*/
-
+
/** \ingroup Group_USB
* @defgroup Group_StreamCallbacks Endpoint and Pipe Stream Callbacks
*
@@ -47,7 +47,7 @@
*
* @{
*/
-
+
#ifndef __STREAMCALLBACK_H__
#define __STREAMCALLBACK_H__
@@ -58,14 +58,14 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream
* call has no callback function to be called between USB packets.
*/
#define NO_STREAM_CALLBACK NULL
-
+
/* Enums: */
/** Enum for the possible error return codes of a stream callback function. */
enum StreamCallback_Return_ErrorCodes_t
@@ -80,7 +80,8 @@
* are to be used as the callback parameter of the stream functions.
*/
typedef uint8_t (* const StreamCallbackPtr_t)(void);
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_R.c b/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_R.c
index c8bfaeb70..5cc11d7fe 100644
--- a/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_R.c
+++ b/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_R.c
@@ -2,10 +2,10 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer,
uint16_t Length)
{
uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));
-
+
if (!(Length))
Endpoint_ClearOUT();
-
+
while (Length)
{
uint8_t USB_DeviceState_LCL = USB_DeviceState;
@@ -16,7 +16,7 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer,
return ENDPOINT_RWCSTREAM_BusSuspended;
else if (Endpoint_IsSETUPReceived())
return ENDPOINT_RWCSTREAM_HostAborted;
-
+
if (Endpoint_IsOUTReceived())
{
while (Length && Endpoint_BytesInEndpoint())
@@ -24,11 +24,11 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer,
TEMPLATE_TRANSFER_BYTE(DataStream);
Length--;
}
-
+
Endpoint_ClearOUT();
- }
+ }
}
-
+
while (!(Endpoint_IsINReady()))
{
uint8_t USB_DeviceState_LCL = USB_DeviceState;
@@ -38,11 +38,11 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer,
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
return ENDPOINT_RWCSTREAM_BusSuspended;
}
-
+
return ENDPOINT_RWCSTREAM_NoError;
}
#undef TEMPLATE_BUFFER_OFFSET
#undef TEMPLATE_FUNC_NAME
-#undef TEMPLATE_TRANSFER_BYTE \ No newline at end of file
+#undef TEMPLATE_TRANSFER_BYTE
diff --git a/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_W.c b/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_W.c
index 0ae7febc4..16fe3999b 100644
--- a/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_W.c
+++ b/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_Control_W.c
@@ -3,7 +3,7 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer,
{
uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));
bool LastPacketFull = false;
-
+
if (Length > USB_ControlRequest.wLength)
Length = USB_ControlRequest.wLength;
else if (!(Length))
@@ -12,7 +12,7 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer,
while (Length || LastPacketFull)
{
uint8_t USB_DeviceState_LCL = USB_DeviceState;
-
+
if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)
return ENDPOINT_RWCSTREAM_DeviceDisconnected;
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
@@ -25,19 +25,19 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer,
if (Endpoint_IsINReady())
{
uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint();
-
+
while (Length && (BytesInEndpoint < USB_ControlEndpointSize))
{
TEMPLATE_TRANSFER_BYTE(DataStream);
Length--;
BytesInEndpoint++;
}
-
+
LastPacketFull = (BytesInEndpoint == USB_ControlEndpointSize);
Endpoint_ClearIN();
}
}
-
+
while (!(Endpoint_IsOUTReceived()))
{
uint8_t USB_DeviceState_LCL = USB_DeviceState;
@@ -53,4 +53,4 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer,
#undef TEMPLATE_BUFFER_OFFSET
#undef TEMPLATE_FUNC_NAME
-#undef TEMPLATE_TRANSFER_BYTE \ No newline at end of file
+#undef TEMPLATE_TRANSFER_BYTE
diff --git a/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_RW.c b/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_RW.c
index fc9df951d..6657f38eb 100644
--- a/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_RW.c
+++ b/LUFA/Drivers/USB/HighLevel/Template/Template_Endpoint_RW.c
@@ -4,7 +4,7 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer,
{
uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));
uint8_t ErrorCode;
-
+
if ((ErrorCode = Endpoint_WaitUntilReady()))
return ErrorCode;
@@ -34,7 +34,7 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer,
}
Length -= 8;
-
+
TEMPLATE_TRANSFER_BYTE(DataStream);
case 7: TEMPLATE_TRANSFER_BYTE(DataStream);
case 6: TEMPLATE_TRANSFER_BYTE(DataStream);
@@ -43,7 +43,7 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer,
case 3: TEMPLATE_TRANSFER_BYTE(DataStream);
case 2: TEMPLATE_TRANSFER_BYTE(DataStream);
case 1: TEMPLATE_TRANSFER_BYTE(DataStream);
- } while (Length >= 8);
+ } while (Length >= 8);
}
}
#endif
@@ -76,4 +76,4 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer,
#undef TEMPLATE_BUFFER_TYPE
#undef TEMPLATE_TRANSFER_BYTE
#undef TEMPLATE_CLEAR_ENDPOINT
-#undef TEMPLATE_BUFFER_OFFSET \ No newline at end of file
+#undef TEMPLATE_BUFFER_OFFSET
diff --git a/LUFA/Drivers/USB/HighLevel/Template/Template_Pipe_RW.c b/LUFA/Drivers/USB/HighLevel/Template/Template_Pipe_RW.c
index fb64dd837..a998469d2 100644
--- a/LUFA/Drivers/USB/HighLevel/Template/Template_Pipe_RW.c
+++ b/LUFA/Drivers/USB/HighLevel/Template/Template_Pipe_RW.c
@@ -4,7 +4,7 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer,
{
uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));
uint8_t ErrorCode;
-
+
Pipe_SetPipeToken(TEMPLATE_TOKEN);
if ((ErrorCode = Pipe_WaitUntilReady()))
@@ -36,7 +36,7 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer,
}
Length -= 8;
-
+
TEMPLATE_TRANSFER_BYTE(DataStream);
case 7: TEMPLATE_TRANSFER_BYTE(DataStream);
case 6: TEMPLATE_TRANSFER_BYTE(DataStream);
@@ -45,7 +45,7 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer,
case 3: TEMPLATE_TRANSFER_BYTE(DataStream);
case 2: TEMPLATE_TRANSFER_BYTE(DataStream);
case 1: TEMPLATE_TRANSFER_BYTE(DataStream);
- } while (Length >= 8);
+ } while (Length >= 8);
}
}
#endif
@@ -70,7 +70,7 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer,
Length--;
}
}
-
+
return PIPE_RWSTREAM_NoError;
}
@@ -80,3 +80,4 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer,
#undef TEMPLATE_TRANSFER_BYTE
#undef TEMPLATE_CLEAR_PIPE
#undef TEMPLATE_BUFFER_OFFSET
+
diff --git a/LUFA/Drivers/USB/HighLevel/USBMode.h b/LUFA/Drivers/USB/HighLevel/USBMode.h
index f9abd9988..4f44972db 100644
--- a/LUFA/Drivers/USB/HighLevel/USBMode.h
+++ b/LUFA/Drivers/USB/HighLevel/USBMode.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -58,7 +58,7 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
#if defined(__DOXYGEN__)
/** Indicates that the target AVR microcontroller belongs to the Series 2 USB controller
@@ -96,7 +96,7 @@
*/
#define USB_CAN_BE_BOTH
#else
- /* Macros: */
+ /* Macros: */
#if (defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__) || \
defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega8U2__))
#define USB_SERIES_2_AVR
@@ -106,13 +106,13 @@
#define USB_SERIES_6_AVR
#elif (defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1287__))
#define USB_SERIES_7_AVR
- #endif
+ #endif
- #if !defined(USB_SERIES_7_AVR)
+ #if !defined(USB_SERIES_7_AVR)
#if defined(USB_HOST_ONLY)
#error USB_HOST_ONLY is not available for the currently selected USB AVR model.
#endif
-
+
#if !defined(USB_DEVICE_ONLY)
#define USB_DEVICE_ONLY
#endif
@@ -127,12 +127,12 @@
#elif defined(USB_DEVICE_ONLY)
#define USB_CAN_BE_DEVICE
#endif
-
+
#if (defined(USB_HOST_ONLY) && defined(USB_DEVICE_ONLY))
#error USB_HOST_ONLY and USB_DEVICE_ONLY are mutually exclusive.
#endif
#endif
-
+
#endif
-/** @} */ \ No newline at end of file
+/** @} */
diff --git a/LUFA/Drivers/USB/HighLevel/USBTask.c b/LUFA/Drivers/USB/HighLevel/USBTask.c
index a2737f7d0..aeb9e787d 100644
--- a/LUFA/Drivers/USB/HighLevel/USBTask.c
+++ b/LUFA/Drivers/USB/HighLevel/USBTask.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -63,12 +63,12 @@ static void USB_DeviceTask(void)
if (USB_DeviceState != DEVICE_STATE_Unattached)
{
uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
-
+
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
if (Endpoint_IsSETUPReceived())
USB_Device_ProcessControlRequest();
-
+
Endpoint_SelectEndpoint(PrevEndpoint);
}
}
@@ -78,11 +78,12 @@ static void USB_DeviceTask(void)
static void USB_HostTask(void)
{
uint8_t PrevPipe = Pipe_GetCurrentPipe();
-
+
Pipe_SelectPipe(PIPE_CONTROLPIPE);
USB_Host_ProcessNextHostState();
-
+
Pipe_SelectPipe(PrevPipe);
}
#endif
+
diff --git a/LUFA/Drivers/USB/HighLevel/USBTask.h b/LUFA/Drivers/USB/HighLevel/USBTask.h
index 2af1bd3d2..3b7f5c827 100644
--- a/LUFA/Drivers/USB/HighLevel/USBTask.h
+++ b/LUFA/Drivers/USB/HighLevel/USBTask.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -45,7 +45,7 @@
#include <avr/interrupt.h>
#include <stdint.h>
#include <stdbool.h>
-
+
#include "../LowLevel/USBController.h"
#include "Events.h"
#include "StdRequestType.h"
@@ -59,7 +59,7 @@
#if defined(USB_CAN_BE_HOST)
#include "HostStandardReq.h"
#endif
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -69,7 +69,7 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Global Variables: */
/** Indicates if the USB interface is currently initialized but not necessarily connected to a host
@@ -90,7 +90,7 @@
* \ingroup Group_USBManagement
*/
extern USB_Request_Header_t USB_ControlRequest;
-
+
#if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
#if !defined(HOST_STATE_AS_GPIOR) || defined(__DOXYGEN__)
/** Indicates the current host state machine state. When in host mode, this indicates the state
@@ -101,7 +101,7 @@
* the library internally.
*
* To reduce program size and speed up checks of this global, it can be placed into one of the AVR's
- * GPIOR hardware registers instead of RAM by defining the HOST_STATE_AS_GPIOR token to a value
+ * GPIOR hardware registers instead of RAM by defining the HOST_STATE_AS_GPIOR token to a value
* between 0 and 2 in the project makefile and passing it to the compiler via the -D switch. When
* defined, the corresponding GPIOR register should not be used in the user application except
* implicitly via the library APIs.
@@ -130,7 +130,7 @@
* (see \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events).
*
* To reduce program size and speed up checks of this global, it can be placed into one of the AVR's
- * GPIOR hardware registers instead of RAM by defining the DEVICE_STATE_AS_GPIOR token to a value
+ * GPIOR hardware registers instead of RAM by defining the DEVICE_STATE_AS_GPIOR token to a value
* between 0 and 2 in the project makefile and passing it to the compiler via the -D switch. When
* defined, the corresponding GPIOR register should not be used in the user application except
* implicitly via the library APIs.
@@ -162,7 +162,7 @@
* The USB task must be serviced within 30ms while in device mode, or within 1ms while in host mode.
* The task may be serviced at all times, or (for minimum CPU consumption):
*
- * - In device mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_Device_Connect()
+ * - In device mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_Device_Connect()
* event and disabled again on the firing of the \ref EVENT_USB_Device_Disconnect() event.
*
* - In host mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_Host_DeviceAttached()
@@ -185,21 +185,22 @@
#if defined(USB_CAN_BE_HOST)
static void USB_HostTask(void);
#endif
-
+
#if defined(USB_CAN_BE_DEVICE)
static void USB_DeviceTask(void);
#endif
#endif
-
+
/* Macros: */
#define HOST_TASK_NONBLOCK_WAIT(Duration, NextState) MACROS{ USB_HostState = HOST_STATE_WaitForDevice; \
WaitMSRemaining = (Duration); \
PostWaitState = (NextState); }MACROE
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
+
diff --git a/LUFA/Drivers/USB/LowLevel/Device.c b/LUFA/Drivers/USB/LowLevel/Device.c
index 5355ca27c..29dca81cf 100644
--- a/LUFA/Drivers/USB/LowLevel/Device.c
+++ b/LUFA/Drivers/USB/LowLevel/Device.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -50,3 +50,4 @@ void USB_Device_SendRemoteWakeup(void)
}
#endif
+
diff --git a/LUFA/Drivers/USB/LowLevel/Device.h b/LUFA/Drivers/USB/LowLevel/Device.h
index 03440d28f..20c915783 100644
--- a/LUFA/Drivers/USB/LowLevel/Device.h
+++ b/LUFA/Drivers/USB/LowLevel/Device.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -54,7 +54,7 @@
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
- #include "../../../Common/Common.h"
+ #include "../../../Common/Common.h"
#include "../HighLevel/StdDescriptors.h"
#include "USBInterrupt.h"
#include "Endpoint.h"
@@ -67,7 +67,7 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || defined(__DOXYGEN__)
@@ -82,7 +82,7 @@
*/
#define USB_DEVICE_OPT_LOWSPEED (1 << 0)
#endif
-
+
/** Mask for the Options parameter of the \ref USB_Init() function. This indicates that the
* USB interface should be initialized in full speed (12Mb/s) mode.
*/
@@ -109,7 +109,7 @@
* \see \ref Group_Descriptors for more information on the RMWAKEUP feature and device descriptors.
*/
void USB_Device_SendRemoteWakeup(void);
-
+
/* Type Defines: */
enum USB_Device_States_t
{
@@ -138,7 +138,7 @@
* resumed.
*/
};
-
+
/* Inline Functions: */
/** Returns the current USB frame number, when in device mode. Every millisecond the USB bus is active (i.e. enumerated to a host)
* the frame number is incremented by one.
@@ -147,7 +147,7 @@
{
return UDFNUM;
}
-
+
#if !defined(NO_SOF_EVENTS)
/** Enables the device mode Start Of Frame events. When enabled, this causes the
* \ref EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
@@ -160,7 +160,7 @@
{
USB_INT_Enable(USB_INT_SOFI);
}
-
+
/** Disables the device mode Start Of Frame events. When disabled, this stops the firing of the
* \ref EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.
*
@@ -172,13 +172,13 @@
USB_INT_Disable(USB_INT_SOFI);
}
#endif
-
+
/* Function Prototypes: */
/** Function to retrieve a given descriptor's size and memory location from the given descriptor type value,
- * index and language ID. This function MUST be overridden in the user application (added with full, identical
+ * index and language ID. This function MUST be overridden in the user application (added with full, identical
* prototype and name so that the library can call it to retrieve descriptor data.
*
- * \param[in] wValue The type of the descriptor to retrieve in the upper byte, and the index in the
+ * \param[in] wValue The type of the descriptor to retrieve in the upper byte, and the index in the
* lower byte (when more than one descriptor of the given type exists, such as the
* case of string descriptors). The type may be one of the standard types defined
* in the DescriptorTypes_t enum, or may be a class-specific descriptor type value.
@@ -193,7 +193,7 @@
*
* \note By default, the library expects all descriptors to be located in flash memory via the PROGMEM attribute.
* If descriptors should be located in RAM or EEPROM instead (to speed up access in the case of RAM, or to
- * allow the descriptors to be changed dynamically at runtime) either the USE_RAM_DESCRIPTORS or the
+ * allow the descriptors to be changed dynamically at runtime) either the USE_RAM_DESCRIPTORS or the
* USE_EEPROM_DESCRIPTORS tokens may be defined in the project makefile and passed to the compiler by the -D
* switch.
*
@@ -216,14 +216,14 @@
{
UDCON |= (1 << LSM);
}
-
+
static inline void USB_Device_SetFullSpeed(void) ATTR_ALWAYS_INLINE;
static inline void USB_Device_SetFullSpeed(void)
{
UDCON &= ~(1 << LSM);
}
#endif
-
+
static inline void USB_Device_SetDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void USB_Device_SetDeviceAddress(const uint8_t Address)
{
@@ -241,3 +241,4 @@
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.c b/LUFA/Drivers/USB/LowLevel/Endpoint.c
index fc2bff154..c0e639209 100644
--- a/LUFA/Drivers/USB/LowLevel/Endpoint.c
+++ b/LUFA/Drivers/USB/LowLevel/Endpoint.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -59,7 +59,7 @@ void Endpoint_ClearEndpoints(void)
for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++)
{
- Endpoint_SelectEndpoint(EPNum);
+ Endpoint_SelectEndpoint(EPNum);
UEIENX = 0;
UEINTX = 0;
UECFG1X = 0;
@@ -86,7 +86,7 @@ void Endpoint_ClearStatusStage(void)
if (USB_DeviceState == DEVICE_STATE_Unattached)
return;
}
-
+
Endpoint_ClearIN();
}
}
@@ -95,7 +95,7 @@ void Endpoint_ClearStatusStage(void)
uint8_t Endpoint_WaitUntilReady(void)
{
#if (USB_STREAM_TIMEOUT_MS < 0xFF)
- uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
+ uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
#else
uint16_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
#endif
@@ -114,13 +114,13 @@ uint8_t Endpoint_WaitUntilReady(void)
if (Endpoint_IsOUTReceived())
return ENDPOINT_READYWAIT_NoError;
}
-
+
uint8_t USB_DeviceState_LCL = USB_DeviceState;
if (USB_DeviceState_LCL == DEVICE_STATE_Unattached)
return ENDPOINT_READYWAIT_DeviceDisconnected;
else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended)
- return ENDPOINT_READYWAIT_BusSuspended;
+ return ENDPOINT_READYWAIT_BusSuspended;
else if (Endpoint_IsStalled())
return ENDPOINT_READYWAIT_EndpointStalled;
@@ -138,3 +138,4 @@ uint8_t Endpoint_WaitUntilReady(void)
#endif
#endif
+
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h
index 66f5591f0..25ed9bad9 100644
--- a/LUFA/Drivers/USB/LowLevel/Endpoint.h
+++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -43,13 +43,13 @@
*
* Functions, macros, variables, enums and types related to data reading and writing from and to endpoints.
*/
-
+
/** \ingroup Group_EndpointRW
* @defgroup Group_EndpointPrimitiveRW Read/Write of Primitive Data Types
*
* Functions, macros, variables, enums and types related to data reading and writing of primitive data types
* from and to endpoints.
- */
+ */
/** \ingroup Group_EndpointManagement
* @defgroup Group_EndpointPacketManagement Endpoint Packet Management
@@ -77,7 +77,7 @@
#include "../../../Common/Common.h"
#include "../HighLevel/USBTask.h"
#include "USBInterrupt.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -98,10 +98,10 @@
#define _ENDPOINT_GET_DOUBLEBANK(EPIndex) _ENDPOINT_GET_DOUBLEBANK2(ENDPOINT_DETAILS_EP ## EPIndex)
#define _ENDPOINT_GET_DOUBLEBANK2(EPDetails) _ENDPOINT_GET_DOUBLEBANK3(EPDetails)
#define _ENDPOINT_GET_DOUBLEBANK3(MaxSize, DB) (DB)
-
+
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
#define ENDPOINT_DETAILS_MAXEP 7
-
+
#define ENDPOINT_DETAILS_EP0 64, true
#define ENDPOINT_DETAILS_EP1 256, true
#define ENDPOINT_DETAILS_EP2 64, true
@@ -116,7 +116,7 @@
#define ENDPOINT_DETAILS_EP1 64, false
#define ENDPOINT_DETAILS_EP2 64, false
#define ENDPOINT_DETAILS_EP3 64, true
- #define ENDPOINT_DETAILS_EP4 64, true
+ #define ENDPOINT_DETAILS_EP4 64, true
#endif
/* Inline Functions: */
@@ -126,13 +126,13 @@
{
uint8_t MaskVal = 0;
uint16_t CheckBytes = 8;
-
+
while (CheckBytes < Bytes)
{
MaskVal++;
CheckBytes <<= 1;
}
-
+
return (MaskVal << EPSIZE0);
}
@@ -143,7 +143,7 @@
const uint8_t UECFG1XData);
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Endpoint data direction mask for \ref Endpoint_ConfigureEndpoint(). This indicates that the endpoint
@@ -169,19 +169,19 @@
* accesses the second bank.
*/
#define ENDPOINT_BANK_DOUBLE (1 << EPBK0)
-
+
/** Endpoint address for the default control endpoint, which always resides in address 0. This is
* defined for convenience to give more readable code when used with the endpoint macros.
*/
#define ENDPOINT_CONTROLEP 0
#if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__))
- /** Default size of the default control endpoint's bank, until altered by the control endpoint bank size
+ /** Default size of the default control endpoint's bank, until altered by the control endpoint bank size
* value in the device descriptor. Not available if the FIXED_CONTROL_ENDPOINT_SIZE token is defined.
*/
#define ENDPOINT_CONTROLEP_DEFAULT_SIZE 8
#endif
-
+
/** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's
* numerical address in the device.
*/
@@ -196,17 +196,17 @@
* bank size in the device.
*/
#define ENDPOINT_EPSIZE_MASK 0x7F
-
+
/** Maximum size in bytes of a given endpoint.
*
* \param[in] EPIndex Endpoint number, a value between 0 and (ENDPOINT_TOTAL_ENDPOINTS - 1)
- */
+ */
#define ENDPOINT_MAX_SIZE(EPIndex) _ENDPOINT_GET_MAXSIZE(EPIndex)
/** Indicates if the given endpoint supports double banking.
*
* \param[in] EPIndex Endpoint number, a value between 0 and (ENDPOINT_TOTAL_ENDPOINTS - 1)
- */
+ */
#define ENDPOINT_DOUBLEBANK_SUPPORTED(EPIndex) _ENDPOINT_GET_DOUBLEBANK(EPIndex)
#if !defined(CONTROL_ONLY_DEVICE) || defined(__DOXYGEN__)
@@ -243,7 +243,7 @@
*/
};
- /* Inline Functions: */
+ /* Inline Functions: */
/** Configures the specified endpoint number with the given endpoint type, direction, bank size
* and banking mode. Once configured, the endpoint may be read from or written to, depending
* on its direction.
@@ -274,7 +274,7 @@
* index - refer to the chosen USB AVR's datasheet to determine the maximum bank size for each endpoint.
* \n\n
*
- * \note The default control endpoint should not be manually configured by the user application, as
+ * \note The default control endpoint should not be manually configured by the user application, as
* it is automatically configured by the library internally.
* \n\n
*
@@ -318,7 +318,7 @@
return UEBCLX;
#endif
}
-
+
/** Get the endpoint address of the currently selected endpoint. This is typically used to save
* the currently selected endpoint number so that it can be restored after another endpoint has
* been manipulated.
@@ -334,7 +334,7 @@
return ENDPOINT_CONTROLEP;
#endif
}
-
+
/** Selects the given endpoint number. If the address from the device descriptors is used, the
* value should be masked with the \ref ENDPOINT_EPNUM_MASK constant to extract only the endpoint
* number (and discarding the endpoint direction bit).
@@ -349,9 +349,9 @@
{
#if !defined(CONTROL_ONLY_DEVICE)
UENUM = EndpointNumber;
- #endif
+ #endif
}
-
+
/** Resets the endpoint bank FIFO. This clears all the endpoint banks and resets the USB controller's
* In and Out pointers to the bank's contents.
*
@@ -363,7 +363,7 @@
UERST = (1 << EndpointNumber);
UERST = 0;
}
-
+
/** Enables the currently selected endpoint so that data can be sent and received through it to
* and from a host.
*
@@ -383,7 +383,7 @@
{
UECONX &= ~(1 << EPEN);
}
-
+
/** Determines if the currently selected endpoint is enabled, but not necessarily configured.
*
* \return Boolean True if the currently selected endpoint is enabled, false otherwise.
@@ -393,7 +393,7 @@
{
return ((UECONX & (1 << EPEN)) ? true : false);
}
-
+
/** Determines if the currently selected endpoint may be read from (if data is waiting in the endpoint
* bank and the endpoint is an OUT direction, or if the bank is not yet full if the endpoint is an IN
* direction). This function will return false if an error has occurred in the endpoint, if the endpoint
@@ -409,7 +409,7 @@
{
return ((UEINTX & (1 << RWAL)) ? true : false);
}
-
+
/** Determines if the currently selected endpoint is configured.
*
* \return Boolean true if the currently selected endpoint has been configured, false otherwise.
@@ -419,7 +419,7 @@
{
return ((UESTA0X & (1 << CFGOK)) ? true : false);
}
-
+
/** Returns a mask indicating which INTERRUPT type endpoints have interrupted - i.e. their
* interrupt duration has elapsed. Which endpoints have interrupted can be determined by
* masking the return value against (1 << {Endpoint Number}).
@@ -431,7 +431,7 @@
{
return UEINT;
}
-
+
/** Determines if the specified endpoint number has interrupted (valid only for INTERRUPT type
* endpoints).
*
@@ -444,7 +444,7 @@
{
return ((UEINT & (1 << EndpointNumber)) ? true : false);
}
-
+
/** Determines if the selected IN endpoint is ready for a new packet to be sent to the host.
*
* \ingroup Group_EndpointPacketManagement
@@ -456,7 +456,7 @@
{
return ((UEINTX & (1 << TXINI)) ? true : false);
}
-
+
/** Determines if the selected OUT endpoint has received new packet from the host.
*
* \ingroup Group_EndpointPacketManagement
@@ -468,7 +468,7 @@
{
return ((UEINTX & (1 << RXOUTI)) ? true : false);
}
-
+
/** Determines if the current CONTROL type endpoint has received a SETUP packet.
*
* \ingroup Group_EndpointPacketManagement
@@ -480,20 +480,20 @@
{
return ((UEINTX & (1 << RXSTPI)) ? true : false);
}
-
+
/** Clears a received SETUP packet on the currently selected CONTROL type endpoint, freeing up the
* endpoint for the next packet.
*
* \ingroup Group_EndpointPacketManagement
*
- * \note This is not applicable for non CONTROL type endpoints.
+ * \note This is not applicable for non CONTROL type endpoints.
*/
static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ClearSETUP(void)
{
UEINTX &= ~(1 << RXSTPI);
}
-
+
/** Sends an IN packet to the host on the currently selected endpoint, freeing up the endpoint for the
* next packet and switching to the alternative endpoint bank if double banked.
*
@@ -508,7 +508,7 @@
UEINTX &= ~(1 << TXINI);
#endif
}
-
+
/** Acknowledges an OUT packet to the host on the currently selected endpoint, freeing up the endpoint
* for the next packet and switching to the alternative endpoint bank if double banked.
*
@@ -520,10 +520,10 @@
#if !defined(CONTROL_ONLY_DEVICE)
UEINTX &= ~((1 << RXOUTI) | (1 << FIFOCON));
#else
- UEINTX &= ~(1 << RXOUTI);
+ UEINTX &= ~(1 << RXOUTI);
#endif
}
-
+
/** Stalls the current endpoint, indicating to the host that a logical problem occurred with the
* indicated endpoint and that the current transfer sequence should be aborted. This provides a
* way for devices to indicate invalid commands to the host so that the current transfer can be
@@ -540,7 +540,7 @@
{
UECONX |= (1 << STALLRQ);
}
-
+
/** Clears the STALL condition on the currently selected endpoint.
*
* \ingroup Group_EndpointPacketManagement
@@ -550,7 +550,7 @@
{
UECONX |= (1 << STALLRQC);
}
-
+
/** Determines if the currently selected endpoint is stalled, false otherwise.
*
* \ingroup Group_EndpointPacketManagement
@@ -562,14 +562,14 @@
{
return ((UECONX & (1 << STALLRQ)) ? true : false);
}
-
+
/** Resets the data toggle of the currently selected endpoint. */
static inline void Endpoint_ResetDataToggle(void) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ResetDataToggle(void)
{
UECONX |= (1 << RSTDT);
}
-
+
/** Determines the currently selected endpoint's direction.
*
* \return The currently selected endpoint's direction, as a ENDPOINT_DIR_* mask.
@@ -622,10 +622,10 @@
static inline void Endpoint_Discard_Byte(void)
{
uint8_t Dummy;
-
+
Dummy = UEDATX;
}
-
+
/** Reads two bytes from the currently selected endpoint's bank in little endian format, for OUT
* direction endpoints.
*
@@ -641,10 +641,10 @@
uint16_t Word;
uint8_t Bytes[2];
} Data;
-
+
Data.Bytes[0] = UEDATX;
Data.Bytes[1] = UEDATX;
-
+
return Data.Word;
}
@@ -663,10 +663,10 @@
uint16_t Word;
uint8_t Bytes[2];
} Data;
-
+
Data.Bytes[1] = UEDATX;
Data.Bytes[0] = UEDATX;
-
+
return Data.Word;
}
@@ -683,7 +683,7 @@
UEDATX = (Word & 0xFF);
UEDATX = (Word >> 8);
}
-
+
/** Writes two bytes to the currently selected endpoint's bank in big endian format, for IN
* direction endpoints.
*
@@ -706,7 +706,7 @@
static inline void Endpoint_Discard_Word(void)
{
uint8_t Dummy;
-
+
Dummy = UEDATX;
Dummy = UEDATX;
}
@@ -726,12 +726,12 @@
uint32_t DWord;
uint8_t Bytes[4];
} Data;
-
+
Data.Bytes[0] = UEDATX;
Data.Bytes[1] = UEDATX;
Data.Bytes[2] = UEDATX;
Data.Bytes[3] = UEDATX;
-
+
return Data.DWord;
}
@@ -750,12 +750,12 @@
uint32_t DWord;
uint8_t Bytes[4];
} Data;
-
+
Data.Bytes[3] = UEDATX;
Data.Bytes[2] = UEDATX;
Data.Bytes[1] = UEDATX;
Data.Bytes[0] = UEDATX;
-
+
return Data.DWord;
}
@@ -774,7 +774,7 @@
UEDATX = (DWord >> 16);
UEDATX = (DWord >> 24);
}
-
+
/** Writes four bytes to the currently selected endpoint's bank in big endian format, for IN
* direction endpoints.
*
@@ -791,7 +791,7 @@
UEDATX = (DWord & 0xFF);
}
- /** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints.
+ /** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints.
*
* \ingroup Group_EndpointPrimitiveRW
*/
@@ -799,7 +799,7 @@
static inline void Endpoint_Discard_DWord(void)
{
uint8_t Dummy;
-
+
Dummy = UEDATX;
Dummy = UEDATX;
Dummy = UEDATX;
@@ -850,7 +850,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/LowLevel/Host.c b/LUFA/Drivers/USB/LowLevel/Host.c
index 1fa5290fc..25b08b73b 100644
--- a/LUFA/Drivers/USB/LowLevel/Host.c
+++ b/LUFA/Drivers/USB/LowLevel/Host.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -55,15 +55,15 @@ void USB_Host_ProcessNextHostState(void)
ErrorCode = HOST_ENUMERROR_WaitStage;
break;
}
-
+
if (!(--WaitMSRemaining))
USB_HostState = PostWaitState;
}
-
+
break;
case HOST_STATE_Powered:
WaitMSRemaining = HOST_DEVICE_SETTLE_DELAY_MS;
-
+
USB_HostState = HOST_STATE_Powered_WaitForDeviceSettle;
break;
case HOST_STATE_Powered_WaitForDeviceSettle:
@@ -79,23 +79,23 @@ void USB_Host_ProcessNextHostState(void)
USB_OTGPAD_On();
USB_Host_VBUS_Auto_Enable();
USB_Host_VBUS_Auto_On();
-
+
USB_HostState = HOST_STATE_Powered_WaitForConnect;
}
-
+
break;
- case HOST_STATE_Powered_WaitForConnect:
+ case HOST_STATE_Powered_WaitForConnect:
if (USB_INT_HasOccurred(USB_INT_DCONNI))
- {
+ {
USB_INT_Clear(USB_INT_DCONNI);
USB_INT_Clear(USB_INT_DDISCI);
USB_INT_Clear(USB_INT_VBERRI);
USB_INT_Enable(USB_INT_VBERRI);
-
+
USB_Host_ResumeBus();
Pipe_ClearPipes();
-
+
HOST_TASK_NONBLOCK_WAIT(100, HOST_STATE_Powered_DoReset);
}
@@ -108,8 +108,8 @@ void USB_Host_ProcessNextHostState(void)
case HOST_STATE_Powered_ConfigPipe:
Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL,
PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP,
- PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE);
-
+ PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE);
+
if (!(Pipe_IsConfigured()))
{
ErrorCode = HOST_ENUMERROR_PipeConfigError;
@@ -138,9 +138,9 @@ void USB_Host_ProcessNextHostState(void)
}
USB_ControlPipeSize = DataBuffer[offsetof(USB_Descriptor_Device_t, Endpoint0Size)];
-
+
USB_Host_ResetDevice();
-
+
HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset);
break;
case HOST_STATE_Default_PostReset:
@@ -197,7 +197,7 @@ uint8_t USB_Host_WaitMS(uint8_t MS)
bool BusSuspended = USB_Host_IsBusSuspended();
uint8_t ErrorCode = HOST_WAITERROR_Successful;
bool HSOFIEnabled = USB_INT_IsEnabled(USB_INT_HSOFI);
-
+
USB_INT_Disable(USB_INT_HSOFI);
USB_INT_Clear(USB_INT_HSOFI);
@@ -210,11 +210,11 @@ uint8_t USB_Host_WaitMS(uint8_t MS)
USB_INT_Clear(USB_INT_HSOFI);
MS--;
}
-
+
if ((USB_HostState == HOST_STATE_Unattached) || (USB_CurrentMode != USB_MODE_Host))
{
ErrorCode = HOST_WAITERROR_DeviceDisconnect;
-
+
break;
}
@@ -222,16 +222,16 @@ uint8_t USB_Host_WaitMS(uint8_t MS)
{
Pipe_ClearError();
ErrorCode = HOST_WAITERROR_PipeError;
-
+
break;
}
-
+
if (Pipe_IsStalled() == true)
{
Pipe_ClearStall();
ErrorCode = HOST_WAITERROR_SetupStalled;
-
- break;
+
+ break;
}
}
@@ -249,7 +249,7 @@ static void USB_Host_ResetDevice(void)
bool BusSuspended = USB_Host_IsBusSuspended();
USB_INT_Disable(USB_INT_DDISCI);
-
+
USB_Host_ResetBus();
while (!(USB_Host_IsBusResetComplete()));
USB_Host_ResumeBus();
@@ -258,7 +258,7 @@ static void USB_Host_ResetDevice(void)
USB_INT_Disable(USB_INT_HSOFI);
USB_INT_Clear(USB_INT_HSOFI);
-
+
for (uint8_t MSRem = 10; MSRem != 0; MSRem--)
{
/* Workaround for powerless-pull-up devices. After a USB bus reset,
@@ -272,7 +272,7 @@ static void USB_Host_ResetDevice(void)
USB_INT_Clear(USB_INT_DDISCI);
break;
}
-
+
_delay_ms(1);
}
@@ -297,7 +297,7 @@ uint8_t USB_Host_SetDeviceConfiguration(const uint8_t ConfigNumber)
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
return USB_Host_SendControlRequest(NULL);
}
@@ -313,7 +313,7 @@ uint8_t USB_Host_GetDeviceDescriptor(void* const DeviceDescriptorPtr)
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
return USB_Host_SendControlRequest(DeviceDescriptorPtr);
}
@@ -331,7 +331,7 @@ uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index,
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
return USB_Host_SendControlRequest(Buffer);
}
@@ -347,8 +347,9 @@ uint8_t USB_Host_ClearPipeStall(const uint8_t EndpointNum)
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
+
return USB_Host_SendControlRequest(NULL);
}
#endif
+
diff --git a/LUFA/Drivers/USB/LowLevel/Host.h b/LUFA/Drivers/USB/LowLevel/Host.h
index 2da2e4ce6..f29ab1b3b 100644
--- a/LUFA/Drivers/USB/LowLevel/Host.h
+++ b/LUFA/Drivers/USB/LowLevel/Host.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -45,7 +45,7 @@
*
* @{
*/
-
+
#ifndef __USBHOST_H__
#define __USBHOST_H__
@@ -68,7 +68,7 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Indicates the fixed USB device address which any attached device is enumerated to when in
@@ -83,12 +83,12 @@
* device. If a device fails to respond to a sent control request within this period, the
* library will return a timeout error code.
*
- * This value may be overridden in the user project makefile as the value of the
+ * This value may be overridden in the user project makefile as the value of the
* \ref USB_HOST_TIMEOUT_MS token, and passed to the compiler using the -D switch.
*/
#define USB_HOST_TIMEOUT_MS 1000
#endif
-
+
#if !defined(HOST_DEVICE_SETTLE_DELAY_MS) || defined(__DOXYGEN__)
/** Constant for the delay in milliseconds after a device is connected before the library
* will start the enumeration process. Some devices require a delay of up to 5 seconds
@@ -131,52 +131,52 @@
HOST_STATE_Unattached = 2, /**< Internally implemented by the library. This state indicates
* that the host state machine is waiting for a device to be
* attached so that it can start the enumeration process.
- *
+ *
* \note Do not manually change to this state in the user code.
*/
HOST_STATE_Powered = 3, /**< Internally implemented by the library. This state indicates
* that a device has been attached, and the library's internals
* are being configured to begin the enumeration process.
- *
+ *
* \note Do not manually change to this state in the user code.
*/
HOST_STATE_Powered_WaitForDeviceSettle = 4, /**< Internally implemented by the library. This state indicates
* that the stack is waiting for the initial settling period to
* elapse before beginning the enumeration process.
- *
+ *
* \note Do not manually change to this state in the user code.
*/
HOST_STATE_Powered_WaitForConnect = 5, /**< Internally implemented by the library. This state indicates
* that the stack is waiting for a connection event from the USB
* controller to indicate a valid USB device has been attached to
* the bus and is ready to be enumerated.
- *
+ *
* \note Do not manually change to this state in the user code.
*/
HOST_STATE_Powered_DoReset = 6, /**< Internally implemented by the library. This state indicates
* that a valid USB device has been attached, and that it is
* will now be reset to ensure it is ready for enumeration.
- *
+ *
* \note Do not manually change to this state in the user code.
*/
HOST_STATE_Powered_ConfigPipe = 7, /**< Internally implemented by the library. This state indicates
* that the attached device is currently powered and reset, and
* that the control pipe is now being configured by the stack.
- *
+ *
* \note Do not manually change to this state in the user code.
*/
HOST_STATE_Default = 8, /**< Internally implemented by the library. This state indicates
* that the stack is currently retrieving the control endpoint's
* size from the device, so that the control pipe can be altered
* to match.
- *
+ *
* \note Do not manually change to this state in the user code.
*/
HOST_STATE_Default_PostReset = 9, /**< Internally implemented by the library. This state indicates that
* the control pipe is being reconfigured to match the retrieved
* control endpoint size from the device, and the device's USB bus
* address is being set.
- *
+ *
* \note Do not manually change to this state in the user code.
*/
HOST_STATE_Default_PostAddressSet = 10, /**< Internally implemented by the library. This state indicates that
@@ -185,7 +185,7 @@
* stack to change the current USB device address to that set for
* the connected device, before progressing to the user-implemented
* \ref HOST_STATE_Addressed state for further communications.
- *
+ *
* \note Do not manually change to this state in the user code.
*/
HOST_STATE_Addressed = 11, /**< May be implemented by the user project. This state should
@@ -204,7 +204,7 @@
* \ref HOST_STATE_WaitForDeviceRemoval states as needed.
*/
};
-
+
/** Enum for the error codes for the \ref EVENT_USB_Host_HostError() event.
*
* \see \ref Group_Events for more information on this event.
@@ -218,7 +218,7 @@
* current.
*/
};
-
+
/** Enum for the error codes for the \ref EVENT_USB_Host_DeviceEnumerationFailed() event.
*
* \see \ref Group_Events for more information on this event.
@@ -252,7 +252,7 @@
{
return UHFNUM;
}
-
+
#if !defined(NO_SOF_EVENTS)
/** Enables the host mode Start Of Frame events. When enabled, this causes the
* \ref EVENT_USB_Host_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
@@ -265,7 +265,7 @@
{
USB_INT_Enable(USB_INT_HSOFI);
}
-
+
/** Disables the host mode Start Of Frame events. When disabled, this stops the firing of the
* \ref EVENT_USB_Host_StartOfFrame() event when enumerated in host mode.
*
@@ -277,7 +277,7 @@
USB_INT_Disable(USB_INT_HSOFI);
}
#endif
-
+
/** Resets the USB bus, including the endpoints in any attached device and pipes on the AVR host.
* USB bus resets leave the default control pipe configured (if already configured).
*
@@ -320,7 +320,7 @@
{
UHCON &= ~(1 << SOFEN);
}
-
+
/** Determines if the USB bus has been suspended via the use of the \ref USB_Host_SuspendBus() macro,
* false otherwise. While suspended, no USB communications can occur until the bus is resumed,
* except for the Remote Wakeup event from the device if supported.
@@ -332,7 +332,7 @@
{
return ((UHCON & (1 << SOFEN)) ? false : true);
}
-
+
/** Determines if the attached device is currently enumerated in Full Speed mode (12Mb/s), or
* false if the attached device is enumerated in Low Speed mode (1.5Mb/s).
*
@@ -371,7 +371,7 @@
{
UHCON |= (1 << RESUME);
}
-
+
/** Determines if a resume from Remote Wakeup request is currently being sent to an attached
* device.
*
@@ -395,7 +395,7 @@
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result.
*/
uint8_t USB_Host_SetDeviceConfiguration(const uint8_t ConfigNumber);
-
+
/** Convenience function. This routine sends a GetDescriptor standard request to the attached
* device, requesting the device descriptor. This can be used to easily retrieve information
* about the device such as its VID, PID and power requirements.
@@ -408,7 +408,7 @@
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result.
*/
uint8_t USB_Host_GetDeviceDescriptor(void* const DeviceDescriptorPtr);
-
+
/** Convenience function. This routine sends a GetDescriptor standard request to the attached
* device, requesting the string descriptor of the specified index. This can be used to easily
* retrieve string descriptors from the device by index, after the index is obtained from the
@@ -426,7 +426,7 @@
uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index,
void* const Buffer,
const uint8_t BufferLength);
-
+
/** Clears a stall condition on the given pipe, via a ClearFeature request to the attached device.
*
* \note After this routine returns, the control pipe will be selected.
@@ -458,13 +458,13 @@
OTGCON &= ~(1 << VBUSHWC);
UHWCON |= (1 << UVCONE);
}
-
+
static inline void USB_Host_VBUS_Manual_Enable(void) ATTR_ALWAYS_INLINE;
static inline void USB_Host_VBUS_Manual_Enable(void)
{
OTGCON |= (1 << VBUSHWC);
UHWCON &= ~(1 << UVCONE);
-
+
DDRE |= (1 << 7);
}
@@ -479,7 +479,7 @@
{
PORTE |= (1 << 7);
}
-
+
static inline void USB_Host_VBUS_Auto_Off(void) ATTR_ALWAYS_INLINE;
static inline void USB_Host_VBUS_Auto_Off(void)
{
@@ -490,7 +490,7 @@
static inline void USB_Host_VBUS_Manual_Off(void)
{
PORTE &= ~(1 << 7);
- }
+ }
static inline void USB_Host_SetDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void USB_Host_SetDeviceAddress(const uint8_t Address)
@@ -510,7 +510,7 @@
/* Function Prototypes: */
void USB_Host_ProcessNextHostState(void);
uint8_t USB_Host_WaitMS(uint8_t MS);
-
+
#if defined(__INCLUDE_FROM_HOST_C)
static void USB_Host_ResetDevice(void);
#endif
@@ -520,7 +520,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/LowLevel/OTG.h b/LUFA/Drivers/USB/LowLevel/OTG.h
index 5afa8b3a2..d77b41b49 100644
--- a/LUFA/Drivers/USB/LowLevel/OTG.h
+++ b/LUFA/Drivers/USB/LowLevel/OTG.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -27,7 +27,7 @@
arising out of or in connection with the use or performance of
this software.
*/
-
+
/** \file
* \brief USB OTG mode definitions.
*
@@ -54,26 +54,26 @@
/* Includes: */
#include <avr/io.h>
#include <stdbool.h>
-
+
#include "../../../Common/Common.h"
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the VBUS pulsing method of SRP, supported by some OTG devices.
*
* \see \ref USB_OTG_Device_InitiateSRP().
- */
+ */
#define USB_OTG_SRP_VBUS (1 << SRPSEL)
/** Mask for the Data + pulsing method of SRP, supported by some OTG devices.
*
* \see \ref USB_OTG_Device_InitiateSRP().
- */
+ */
#define USB_OTG_STP_DATA 0
/* Inline Functions: */
@@ -85,7 +85,7 @@
{
OTGCON |= (1 << HNPREQ);
}
-
+
/** Cancel a Host Negotiation Protocol request. This stops a pending HNP request to the other
* connected device.
*/
@@ -94,7 +94,7 @@
{
OTGCON &= ~(1 << HNPREQ);
}
-
+
/** Determines if the device is currently sending a HNP to an attached host.
*
* \return Boolean true if currently sending a HNP to the other connected device, false otherwise
@@ -104,7 +104,7 @@
{
return ((OTGCON & (1 << HNPREQ)) ? true : false);
}
-
+
/** Initiates a Session Request Protocol request. Most OTG devices turn off VBUS when the USB
* interface is not in use, to conserve power. Sending a SRP to a USB OTG device running in
* host mode indicates that VBUS should be applied and a session started.
@@ -129,7 +129,7 @@
{
OTGCON |= (1 << HNPREQ);
}
-
+
/** Rejects a HNP from a connected device, indicating that both devices should remain in their
* current device/host roles.
*/
@@ -138,7 +138,7 @@
{
OTGCON &= ~(1 << HNPREQ);
}
-
+
/** Indicates if the connected device is not currently sending a HNP request.
*
* \return Boolean true if a HNP is currently being issued by the connected device, false otherwise.
@@ -148,7 +148,8 @@
{
return ((OTGCON & (1 << HNPREQ)) ? true : false);
}
-
+
#endif
-
+
/** @} */
+
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c
index e5c30e4b5..74a8f51e4 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.c
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -48,7 +48,7 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
Pipe_EnablePipe();
UPCFG1X = 0;
-
+
UPCFG0X = ((Type << EPTYPE0) | Token | ((EndpointNumber & PIPE_EPNUM_MASK) << PEPNUM0));
UPCFG1X = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size));
@@ -78,20 +78,20 @@ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress)
for (uint8_t PNum = 0; PNum < PIPE_TOTAL_PIPES; PNum++)
{
Pipe_SelectPipe(PNum);
-
+
if (!(Pipe_IsConfigured()))
continue;
-
+
uint8_t PipeToken = Pipe_GetPipeToken();
bool PipeTokenCorrect = true;
if (PipeToken != PIPE_TOKEN_SETUP)
PipeTokenCorrect = (PipeToken == ((EndpointAddress & PIPE_EPDIR_MASK) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT));
-
+
if (PipeTokenCorrect && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)))
return true;
}
-
+
Pipe_SelectPipe(PrevPipeNumber);
return false;
}
@@ -99,13 +99,13 @@ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress)
uint8_t Pipe_WaitUntilReady(void)
{
#if (USB_STREAM_TIMEOUT_MS < 0xFF)
- uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
+ uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
#else
uint16_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
#endif
uint16_t PreviousFrameNumber = USB_Host_GetFrameNumber();
-
+
for (;;)
{
if (Pipe_GetPipeToken() == PIPE_TOKEN_IN)
@@ -116,7 +116,7 @@ uint8_t Pipe_WaitUntilReady(void)
else
{
if (Pipe_IsOUTReady())
- return PIPE_READYWAIT_NoError;
+ return PIPE_READYWAIT_NoError;
}
if (Pipe_IsStalled())
@@ -137,3 +137,4 @@ uint8_t Pipe_WaitUntilReady(void)
}
#endif
+
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h
index 58a5c9464..d8ba1bb02 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.h
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -27,7 +27,7 @@
arising out of or in connection with the use or performance of
this software.
*/
-
+
/** \file
* \brief USB host pipe management definitions.
*
@@ -36,27 +36,27 @@
*
* \note This file should not be included directly. It is automatically included as needed by the USB driver
* dispatch header located in LUFA/Drivers/USB/USB.h.
- */
+ */
/** \ingroup Group_PipeManagement
* @defgroup Group_PipeRW Pipe Data Reading and Writing
*
* Functions, macros, variables, enums and types related to data reading and writing from and to pipes.
*/
-
-/** \ingroup Group_PipeRW
+
+/** \ingroup Group_PipeRW
* @defgroup Group_PipePrimitiveRW Read/Write of Primitive Data Types
*
* Functions, macros, variables, enums and types related to data reading and writing of primitive data types
* from and to pipes.
*/
-
+
/** \ingroup Group_PipeManagement
* @defgroup Group_PipePacketManagement Pipe Packet Management
*
* Functions, macros, variables, enums and types related to packet management of pipes.
*/
-
+
/** \ingroup Group_PipeManagement
* @defgroup Group_PipeControlReq Pipe Control Request Management
*
@@ -64,7 +64,7 @@
* vendor control requests to the default control endpoint of an attached device while in host mode.
*
* \see Chapter 9 of the USB 2.0 specification.
- */
+ */
/** \ingroup Group_USB
* @defgroup Group_PipeManagement Pipe Management
@@ -85,7 +85,7 @@
#include "../../../Common/Common.h"
#include "../HighLevel/USBTask.h"
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -95,7 +95,7 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */
@@ -146,17 +146,17 @@
* bank.
*/
#define PIPE_BANK_DOUBLE (1 << EPBK0)
-
+
/** Pipe address for the default control pipe, which always resides in address 0. This is
* defined for convenience to give more readable code when used with the pipe macros.
*/
#define PIPE_CONTROLPIPE 0
- /** Default size of the default control pipe's bank, until altered by the Endpoint0Size value
+ /** Default size of the default control pipe's bank, until altered by the Endpoint0Size value
* in the device descriptor of the attached device.
*/
#define PIPE_CONTROLPIPE_DEFAULT_SIZE 64
-
+
/** Pipe number mask, for masking against pipe addresses to retrieve the pipe's numerical address
* in the device.
*/
@@ -193,7 +193,7 @@
enum Pipe_WaitUntilReady_ErrorCodes_t
{
PIPE_READYWAIT_NoError = 0, /**< Pipe ready for next packet, no error. */
- PIPE_READYWAIT_PipeStalled = 1, /**< The device stalled the pipe while waiting. */
+ PIPE_READYWAIT_PipeStalled = 1, /**< The device stalled the pipe while waiting. */
PIPE_READYWAIT_DeviceDisconnected = 2, /**< Device was disconnected from the host while waiting. */
PIPE_READYWAIT_Timeout = 3, /**< The device failed to accept or send the next packet
* within the software timeout period set by the
@@ -216,7 +216,7 @@
{
return UPBCX;
}
-
+
/** Returns the pipe address of the currently selected pipe. This is typically used to save the
* currently selected pipe number so that it can be restored after another pipe has been manipulated.
*
@@ -238,7 +238,7 @@
{
UPNUM = PipeNumber;
}
-
+
/** Resets the desired pipe, including the pipe banks and flags.
*
* \param[in] PipeNumber Index of the pipe to reset.
@@ -249,7 +249,7 @@
UPRST = (1 << PipeNumber);
UPRST = 0;
}
-
+
/** Enables the currently selected pipe so that data can be sent and received through it to and from
* an attached device.
*
@@ -279,7 +279,7 @@
{
return ((UPCONX & (1 << PEN)) ? true : false);
}
-
+
/** Gets the current pipe token, indicating the pipe's data direction and type.
*
* \return The current pipe token, as a PIPE_TOKEN_* mask.
@@ -289,7 +289,7 @@
{
return (UPCFG0X & (0x03 << PTOKEN0));
}
-
+
/** Sets the token for the currently selected pipe to one of the tokens specified by the PIPE_TOKEN_*
* masks. This can be used on CONTROL type pipes, to allow for bidirectional transfer of data during
* control requests, or on regular pipes to allow for half-duplex bidirectional data transfer to devices
@@ -302,14 +302,14 @@
{
UPCFG0X = ((UPCFG0X & ~(0x03 << PTOKEN0)) | Token);
}
-
+
/** Configures the currently selected pipe to allow for an unlimited number of IN requests. */
static inline void Pipe_SetInfiniteINRequests(void) ATTR_ALWAYS_INLINE;
static inline void Pipe_SetInfiniteINRequests(void)
{
UPCONX |= (1 << INMODE);
}
-
+
/** Configures the currently selected pipe to only allow the specified number of IN requests to be
* accepted by the pipe before it is automatically frozen.
*
@@ -331,7 +331,7 @@
{
return ((UPSTAX & (1 << CFGOK)) ? true : false);
}
-
+
/** Retrieves the endpoint number of the endpoint within the attached device that the currently selected
* pipe is bound to.
*
@@ -352,7 +352,7 @@
{
UPCFG2X = Milliseconds;
}
-
+
/** Returns a mask indicating which pipe's interrupt periods have elapsed, indicating that the pipe should
* be serviced.
*
@@ -363,7 +363,7 @@
{
return UPINT;
}
-
+
/** Determines if the specified pipe number has interrupted (valid only for INTERRUPT type
* pipes).
*
@@ -376,14 +376,14 @@
{
return ((UPINT & (1 << PipeNumber)) ? true : false);
}
-
+
/** Unfreezes the selected pipe, allowing it to communicate with an attached device. */
static inline void Pipe_Unfreeze(void) ATTR_ALWAYS_INLINE;
static inline void Pipe_Unfreeze(void)
{
UPCONX &= ~(1 << PFREEZE);
}
-
+
/** Freezes the selected pipe, preventing it from communicating with an attached device. */
static inline void Pipe_Freeze(void) ATTR_ALWAYS_INLINE;
static inline void Pipe_Freeze(void)
@@ -400,14 +400,14 @@
{
return ((UPCONX & (1 << PFREEZE)) ? true : false);
}
-
+
/** Clears the master pipe error flag. */
static inline void Pipe_ClearError(void) ATTR_ALWAYS_INLINE;
static inline void Pipe_ClearError(void)
{
UPINTX &= ~(1 << PERRI);
}
-
+
/** Determines if the master pipe error flag is set for the currently selected pipe, indicating that
* some sort of hardware error has occurred on the pipe.
*
@@ -420,7 +420,7 @@
{
return ((UPINTX & (1 << PERRI)) ? true : false);
}
-
+
/** Clears all the currently selected pipe's hardware error flags, but does not clear the master error
* flag for the pipe.
*/
@@ -429,7 +429,7 @@
{
UPERRX = 0;
}
-
+
/** Gets a mask of the hardware error flags which have occurred on the currently selected pipe. This
* value can then be masked against the PIPE_ERRORFLAG_* masks to determine what error has occurred.
*
@@ -443,7 +443,7 @@
PIPE_ERRORFLAG_DATATGL)) |
(UPSTAX & (PIPE_ERRORFLAG_OVERFLOW | PIPE_ERRORFLAG_UNDERFLOW)));
}
-
+
/** Determines if the currently selected pipe may be read from (if data is waiting in the pipe
* bank and the pipe is an IN direction, or if the bank is not yet full if the pipe is an OUT
* direction). This function will return false if an error has occurred in the pipe, or if the pipe
@@ -453,7 +453,7 @@
* \note This function is not valid on CONTROL type pipes.
*
* \ingroup Group_PipePacketManagement
- *
+ *
* \return Boolean true if the currently selected pipe may be read from or written to, depending on its direction.
*/
static inline bool Pipe_IsReadWriteAllowed(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
@@ -461,7 +461,7 @@
{
return ((UPINTX & (1 << RWAL)) ? true : false);
}
-
+
/** Determines if a packet has been received on the currently selected IN pipe from the attached device.
*
* \ingroup Group_PipePacketManagement
@@ -473,7 +473,7 @@
{
return ((UPINTX & (1 << RXINI)) ? true : false);
}
-
+
/** Determines if the currently selected OUT pipe is ready to send an OUT packet to the attached device.
*
* \ingroup Group_PipePacketManagement
@@ -498,10 +498,10 @@
{
return ((UPINTX & (1 << TXSTPI)) ? true : false);
}
-
+
/** Sends the currently selected CONTROL type pipe's contents to the device as a SETUP packet.
*
- * \ingroup Group_PipePacketManagement
+ * \ingroup Group_PipePacketManagement
*/
static inline void Pipe_ClearSETUP(void) ATTR_ALWAYS_INLINE;
static inline void Pipe_ClearSETUP(void)
@@ -558,7 +558,7 @@
{
UPINTX &= ~(1 << NAKEDI);
}
-
+
/** Determines if the currently selected pipe has had the STALL condition set by the attached device.
*
* \ingroup Group_PipePacketManagement
@@ -570,7 +570,7 @@
{
return ((UPINTX & (1 << RXSTALLI)) ? true : false);
}
-
+
/** Clears the STALL condition detection flag on the currently selected pipe, but does not clear the
* STALL condition itself (this must be done via a ClearFeature control request to the device).
*
@@ -614,10 +614,10 @@
static inline void Pipe_Discard_Byte(void)
{
uint8_t Dummy;
-
+
Dummy = UPDATX;
}
-
+
/** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT
* direction pipes.
*
@@ -633,10 +633,10 @@
uint16_t Word;
uint8_t Bytes[2];
} Data;
-
+
Data.Bytes[0] = UPDATX;
Data.Bytes[1] = UPDATX;
-
+
return Data.Word;
}
@@ -655,13 +655,13 @@
uint16_t Word;
uint8_t Bytes[2];
} Data;
-
+
Data.Bytes[1] = UPDATX;
Data.Bytes[0] = UPDATX;
-
+
return Data.Word;
}
-
+
/** Writes two bytes to the currently selected pipe's bank in little endian format, for IN
* direction pipes.
*
@@ -675,7 +675,7 @@
UPDATX = (Word & 0xFF);
UPDATX = (Word >> 8);
}
-
+
/** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
* direction pipes.
*
@@ -698,7 +698,7 @@
static inline void Pipe_Discard_Word(void)
{
uint8_t Dummy;
-
+
Dummy = UPDATX;
Dummy = UPDATX;
}
@@ -718,12 +718,12 @@
uint32_t DWord;
uint8_t Bytes[4];
} Data;
-
+
Data.Bytes[0] = UPDATX;
Data.Bytes[1] = UPDATX;
Data.Bytes[2] = UPDATX;
Data.Bytes[3] = UPDATX;
-
+
return Data.DWord;
}
@@ -742,12 +742,12 @@
uint32_t DWord;
uint8_t Bytes[4];
} Data;
-
+
Data.Bytes[3] = UPDATX;
Data.Bytes[2] = UPDATX;
Data.Bytes[1] = UPDATX;
Data.Bytes[0] = UPDATX;
-
+
return Data.DWord;
}
@@ -766,7 +766,7 @@
UPDATX = (DWord >> 16);
UPDATX = (DWord >> 24);
}
-
+
/** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
* direction pipes.
*
@@ -781,9 +781,9 @@
UPDATX = (DWord >> 16);
UPDATX = (DWord >> 8);
UPDATX = (DWord & 0xFF);
- }
-
- /** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.
+ }
+
+ /** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.
*
* \ingroup Group_PipePrimitiveRW
*/
@@ -791,7 +791,7 @@
static inline void Pipe_Discard_DWord(void)
{
uint8_t Dummy;
-
+
Dummy = UPDATX;
Dummy = UPDATX;
Dummy = UPDATX;
@@ -825,14 +825,14 @@
* Speed USB devices - refer to the USB 2.0 specification.
*
* \param[in] Token Pipe data token, either \ref PIPE_TOKEN_SETUP, \ref PIPE_TOKEN_OUT or \ref PIPE_TOKEN_IN.
- * All pipes (except Control type) are unidirectional - data may only be read from or
+ * All pipes (except Control type) are unidirectional - data may only be read from or
* written to the pipe bank based on its direction, not both.
*
* \param[in] EndpointNumber Endpoint index within the attached device that the pipe should interface to.
*
* \param[in] Size Size of the pipe's bank, where packets are stored before they are transmitted to
- * the USB device, or after they have been received from the USB device (depending on
- * the pipe's data direction). The bank size must indicate the maximum packet size that
+ * the USB device, or after they have been received from the USB device (depending on
+ * the pipe's data direction). The bank size must indicate the maximum packet size that
* the pipe can handle.
*
* \param[in] Banks Number of banks to use for the pipe being configured, a PIPE_BANK_* mask. More banks
@@ -862,7 +862,7 @@
const uint16_t Size,
const uint8_t Banks);
- /** Spin-loops until the currently selected non-control pipe is ready for the next packed of data to be read
+ /** Spin-loops until the currently selected non-control pipe is ready for the next packed of data to be read
* or written to it, aborting in the case of an error condition (such as a timeout or device disconnect).
*
* \ingroup Group_PipeRW
@@ -870,7 +870,7 @@
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum.
*/
uint8_t Pipe_WaitUntilReady(void);
-
+
/** Determines if a pipe has been bound to the given device endpoint address. If a pipe which is bound to the given
* endpoint is found, it is automatically selected.
*
@@ -887,20 +887,20 @@
#if !defined(ENDPOINT_CONTROLEP)
#define ENDPOINT_CONTROLEP 0
#endif
-
+
/* Inline Functions: */
static inline uint8_t Pipe_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint8_t Pipe_BytesToEPSizeMask(const uint16_t Bytes)
{
uint8_t MaskVal = 0;
uint16_t CheckBytes = 8;
-
+
while ((CheckBytes < Bytes) && (CheckBytes < PIPE_MAX_SIZE))
{
MaskVal++;
CheckBytes <<= 1;
}
-
+
return (MaskVal << EPSIZE0);
}
@@ -912,7 +912,8 @@
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/LowLevel/USBController.c b/LUFA/Drivers/USB/LowLevel/USBController.c
index 6d4a89dd0..b409582a0 100644
--- a/LUFA/Drivers/USB/LowLevel/USBController.c
+++ b/LUFA/Drivers/USB/LowLevel/USBController.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -50,7 +50,7 @@ void USB_Init(
#elif (!defined(USB_CAN_BE_BOTH) && defined(USE_STATIC_OPTIONS))
void
#endif
-
+
#if !defined(USE_STATIC_OPTIONS)
const uint8_t Options
#endif
@@ -59,7 +59,7 @@ void USB_Init(
#if !defined(USE_STATIC_OPTIONS)
USB_Options = Options;
#endif
-
+
if (!(USB_Options & USB_OPT_REG_DISABLED))
USB_REG_On();
else
@@ -69,7 +69,7 @@ void USB_Init(
if (Mode == USB_MODE_UID)
{
UHWCON |= (1 << UIDE);
- USB_INT_Enable(USB_INT_IDTI);
+ USB_INT_Enable(USB_INT_IDTI);
USB_CurrentMode = USB_GetUSBModeFromUID();
}
else
@@ -90,10 +90,10 @@ void USB_ShutDown(void)
USB_Detach();
USB_Controller_Disable();
-
+
if (!(USB_Options & USB_OPT_MANUAL_PLL))
USB_PLL_Off();
-
+
USB_REG_Off();
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
@@ -115,9 +115,9 @@ void USB_ResetInterface(void)
USB_INT_DisableAllInterrupts();
USB_INT_ClearAllInterrupts();
-
+
USB_Controller_Reset();
-
+
if (!(USB_Options & USB_OPT_MANUAL_PLL))
{
#if defined(USB_SERIES_4_AVR)
@@ -137,14 +137,14 @@ void USB_ResetInterface(void)
#endif
USB_CLK_Unfreeze();
-
+
if (USB_CurrentMode == USB_MODE_Device)
{
#if defined(USB_CAN_BE_DEVICE)
#if (defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))
UHWCON |= (1 << UIMOD);
#endif
-
+
USB_Init_Device();
#endif
}
@@ -155,7 +155,7 @@ void USB_ResetInterface(void)
USB_Init_Host();
#endif
}
-
+
#if (defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))
USB_OTGPAD_On();
#endif
@@ -170,7 +170,7 @@ static void USB_Init_Device(void)
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
USB_RemoteWakeupEnabled = false;
#endif
-
+
#if !defined(NO_DEVICE_SELF_POWER)
USB_CurrentlySelfPowered = false;
#endif
@@ -179,7 +179,7 @@ static void USB_Init_Device(void)
USB_Descriptor_Device_t* DeviceDescriptorPtr;
if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr) != NO_DESCRIPTOR)
- {
+ {
#if defined(USE_RAM_DESCRIPTORS)
USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;
#elif defined(USE_EEPROM_DESCRIPTORS)
@@ -201,7 +201,7 @@ static void USB_Init_Device(void)
Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
ENDPOINT_DIR_OUT, USB_ControlEndpointSize,
- ENDPOINT_BANK_SINGLE);
+ ENDPOINT_BANK_SINGLE);
USB_INT_Clear(USB_INT_SUSPI);
USB_INT_Enable(USB_INT_SUSPI);
@@ -218,7 +218,7 @@ static void USB_Init_Host(void)
USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
USB_Host_HostMode_On();
-
+
USB_Host_VBUS_Auto_Off();
USB_Host_VBUS_Manual_Enable();
USB_Host_VBUS_Manual_On();
@@ -229,3 +229,4 @@ static void USB_Init_Host(void)
USB_Attach();
}
#endif
+
diff --git a/LUFA/Drivers/USB/LowLevel/USBController.h b/LUFA/Drivers/USB/LowLevel/USBController.h
index 8a2fec788..fb71eb504 100644
--- a/LUFA/Drivers/USB/LowLevel/USBController.h
+++ b/LUFA/Drivers/USB/LowLevel/USBController.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -37,7 +37,7 @@
* \note This file should not be included directly. It is automatically included as needed by the USB driver
* dispatch header located in LUFA/Drivers/USB/USB.h.
*/
-
+
/** \ingroup Group_USB
* @defgroup Group_USBManagement USB Interface Management
*
@@ -53,7 +53,7 @@
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdbool.h>
-
+
#include "../HighLevel/USBMode.h"
#include "../../../Common/Common.h"
@@ -61,7 +61,7 @@
#include "../HighLevel/Events.h"
#include "../HighLevel/USBTask.h"
#include "USBInterrupt.h"
-
+
#if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
#include "Host.h"
#include "OTG.h"
@@ -69,7 +69,7 @@
#include "../HighLevel/HostStandardReq.h"
#include "../HighLevel/PipeStream.h"
#endif
-
+
#if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
#include "Device.h"
#include "Endpoint.h"
@@ -90,7 +90,7 @@
#if !defined(F_CLOCK)
#error F_CLOCK is not defined. You must define F_CLOCK to the frequency of the unprescaled input clock in your project makefile.
#endif
-
+
#if (F_CLOCK == 8000000)
#if (defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__) || \
defined(__AVR_ATmega8U2__) || defined(__AVR_ATmega16U2__) || \
@@ -116,13 +116,13 @@
#define USB_PLL_PSC ((1 << PLLP2) | (1 << PLLP0))
#endif
#endif
-
+
#if !defined(USB_PLL_PSC)
#error No PLL prescale value available for chosen F_CPU value and AVR model.
#endif
-
+
/* Public Interface - May be used in end-application: */
- /* Macros: */
+ /* Macros: */
/** Regulator disable option mask for \ref USB_Init(). This indicates that the internal 3.3V USB data pad
* regulator should be enabled to regulate the data pin voltages to within the USB standard.
*
@@ -136,7 +136,7 @@
* \note See USB AVR data sheet for more information on the internal pad regulator.
*/
#define USB_OPT_REG_ENABLED (0 << 1)
-
+
/** Manual PLL control option mask for \ref USB_Init(). This indicates to the library that the user application
* will take full responsibility for controlling the AVR's PLL (used to generate the high frequency clock
* that the USB controller requires) and ensuring that it is locked at the correct frequency for USB operations.
@@ -178,12 +178,12 @@
* (both control and standard) when in either device or host mode. If the next packet of a stream
* is not received or acknowledged within this time period, the stream function will fail.
*
- * This value may be overridden in the user project makefile as the value of the
+ * This value may be overridden in the user project makefile as the value of the
* \ref USB_STREAM_TIMEOUT_MS token, and passed to the compiler using the -D switch.
*/
#define USB_STREAM_TIMEOUT_MS 100
#endif
-
+
/* Inline Functions: */
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || defined(__DOXYGEN__)
/** Returns boolean true if the VBUS line is currently high (i.e. the USB host is supplying power),
@@ -246,21 +246,21 @@
* PLL, and a USB_DEVICE_OPT_* mask (when the device mode is enabled) to set the device
* mode speed.
*
- * \note To reduce the FLASH requirements of the library if only device or host mode is required,
+ * \note To reduce the FLASH requirements of the library if only device or host mode is required,
* the mode can be statically set in the project makefile by defining the token USB_DEVICE_ONLY
- * (for device mode) or USB_HOST_ONLY (for host mode), passing the token to the compiler
+ * (for device mode) or USB_HOST_ONLY (for host mode), passing the token to the compiler
* via the -D switch. If the mode is statically set, this parameter does not exist in the
* function prototype.
* \n\n
*
* \note To reduce the FLASH requirements of the library if only fixed settings are are required,
- * the options may be set statically in the same manner as the mode (see the Mode parameter of
+ * the options may be set statically in the same manner as the mode (see the Mode parameter of
* this function). To statically set the USB options, pass in the USE_STATIC_OPTIONS token,
* defined to the appropriate options masks. When the options are statically set, this
* parameter does not exist in the function prototype.
* \n\n
- *
- * \note The mode parameter does not exist on devices where only one mode is possible, such as USB
+ *
+ * \note The mode parameter does not exist on devices where only one mode is possible, such as USB
* AVR models which only implement the USB device mode in hardware.
*
* \see Device.h for the USB_DEVICE_OPT_* masks.
@@ -280,7 +280,7 @@
const uint8_t Options
#endif
);
-
+
/** Shuts down the USB interface. This turns off the USB interface after deallocating all USB FIFO
* memory, endpoints and pipes. When turned off, no USB functionality can be used until the interface
* is restarted with the \ref USB_Init() function.
@@ -314,7 +314,7 @@
#elif defined(USB_DEVICE_ONLY)
#define USB_CurrentMode USB_MODE_Device
#endif
-
+
#if !defined(USE_STATIC_OPTIONS) || defined(__DOXYGEN__)
/** Indicates the current USB options that the USB interface was initialized with when \ref USB_Init()
* was called. This value will be one of the USB_MODE_* masks defined elsewhere in this module.
@@ -348,12 +348,12 @@
#if defined(USB_CAN_BE_DEVICE)
static void USB_Init_Device(void);
#endif
-
+
#if defined(USB_CAN_BE_HOST)
static void USB_Init_Host(void);
#endif
#endif
-
+
/* Inline Functions: */
static inline void USB_PLL_On(void) ATTR_ALWAYS_INLINE;
static inline void USB_PLL_On(void)
@@ -361,13 +361,13 @@
PLLCSR = USB_PLL_PSC;
PLLCSR |= (1 << PLLE);
}
-
+
static inline void USB_PLL_Off(void) ATTR_ALWAYS_INLINE;
static inline void USB_PLL_Off(void)
{
PLLCSR = 0;
}
-
+
static inline bool USB_PLL_IsReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool USB_PLL_IsReady(void)
{
@@ -381,7 +381,7 @@
UHWCON |= (1 << UVREGE);
#else
REGCR &= ~(1 << REGDIS);
- #endif
+ #endif
}
static inline void USB_REG_Off(void) ATTR_ALWAYS_INLINE;
@@ -391,9 +391,9 @@
UHWCON &= ~(1 << UVREGE);
#else
REGCR |= (1 << REGDIS);
- #endif
+ #endif
}
-
+
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
static inline void USB_OTGPAD_On(void) ATTR_ALWAYS_INLINE;
static inline void USB_OTGPAD_On(void)
@@ -413,13 +413,13 @@
{
USBCON |= (1 << FRZCLK);
}
-
+
static inline void USB_CLK_Unfreeze(void) ATTR_ALWAYS_INLINE;
static inline void USB_CLK_Unfreeze(void)
{
USBCON &= ~(1 << FRZCLK);
}
-
+
static inline void USB_Controller_Enable(void) ATTR_ALWAYS_INLINE;
static inline void USB_Controller_Enable(void)
{
@@ -436,11 +436,11 @@
static inline void USB_Controller_Reset(void)
{
const uint8_t Temp = USBCON;
-
+
USBCON = (Temp & ~(1 << USBE));
USBCON = (Temp | (1 << USBE));
}
-
+
#if defined(USB_CAN_BE_BOTH)
static inline uint8_t USB_GetUSBModeFromUID(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t USB_GetUSBModeFromUID(void)
@@ -453,12 +453,13 @@
#endif
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Drivers/USB/LowLevel/USBInterrupt.c b/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
index 54983c09e..92723ef0e 100644
--- a/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
+++ b/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -34,19 +34,19 @@
void USB_INT_DisableAllInterrupts(void)
{
#if defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
- USBCON &= ~((1 << VBUSTE) | (1 << IDTE));
+ USBCON &= ~((1 << VBUSTE) | (1 << IDTE));
#elif defined(USB_SERIES_4_AVR)
USBCON &= ~(1 << VBUSTE);
#endif
-
+
#if defined(USB_CAN_BE_BOTH)
OTGIEN = 0;
#endif
-
+
#if defined(USB_CAN_BE_HOST)
UHIEN = 0;
#endif
-
+
#if defined(USB_CAN_BE_DEVICE)
UDIEN = 0;
#endif
@@ -57,15 +57,15 @@ void USB_INT_ClearAllInterrupts(void)
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
USBINT = 0;
#endif
-
+
#if defined(USB_CAN_BE_BOTH)
OTGINT = 0;
#endif
-
+
#if defined(USB_CAN_BE_HOST)
UHINT = 0;
#endif
-
+
#if defined(USB_CAN_BE_DEVICE)
UDINT = 0;
#endif
@@ -86,7 +86,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
}
else
{
- USB_DeviceState = DEVICE_STATE_Unattached;
+ USB_DeviceState = DEVICE_STATE_Unattached;
EVENT_USB_Device_Disconnect();
}
}
@@ -98,9 +98,9 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_INT_Disable(USB_INT_SUSPI);
USB_INT_Enable(USB_INT_WAKEUPI);
-
+
USB_CLK_Freeze();
-
+
if (!(USB_Options & USB_OPT_MANUAL_PLL))
USB_PLL_Off();
@@ -127,19 +127,19 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_INT_Disable(USB_INT_WAKEUPI);
USB_INT_Enable(USB_INT_SUSPI);
-
+
if (USB_ConfigurationNumber)
USB_DeviceState = DEVICE_STATE_Configured;
else
USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered;
-
+
#if defined(USB_SERIES_2_AVR) && !defined(NO_LIMITED_CONTROLLER_CONNECT)
EVENT_USB_Device_Connect();
#else
- EVENT_USB_Device_WakeUp();
+ EVENT_USB_Device_WakeUp();
#endif
}
-
+
if (USB_INT_HasOccurred(USB_INT_EORSTI) && USB_INT_IsEnabled(USB_INT_EORSTI))
{
USB_INT_Clear(USB_INT_EORSTI);
@@ -161,29 +161,29 @@ ISR(USB_GEN_vect, ISR_BLOCK)
EVENT_USB_Device_Reset();
}
-
+
#if !defined(NO_SOF_EVENTS)
if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI))
{
USB_INT_Clear(USB_INT_SOFI);
-
+
EVENT_USB_Device_StartOfFrame();
}
- #endif
#endif
-
+ #endif
+
#if defined(USB_CAN_BE_HOST)
if (USB_INT_HasOccurred(USB_INT_DDISCI) && USB_INT_IsEnabled(USB_INT_DDISCI))
{
USB_INT_Clear(USB_INT_DDISCI);
USB_INT_Clear(USB_INT_DCONNI);
USB_INT_Disable(USB_INT_DDISCI);
-
+
EVENT_USB_Host_DeviceUnattached();
USB_ResetInterface();
}
-
+
if (USB_INT_HasOccurred(USB_INT_VBERRI) && USB_INT_IsEnabled(USB_INT_VBERRI))
{
USB_INT_Clear(USB_INT_VBERRI);
@@ -201,18 +201,18 @@ ISR(USB_GEN_vect, ISR_BLOCK)
{
USB_INT_Clear(USB_INT_SRPI);
USB_INT_Disable(USB_INT_SRPI);
-
+
EVENT_USB_Host_DeviceAttached();
USB_INT_Enable(USB_INT_DDISCI);
-
+
USB_HostState = HOST_STATE_Powered;
}
if (USB_INT_HasOccurred(USB_INT_BCERRI) && USB_INT_IsEnabled(USB_INT_BCERRI))
{
USB_INT_Clear(USB_INT_BCERRI);
-
+
EVENT_USB_Host_DeviceEnumerationFailed(HOST_ENUMERROR_NoDeviceDetected, 0);
EVENT_USB_Host_DeviceUnattached();
@@ -223,7 +223,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
if (USB_INT_HasOccurred(USB_INT_HSOFI) && USB_INT_IsEnabled(USB_INT_HSOFI))
{
USB_INT_Clear(USB_INT_HSOFI);
-
+
EVENT_USB_Host_StartOfFrame();
}
#endif
@@ -231,7 +231,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
#if defined(USB_CAN_BE_BOTH)
if (USB_INT_HasOccurred(USB_INT_IDTI) && USB_INT_IsEnabled(USB_INT_IDTI))
- {
+ {
USB_INT_Clear(USB_INT_IDTI);
if (USB_DeviceState != DEVICE_STATE_Unattached)
@@ -239,7 +239,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
if (USB_HostState != HOST_STATE_Unattached)
EVENT_USB_Host_DeviceUnattached();
-
+
USB_CurrentMode = USB_GetUSBModeFromUID();
USB_ResetInterface();
@@ -251,7 +251,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
#if defined(INTERRUPT_CONTROL_ENDPOINT) && defined(USB_CAN_BE_DEVICE)
ISR(USB_COM_vect, ISR_BLOCK)
{
- uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint();
+ uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint();
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
USB_INT_Disable(USB_INT_RXSTPI);
@@ -266,3 +266,4 @@ ISR(USB_COM_vect, ISR_BLOCK)
Endpoint_SelectEndpoint(PrevSelectedEndpoint);
}
#endif
+
diff --git a/LUFA/Drivers/USB/LowLevel/USBInterrupt.h b/LUFA/Drivers/USB/LowLevel/USBInterrupt.h
index 8c9b2db1d..51e7a803e 100644
--- a/LUFA/Drivers/USB/LowLevel/USBInterrupt.h
+++ b/LUFA/Drivers/USB/LowLevel/USBInterrupt.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -37,7 +37,7 @@
* \note This file should not be included directly. It is automatically included as needed by the USB driver
* dispatch header located in LUFA/Drivers/USB/USB.h.
*/
-
+
#ifndef __USBINTERRUPT_H__
#define __USBINTERRUPT_H__
@@ -46,7 +46,7 @@
#include <avr/interrupt.h>
#include <util/atomic.h>
#include <stdbool.h>
-
+
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
@@ -56,7 +56,7 @@
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
-
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
@@ -91,15 +91,16 @@
#include "../HighLevel/USBMode.h"
#include "../HighLevel/Events.h"
#include "USBController.h"
-
+
/* Function Prototypes: */
void USB_INT_ClearAllInterrupts(void);
void USB_INT_DisableAllInterrupts(void);
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
+
diff --git a/LUFA/Drivers/USB/USB.h b/LUFA/Drivers/USB/USB.h
index 552af0f2e..b8dce821e 100644
--- a/LUFA/Drivers/USB/USB.h
+++ b/LUFA/Drivers/USB/USB.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -86,9 +86,9 @@
*
* <table>
* <tr>
- * <th width="100px">USB Class</th>
- * <th width="90px">Device Mode</th>
- * <th width="90px">Host Mode</th>
+ * <th width="100px">USB Class</th>
+ * <th width="90px">Device Mode</th>
+ * <th width="90px">Host Mode</th>
* </tr>
* <tr>
* <td>Audio</td>
@@ -141,10 +141,10 @@
*
* \subsection SSec_ClassDriverDevice Device Mode Class Drivers
* Implementing a Device Mode Class Driver in a user application requires a number of steps to be followed. Firstly,
- * the module configuration and state structure must be added to the project source. These structures are named in a
+ * the module configuration and state structure must be added to the project source. These structures are named in a
* similar manner between classes, that of <i>USB_ClassInfo_<b>{Class Name}</b>_Device_t</i>, and are used to hold the
- * complete state and configuration for each class instance. Multiple class instances is where the power of the class
- * drivers lie; multiple interfaces of the same class simply require more instances of the Class Driver's ClassInfo
+ * complete state and configuration for each class instance. Multiple class instances is where the power of the class
+ * drivers lie; multiple interfaces of the same class simply require more instances of the Class Driver's ClassInfo
* structure.
*
* Inside the ClassInfo structure lies two sections, a <i>Config</i> section, and a <i>State</i> section. The Config
@@ -163,7 +163,7 @@
* .Config =
* {
* .StreamingInterfaceNumber = 1,
- *
+ *
* .DataINEndpointNumber = 1,
* .DataINEndpointSize = 256,
* },
@@ -183,12 +183,12 @@
* void EVENT_USB_Device_ConfigurationChanged(void)
* {
* LEDs_SetAllLEDs(LEDMASK_USB_READY);
- *
+ *
* if (!(Audio_Device_ConfigureEndpoints(&My_Audio_Interface)))
* LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
* }
* \endcode
- *
+ *
* Once initialized, it is important to maintain the class driver's state by repeatedly calling the Class Driver's
* <i><b>{Class Name}</b>_Device_USBTask()</i> function in the main program loop. The exact implementation of this
* function varies between class drivers, and can be used for any internal class driver purpose to maintain each
@@ -199,13 +199,13 @@
* int main(void)
* {
* SetupHardware();
- *
+ *
* LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
- *
+ *
* for (;;)
* {
* Create_And_Process_Samples();
- *
+ *
* Audio_Device_USBTask(&My_Audio_Interface);
* USB_USBTask();
* }
@@ -240,10 +240,10 @@
*
* \subsection SSec_ClassDriverHost Host Mode Class Drivers
* Implementing a Host Mode Class Driver in a user application requires a number of steps to be followed. Firstly,
- * the module configuration and state structure must be added to the project source. These structures are named in a
+ * the module configuration and state structure must be added to the project source. These structures are named in a
* similar manner between classes, that of <i>USB_ClassInfo_<b>{Class Name}</b>_Host_t</i>, and are used to hold the
- * complete state and configuration for each class instance. Multiple class instances is where the power of the class
- * drivers lie; multiple interfaces of the same class simply require more instances of the Class Driver's ClassInfo
+ * complete state and configuration for each class instance. Multiple class instances is where the power of the class
+ * drivers lie; multiple interfaces of the same class simply require more instances of the Class Driver's ClassInfo
* structure.
*
* Inside the ClassInfo structure lies two sections, a <i>Config</i> section, and a <i>State</i> section. The Config
@@ -263,7 +263,7 @@
* {
* .DataINPipeNumber = 1,
* .DataINPipeDoubleBank = false,
- *
+ *
* .DataOUTPipeNumber = 2,
* .DataOUTPipeDoubleBank = false,
* },
@@ -274,7 +274,7 @@
* should be called in response to the host state machine entering the \ref HOST_STATE_Addressed state. This function
* will return an error code from the class driver's <i><b>{Class Name}</b>_EnumerationFailure_ErrorCodes_t</i> enum
* to indicate if the driver successfully initialized the instance and bound it to an interface in the attached device.
- * Like all the class driver functions, this function takes in the address of the specific instance you wish to initialize -
+ * Like all the class driver functions, this function takes in the address of the specific instance you wish to initialize -
* in this manner, multiple separate instances of the same class type can be initialized. A fragment of a Class Driver
* based Host mode application may look like the following:
*
@@ -283,7 +283,7 @@
* {
* case HOST_STATE_Addressed:
* LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
- *
+ *
* uint16_t ConfigDescriptorSize;
* uint8_t ConfigDescriptorData[512];
*
@@ -323,16 +323,16 @@
* int main(void)
* {
* SetupHardware();
- *
+ *
* LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
- *
+ *
* for (;;)
* {
* switch (USB_HostState)
* {
* // Host state machine handling here
- * }
- *
+ * }
+ *
* MIDI_Host_USBTask(&My_Audio_Interface);
* USB_USBTask();
* }
@@ -350,7 +350,7 @@
* read and write routines. See each driver's individual documentation for more information on the
* class-specific functions.
*/
-
+
#ifndef __USB_H__
#define __USB_H__
@@ -362,12 +362,12 @@
/* Includes: */
#include "HighLevel/USBMode.h"
- /* Preprocessor Checks: */
+ /* Preprocessor Checks: */
#if (!defined(USB_SERIES_2_AVR) && !defined(USB_SERIES_4_AVR) && \
!defined(USB_SERIES_6_AVR) && !defined(USB_SERIES_7_AVR))
#error The currently selected AVR model is not supported under the USB component of the LUFA library.
#endif
-
+
/* Includes: */
#include "HighLevel/USBTask.h"
#include "HighLevel/Events.h"
@@ -376,24 +376,24 @@
#include "LowLevel/USBController.h"
#include "LowLevel/USBInterrupt.h"
-
+
#if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
#include "LowLevel/Host.h"
#include "LowLevel/Pipe.h"
#include "HighLevel/HostStandardReq.h"
#include "HighLevel/PipeStream.h"
#endif
-
+
#if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
#include "LowLevel/Device.h"
#include "LowLevel/Endpoint.h"
#include "HighLevel/DeviceStandardReq.h"
#include "HighLevel/EndpointStream.h"
#endif
-
+
#if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__)
#include "LowLevel/OTG.h"
#endif
-
+
#endif
diff --git a/LUFA/License.txt b/LUFA/License.txt
index 82e3f74ec..a2228be8e 100644
--- a/LUFA/License.txt
+++ b/LUFA/License.txt
@@ -15,3 +15,4 @@ whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
+
diff --git a/LUFA/ManPages/AboutLUFA.txt b/LUFA/ManPages/AboutLUFA.txt
index 7728347c6..c7374bce6 100644
--- a/LUFA/ManPages/AboutLUFA.txt
+++ b/LUFA/ManPages/AboutLUFA.txt
@@ -17,4 +17,4 @@
* \li \subpage Page_FutureChanges - Planned Changes to the Library
* \li \subpage Page_LUFAPoweredProjects - Other Projects Using LUFA
*/
- \ No newline at end of file
+
diff --git a/LUFA/ManPages/AlternativeStacks.txt b/LUFA/ManPages/AlternativeStacks.txt
index a1ba858da..f9d6cbbcd 100644
--- a/LUFA/ManPages/AlternativeStacks.txt
+++ b/LUFA/ManPages/AlternativeStacks.txt
@@ -42,8 +42,8 @@
* <b>Website:</b> http://www.pjrc.com/teensy/usb_debug_only.html \n
* <b>Description:</b> Not so much a complete stack as a collection of USB enabled demos, this library is specifically
* designed for the PJRC Teensy line of USB AVRs, and thus may need to be modified for other USB AVR
- * chips. These minimal code samples shows the inner workings of the USB controller, without all the
- * abstraction present in most other USB AVR stacks.
+ * chips. These minimal code samples shows the inner workings of the USB controller, without all the
+ * abstraction present in most other USB AVR stacks.
*
* \section Sec_SoftwareStacks Software AVR Stacks
* These are the known alternative USB stacks which can run on regular AVR models, lacking dedicated hardware USB controllers
@@ -66,4 +66,4 @@
* Used in many commercial and non-commercial designs, with user-submitted projects available for viewing
* on the company's website. Uses C language code mixed with assembly for time-critical sections.
*/
-
+
diff --git a/LUFA/ManPages/BuildingLinkableLibraries.txt b/LUFA/ManPages/BuildingLinkableLibraries.txt
index 70919c0a2..e5782df9f 100644
--- a/LUFA/ManPages/BuildingLinkableLibraries.txt
+++ b/LUFA/ManPages/BuildingLinkableLibraries.txt
@@ -20,3 +20,4 @@
* demonstrated in the library demos and applications. This is the preferred method, as the library is recompiled
* each time to ensure that all static options for a particular application are applied.
*/
+
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index a15fe828a..68e3826f3 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -208,7 +208,7 @@
* read (thanks to Andrei Krainev)
* - Fixed device state not being reset back to the default state if the host sets the address to 0
* - Fixed Set Configuration requests not being stalled until the host has set the device's address
- * - Fixed Host mode HID class driver not sending the correct report type when HID_Host_SendReportByID() was called and the
+ * - Fixed Host mode HID class driver not sending the correct report type when HID_Host_SendReportByID() was called and the
* HID_HOST_BOOT_PROTOCOL_ONLY compile time option is set
* - Fixed INTERRUPT_CONTROL_ENDPOINT compile time option preventing other interrupts from occurring while the control endpoint
* request is being processed, causing possible lockups if a USB interrupt occurs during a transfer
@@ -323,7 +323,7 @@
* - Fixed Mass Storage Host Class driver and Low Level demo not clearing the error condition if an attached device returns a
* STALL to a GET MAX LUN request (thanks to Martin Luxen)
* - Fixed TeensyHID bootloader not properly shutting down the USB interface to trigger a disconnection on the host before resetting
- * - Fixed MassStorageHost Class driver demo not having USB_STREAM_TIMEOUT_MS compile time option set properly to prevent slow
+ * - Fixed MassStorageHost Class driver demo not having USB_STREAM_TIMEOUT_MS compile time option set properly to prevent slow
* devices from timing out the data pipes
* - Fixed the definition of the Endpoint_BytesInEndpoint() macro for the U4 series AVR parts
* - Fixed MIDI host Class driver MIDI_Host_SendEventPacket() routine not properly checking for Pipe ready before writing
@@ -400,7 +400,7 @@
* - Added new Pipe_IsFrozen() macro to determine if the currently selected pipe is frozen
* - Added new USB_GetHIDReportSize() function to the HID report parser to retrieve the size of a given report by its ID
* - Added new combined Mass Storage and Keyboard demo (thanks to Matthias Hullin)
- *
+ *
* <b>Changed:</b>
* - SetIdle requests to the HID device driver with a 0 idle period (send changes only) now only affect the requested
* HID interface within the device, not all HID interfaces
@@ -479,7 +479,7 @@
* - Added new Pipe_BoundEndpointNumber() and Pipe_IsEndpointBound() functions
* - Added new DEVICE_STATE_AS_GPIOR and HOST_STATE_AS_GPIOR compile time options
* - Added 404 Not Found errors to the webserver in the RNDIS demos to indicate invalid URLs
- *
+ *
* <b>Changed:</b>
* - Deprecated pseudo-scheduler and removed dynamic memory allocator from the library (first no longer needed and second unused)
* - The device-mode CALLBACK_USB_GetDescriptor() function now has an extra parameter so that the memory space in which the requested
@@ -635,7 +635,7 @@
* - Changed HWB board driver to Buttons driver, to allow for the support of future boards with more than one mounted GPIO button
* - Serial driver now correctly calculates the baud register value when in double speed mode
* - Init function of the Serial driver is now static inline to product smaller code for the common-case of static init values
- *
+ *
*
* \section Sec_ChangeLog090401 Version 090401
*
@@ -757,9 +757,9 @@
* - Doxygen documentation now contains documentation on all the projects, bootloaders and most demos included with the library
* - CDC bootloader now runs user application when USB disconnected rather than waiting for a hard reset
* - MouseHostWithParser and KeyboardHostWithParser now support multiple-report devices
- * - RNDIS demo can now close connections correctly using the new TCP_APP_CLOSECONNECTION() macro - used in Webserver
+ * - RNDIS demo can now close connections correctly using the new TCP_APP_CLOSECONNECTION() macro - used in Webserver
* - Fixed the DFU bootloader, no longer freezes up when certain files are programmed into an AVR, made reading/writing faster
- * - Fixed mouse/joystick up/down movements reversed - HID mouse X/Y coordinates use a left-handed coordinate system, not a normal
+ * - Fixed mouse/joystick up/down movements reversed - HID mouse X/Y coordinates use a left-handed coordinate system, not a normal
* right-handed system
* - Added stub code to the CDC and USBtoSerial demos showing how to read and set the RS-232 handshake lines - not currently used in
* the demos, but the example code and supporting defines are now in place
@@ -814,7 +814,7 @@
* - All HID demos now pass the USB.org automated HID compliance tests
* - Polling interval of the interrupt endpoint in the CDC based demos changed to 0xFF to fix problems on Linux systems
* - Changed stream functions to accept a new callback function, with NO_STREAM_CALLBACKS used to disable all callbacks
- * - Mass Storage demo dataflash management routines changed to use the endpoint stream functions
+ * - Mass Storage demo dataflash management routines changed to use the endpoint stream functions
* - Added AVRStudio project files for each demo in addition to the existing Programmer's Notepad master project file
* - Re-added call to ReconfigureUSART() in USBtoSerial SetLineCoding request, so that baud rate changes
* are reflected in the hardware (change was previously lost)
@@ -950,7 +950,7 @@
*
* - Added call to ReconfigureUSART() in USBtoSerial SetLineCoding request, so that baud rate changes
* are reflected in the hardware
- * - Fixed CDC and USBtoSerial demos - Stream commands do not work for control endpoints, and the
+ * - Fixed CDC and USBtoSerial demos - Stream commands do not work for control endpoints, and the
* GetLineCoding request had an incorrect RequestType mask preventing it from being processed
* - Improved reliability of the USBtoSerial demo, adding a busy wait while the buffer is full
* - Device control endpoint size is now determined from the device's descriptors rather than being fixed
@@ -1057,6 +1057,7 @@
* - ID transition interrupt now raises the appropriate device/host disconnect event if device attached
* - Fixed double VBUS change (and VBUS -) event when detaching in device mode
* - Added ability to disable ANSI terminal codes by the defining of DISABLE_TERMINAL_CODES in makefile
- * - Removed return from ConfigurePipe and ConfigureEndpoint functions - use Pipe_IsConfigured() and
+ * - Removed return from ConfigurePipe and ConfigureEndpoint functions - use Pipe_IsConfigured() and
* Endpoint_IsConfigured() after calling the config functions to determine success
*/
+
diff --git a/LUFA/ManPages/CompileTimeTokens.txt b/LUFA/ManPages/CompileTimeTokens.txt
index d74cb4314..f74898452 100644
--- a/LUFA/ManPages/CompileTimeTokens.txt
+++ b/LUFA/ManPages/CompileTimeTokens.txt
@@ -30,7 +30,7 @@
* Mouse or Keyboard operation is desired, using boot compatible devices), the code responsible for the Report protocol
* mode can be removed to save space in the compiled application by defining this token. When defined, it is still necessary
* to explicitly put the attached device into Boot protocol mode via a call to \ref HID_Host_SetBootProtocol().
- *
+ *
* <b>HID_STATETABLE_STACK_DEPTH</b>=<i>x</i> - ( \ref Group_HIDParser ) \n
* HID reports may contain PUSH and POP elements, to store and retrieve the current HID state table onto a stack. This
* allows for reports to save the state table before modifying it slightly for a data item, and then restore the previous
@@ -203,3 +203,4 @@
* back to a known idle state before communications occur with the device. This token may be defined to a 16-bit value to set the device
* settle period, specified in milliseconds. If not defined, the default value specified in Host.h is used instead.
*/
+
diff --git a/LUFA/ManPages/CompilingApps.txt b/LUFA/ManPages/CompilingApps.txt
index 60c5a8ae2..45cbdd678 100644
--- a/LUFA/ManPages/CompilingApps.txt
+++ b/LUFA/ManPages/CompilingApps.txt
@@ -3,7 +3,7 @@
* This file contains special DoxyGen information for the generation of the main page and other special
* documentation pages. It is not a project source file.
*/
-
+
/** \page Page_CompilingApps Compiling the Demos, Bootloaders and Projects
*
* The following details how to compile the included LUFA demos, applications and bootloaders using AVR-GCC.
@@ -27,4 +27,4 @@
* files), execute <b>"make clean"</b>. Once a "make all" has been run and no errors were encountered, the resulting binary will
* be located in the generated ".HEX" file. If your project makes use of pre-initialized EEPROM variables, the generated ".EEP"
* file will contain the project's EEPROM data.
- */ \ No newline at end of file
+ */
diff --git a/LUFA/ManPages/ConfiguringApps.txt b/LUFA/ManPages/ConfiguringApps.txt
index f601efacf..e5ce9fd51 100644
--- a/LUFA/ManPages/ConfiguringApps.txt
+++ b/LUFA/ManPages/ConfiguringApps.txt
@@ -3,7 +3,7 @@
* This file contains special DoxyGen information for the generation of the main page and other special
* documentation pages. It is not a project source file.
*/
-
+
/** \page Page_ConfiguringApps Configuring the Demos, Bootloaders and Projects
*
* If the target AVR model, clock speed, board or other settings are different from the current settings, they must be changed
@@ -86,4 +86,4 @@
* model and cannot be made to function through the altering of the makefile settings alone (or at all). Settings such as the USB mode (device, host or both),
* the USB interface speed (Low or Full speed) and other LUFA configuration options can be set here - see \ref Page_TokenSummary documentation for details
* on the available LUFA compile time configuration options.
- */ \ No newline at end of file
+ */
diff --git a/LUFA/ManPages/DevelopingWithLUFA.txt b/LUFA/ManPages/DevelopingWithLUFA.txt
index 695d36c51..4ea379938 100644
--- a/LUFA/ManPages/DevelopingWithLUFA.txt
+++ b/LUFA/ManPages/DevelopingWithLUFA.txt
@@ -18,4 +18,4 @@
* \li \subpage Page_WritingBoardDrivers - How to Write Custom Board Drivers
* \li \subpage Page_SoftwareBootloaderStart - How to jump to the bootloader in software
*/
- \ No newline at end of file
+
diff --git a/LUFA/ManPages/DeviceSupport.txt b/LUFA/ManPages/DeviceSupport.txt
index 76d32d4fa..b9a0e5170 100644
--- a/LUFA/ManPages/DeviceSupport.txt
+++ b/LUFA/ManPages/DeviceSupport.txt
@@ -44,4 +44,4 @@
* - Arduino Uno
* - Any Other Custom User Boards (with Board Drivers if desired, see \ref Page_WritingBoardDrivers)
*/
- \ No newline at end of file
+
diff --git a/LUFA/ManPages/DirectorySummaries.txt b/LUFA/ManPages/DirectorySummaries.txt
index bb7460321..36ba26d65 100644
--- a/LUFA/ManPages/DirectorySummaries.txt
+++ b/LUFA/ManPages/DirectorySummaries.txt
@@ -6,30 +6,30 @@
/** \dir LUFA/Common
* \brief Common library header files.
- *
+ *
* This folder contains header files which are common to all parts of the LUFA library. They may be used freely in
* user applications.
*
* \dir LUFA/Drivers
* \brief Library hardware and software drivers.
- *
+ *
* This folder contains all the library hardware and software drivers for each supported board and USB AVR
* microcontroller model.
- *
+ *
* \dir LUFA/Drivers/Misc
* \brief Miscellaneous driver files.
- *
+ *
* This folder contains drivers for aspects other than the USB interface, board hardware or AVR peripherals.
- *
+ *
* \dir LUFA/Drivers/Peripheral
* \brief USB AVR peripheral driver files.
- *
+ *
* This folder contains drivers for several of the AVR internal peripherals such as the USART, compatible with
* all USB AVR models.
*
* \dir LUFA/Drivers/Peripheral/AVRU4U6U7
* \brief AT90USBXXX6, AT90USBXXX7 and ATMEGAXXU4 AVR model peripheral driver files.
- *
+ *
* This folder contains drivers for several of the AVR internal peripherals such as the USART, compatible only with
* the AT90USBXXX6, AT90USBXXX7 and ATMEGAXXU4 USB AVR models, such as the AT90USB1287. Its contents should <b>not</b> be
* included by the user application - the dispatch header file located in the parent directory should be used
@@ -37,7 +37,7 @@
*
* \dir LUFA/Drivers/USB
* \brief USB controller peripheral driver files.
- *
+ *
* This folder contains the main header files required to implement the USB interface in the USB supporting AVR models.
* The header files contained directly in this folder should be included in the user application in order to gain USB
* functionality, and the appropriate C source files in the LowLevel and HighLevel driver folders added to the compile
@@ -45,147 +45,148 @@
*
* \dir LUFA/Drivers/USB/LowLevel
* \brief Low level USB driver files.
- *
+ *
* This folder contains low level USB driver source files required to implement USB functionality on the USB AVR microcontrollers.
*
* \dir LUFA/Drivers/USB/HighLevel
* \brief High level USB driver files.
- *
+ *
* This folder contains high level USB driver source files required to implement USB functionality on the USB AVR microcontrollers.
*
* \dir LUFA/Drivers/USB/Class
* \brief USB Class helper driver files.
- *
+ *
* This folder contains drivers for implementing functionality of standardized USB classes. These are not used directly by the library,
* but provide a standard and library-maintained way of implementing functionality from some of the defined USB classes without extensive
* development effort. Is is recommended that these drivers be used where possible to reduce maintenance of user applications.
*
* \dir LUFA/Drivers/USB/Class/Device
* \brief USB Device Class helper driver files.
- *
+ *
* Device mode drivers for the standard USB classes.
*
* \dir LUFA/Drivers/USB/Class/Host
* \brief USB Host Class helper driver files.
- *
+ *
* Host mode drivers for the standard USB classes.
*
* \dir LUFA/Drivers/Board
* \brief Board hardware driver files.
- *
+ *
* This folder contains drivers for interfacing with the physical hardware on supported commercial boards, primarily from
* the Atmel corporation. Header files in this folder should be included in user applications requiring the functionality of
* hardware placed on supported boards.
*
* \dir LUFA/Drivers/Board/USBKEY
* \brief USBKEY board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the Atmel USBKEY demonstration board. The header files in this folder should
* not be included directly in user applications; the similarly named dispatch header files located in the parent Board directory
* should be included instead.
*
* \dir LUFA/Drivers/Board/STK526
* \brief STK526 board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the Atmel STK526 development board. The header files in this folder should
* not be included directly in user applications; the similarly named dispatch header files located in the parent Board directory
* should be included instead.
*
* \dir LUFA/Drivers/Board/STK525
* \brief STK525 board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the Atmel STK525 development board. The header files in this folder should
* not be included directly in user applications; the similarly named dispatch header files located in the parent Board directory
* should be included instead.
*
* \dir LUFA/Drivers/Board/RZUSBSTICK
* \brief RZUSBSTICK board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the Atmel RZUSBSTICK board, as used in the Atmel "Raven" wireless kits. The header
* files in this folder should not be included directly in user applications; the similarly named dispatch header files located in
* the parent Board directory should be included instead.
*
* \dir LUFA/Drivers/Board/ATAVRUSBRF01
* \brief ATAVRUSBRF01 board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the Atmel ATAVRUSBRF01 board, as used in several Atmel wireless demo kits. The header
* files in this folder should not be included directly in user applications; the similarly named dispatch header files located in
* the parent Board directory should be included instead.
*
* \dir LUFA/Drivers/Board/BUMBLEB
* \brief BUMBLEB board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the Fletchtronics Bumble-B board (http://fletchtronics.net/bumble-b). The header
* files in this folder should not be included directly in user applications; the similarly named dispatch header files located in
* the parent Board directory should be included instead.
*
* \dir LUFA/Drivers/Board/XPLAIN
* \brief XPLAIN board hardware driver files.
- *
- * This folder contains drivers for hardware on the Atmel XPLAIN board (all hardware revisions). The header files in this folder
- * should not be included directly in user applications; the similarly named dispatch header files located in the parent Board
+ *
+ * This folder contains drivers for hardware on the Atmel XPLAIN board (all hardware revisions). The header files in this folder
+ * should not be included directly in user applications; the similarly named dispatch header files located in the parent Board
* directory should be included instead.
*
* \dir LUFA/Drivers/Board/EVK527
* \brief XPLAIN board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the Atmel EVK527 development board. The header files in this folder should
* not be included directly in user applications; the similarly named dispatch header files located in the parent Board directory
* should be included instead.
*
* \dir LUFA/Drivers/Board/TEENSY
* \brief TEENSY board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on all revisions of the PJRC Teensy boards (http://www.pjrc.com/teensy/). The header
* files in this folder should not be included directly in user applications; the similarly named dispatch header files located
* in the parent Board directory should be included instead.
*
* \dir LUFA/Drivers/Board/USBTINYMKII
* \brief USBTINY-MKII board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on all revisions of the USBTINY-MKII boards (http://tom-itx.dyndns.org:81/~webpage/).
* The header files in this folder should not be included directly in user applications; the similarly named dispatch header files
* located in the parent Board directory should be included instead.
*
* \dir LUFA/Drivers/Board/BENITO
* \brief BENITO board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the Benito boards (http://dorkbotpdx.org/wiki/benito). The header files in this
* folder should not be included directly in user applications; the similarly named dispatch header files located in the parent
* Board directory should be included instead.
*
* \dir LUFA/Drivers/Board/JMDBU2
* \brief JM-DB-U2 board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the JM-DB-U2 boards (http://u2.mattair.net/). The header files in this folder
* should not be included directly in user applications; the similarly named dispatch header files located in the parent Board
* directory should be included instead.
*
* \dir LUFA/Drivers/Board/OLIMEX162
* \brief Olimex USB-STK-162 board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the Olimex AVR-USB-162 boards (http://www.olimex.com/dev/avr-usb-162.html).
* The header files in this folder should not be included directly in user applications; the similarly named dispatch header files
* located in the parent Board directory should be included instead.
*
* \dir LUFA/Drivers/Board/USBFOO
* \brief USBFOO board hardware driver files.
- *
+ *
* This folder contains drivers for hardware on the USBFOO boards (http://shop.kernelconcepts.de/product_info.php?products_id=102).
* The header files in this folder should not be included directly in user applications; the similarly named dispatch header files
* located in the parent Board directory should be included instead.
*
* \dir LUFA/CodeTemplates
* \brief Code templates for use in LUFA powered applications.
- *
+ *
* This contains code templates for board drivers, sample LUFA project makefiles and other similar templates that can be copied into
* a LUFA powered application and modified to speed up development.
*
* \dir LUFA/CodeTemplates/DriverStubs
* \brief Driver stub header files for custom boards, to allow the LUFA board drivers to operate.
- *
+ *
* This contains stub files for the LUFA board drivers. If the LUFA board drivers are used with board hardware other than those
* directly supported by the library, the BOARD parameter of the application's makefile can be set to "USER", and these stub files
* copied to the "/Board/" directory of the application's folder. When fleshed out with working driver code for the custom board,
* the corresponding LUFA board APIs will work correctly with the non-standard board hardware.
*/
+
diff --git a/LUFA/ManPages/Donating.txt b/LUFA/ManPages/Donating.txt
index 8a4d601ad..6e476c827 100644
--- a/LUFA/ManPages/Donating.txt
+++ b/LUFA/ManPages/Donating.txt
@@ -21,4 +21,4 @@
* \image html "http://www.pledgie.com/campaigns/6927.png?skin_name=chrome"
* <a href='http://www.pledgie.com/campaigns/6927'>Donate to this project via PayPal</a> - Thanks in Advance!
*/
-
+
diff --git a/LUFA/ManPages/FutureChanges.txt b/LUFA/ManPages/FutureChanges.txt
index a6f52d119..15d5df492 100644
--- a/LUFA/ManPages/FutureChanges.txt
+++ b/LUFA/ManPages/FutureChanges.txt
@@ -40,3 +40,4 @@
* -# Atmel ARM7 series microcontrollers
* -# Other (commercial) C compilers
*/
+
diff --git a/LUFA/ManPages/GettingStarted.txt b/LUFA/ManPages/GettingStarted.txt
index c161bfe1f..ab460cb6e 100644
--- a/LUFA/ManPages/GettingStarted.txt
+++ b/LUFA/ManPages/GettingStarted.txt
@@ -24,3 +24,4 @@
* \li \subpage Page_CompilingApps - How to Compile the Included Demos, Projects and Bootloaders
* \li \subpage Page_ProgrammingApps - How to Program an AVR with the Included Demos, Projects and Bootloaders
*/
+
diff --git a/LUFA/ManPages/Groups.txt b/LUFA/ManPages/Groups.txt
index a204412e1..0c9f4a657 100644
--- a/LUFA/ManPages/Groups.txt
+++ b/LUFA/ManPages/Groups.txt
@@ -13,8 +13,9 @@
*
* Functions, macros, variables, enums and types related to the control of AVR subsystems.
*/
-
+
/** @defgroup Group_MiscDrivers Miscellaneous Drivers
*
* Miscellaneous driver Functions, macros, variables, enums and types.
*/
+
diff --git a/LUFA/ManPages/LUFAPoweredProjects.txt b/LUFA/ManPages/LUFAPoweredProjects.txt
index f1cf03135..1e41d5353 100644
--- a/LUFA/ManPages/LUFAPoweredProjects.txt
+++ b/LUFA/ManPages/LUFAPoweredProjects.txt
@@ -28,7 +28,7 @@
* - Teensy and Teensy++, two other AVR USB development boards: http://www.pjrc.com/teensy/index.html
* - U2DIL/U4DIL, a set of DIP layout USB AVR boards: http://www.reworld.eu/re/en/products/u2dil/
* - USBFOO 2, AT90USB162 based development board: http://shop.kernelconcepts.de/product_info.php?products_id=102
- *
+ *
* \section Sec_LUFAProjects Projects Using LUFA (Hobbyist)
*
* The following are known hobbyist projects using LUFA. Most are open source, and show off interesting ways that the LUFA library
@@ -70,7 +70,7 @@
* - USB Interface for Playstation Portable Devices: http://forums.ps2dev.org/viewtopic.php?t=11001
* - Userial, a USB to Serial converter with SPI, I2C and other protocols: http://www.tty1.net/userial/
* - XUM1541, a Commodore 64 floppy drive to USB adapter: http://www.root.org/~nate/c64/xum1541/
- *
+ *
* \section Sec_LUFACommercialProjects Projects Using LUFA (Commercial)
*
* The following is a list of known commercial products using LUFA. Some of these are open source, although many are "black-box"
@@ -91,4 +91,4 @@
* - Elektor Magazine, "USB is Cool/Sucks" by Jerry Jacobs and Chris Vossen (minor mention), January 2010 Issue
* - Elektor Magazine, "20 x Open Source" by Jens Nickel, March 2010 Issue
* - Circuit Cellar Magazine, "Advanced USB Design Debugging" by Collin O'Flynn, August 2010 Issue
- */ \ No newline at end of file
+ */
diff --git a/LUFA/ManPages/LUFAvsAtmelStack.txt b/LUFA/ManPages/LUFAvsAtmelStack.txt
index 1eb6d008c..b4fce2df0 100644
--- a/LUFA/ManPages/LUFAvsAtmelStack.txt
+++ b/LUFA/ManPages/LUFAvsAtmelStack.txt
@@ -43,4 +43,4 @@
* As many people are now using LUFA, there is a community being built around it. You can get answers to your LUFA related questions
* quickly by either emailing the library author (subject to author's schedule) or by posting to the official LUFA support mailing list.
*/
-
+
diff --git a/LUFA/ManPages/LibraryApps.txt b/LUFA/ManPages/LibraryApps.txt
index 2a6159af3..0f64345f9 100644
--- a/LUFA/ManPages/LibraryApps.txt
+++ b/LUFA/ManPages/LibraryApps.txt
@@ -75,7 +75,7 @@
* - <b>StillImageHost</b> - Still Image Camera host demo, using the library USB Still Image Class driver framework
* - <b>VirtualSerialHost</b> - Virtual Serial Port host demo, using the library USB CDC Class driver framework
* - <b>LowLevel</b>
- * - <b>JoystickHostWithParser</b> - Joystick host demo with HID Descriptor parser, using the low level LUFA APIs to implement
+ * - <b>JoystickHostWithParser</b> - Joystick host demo with HID Descriptor parser, using the low level LUFA APIs to implement
* the USB HID class
* - <b>GenericHIDHost</b> - Generic HID host demo, using the low level LUFA APIs to implement the USB HID class
* - <b>KeyboardHost</b> - USB Keyboard host demo, using the low level LUFA APIs to implement the USB HID class
@@ -113,3 +113,4 @@
*
* </small>
*/
+
diff --git a/LUFA/ManPages/LibraryResources.txt b/LUFA/ManPages/LibraryResources.txt
index 10f98d90d..14c24048a 100644
--- a/LUFA/ManPages/LibraryResources.txt
+++ b/LUFA/ManPages/LibraryResources.txt
@@ -3,7 +3,7 @@
* This file contains special DoxyGen information for the generation of the main page and other special
* documentation pages. It is not a project source file.
*/
-
+
/**
* \page Page_Resources Library Resources
*
@@ -32,4 +32,4 @@
* \section Sec_USBResources USB Resources
* USB-IF Website: http://www.usb.org \n
*/
-
+
diff --git a/LUFA/ManPages/LicenseInfo.txt b/LUFA/ManPages/LicenseInfo.txt
index 03b30a90b..447bec68c 100644
--- a/LUFA/ManPages/LicenseInfo.txt
+++ b/LUFA/ManPages/LicenseInfo.txt
@@ -19,3 +19,4 @@
*
* \verbinclude License.txt
*/
+
diff --git a/LUFA/ManPages/MainPage.txt b/LUFA/ManPages/MainPage.txt
index f8cd2e576..533591a41 100644
--- a/LUFA/ManPages/MainPage.txt
+++ b/LUFA/ManPages/MainPage.txt
@@ -26,7 +26,7 @@
* both host and device modes. For information about the project progression, see the blog link at \ref Page_Resources.
*
* LUFA is written specifically for the free AVR-GCC compiler, and uses several GCC-only extensions to make the
- * library API more streamlined and robust. You can download AVR-GCC for free in a convenient windows package,
+ * library API more streamlined and robust. You can download AVR-GCC for free in a convenient windows package,
* from the the WinAVR website (see \ref Page_Resources).
*
* The only required AVR peripherals for LUFA is the USB controller itself and interrupts - LUFA does not require the use of the
@@ -43,3 +43,4 @@
* \li \subpage Page_Donating - Donating to support this project
* \li \subpage Page_LibraryApps - Overview of included Demos, Bootloaders and Projects
*/
+
diff --git a/LUFA/ManPages/MigrationInformation.txt b/LUFA/ManPages/MigrationInformation.txt
index 6f8c8642a..474e9f4c7 100644
--- a/LUFA/ManPages/MigrationInformation.txt
+++ b/LUFA/ManPages/MigrationInformation.txt
@@ -57,7 +57,7 @@
* be updated in all project makefiles, or the makefile should be updated to use the new module source variables.
* - The Drivers/USB/LowLevel/HostChapter9.h source file has moved to Drivers/USB/HighLevel/HostStandardReq.c - this should
* be updated in all project makefiles, or the makefile should be updated to use the new module source variables.
- * - The Drivers/USB/LowLevel/LowLevel.c source file has moved to Drivers/LowLevel/USBController.c - this should be updated
+ * - The Drivers/USB/LowLevel/LowLevel.c source file has moved to Drivers/LowLevel/USBController.c - this should be updated
* in all project makefiles, or the makefile should be updated to use the new module source variables.
*
* <b>Device Mode</b>
@@ -107,8 +107,8 @@
*
* <b>Non-USB Library Components</b>
* - Due to some ADC channels not being identical to their ADC MUX selection masks for single-ended conversions on some AVR models,
- * the ADC driver now has explicit masks for each of the standard ADC channels (see \ref Group_ADC). These masks should be used
- * when calling the ADC functions to ensure proper operation across all AVR models. Note that the \ref ADC_SetupChannel() function
+ * the ADC driver now has explicit masks for each of the standard ADC channels (see \ref Group_ADC). These masks should be used
+ * when calling the ADC functions to ensure proper operation across all AVR models. Note that the \ref ADC_SetupChannel() function
* is an exception, and should always be called with a channel number rather than a channel mask.
*
* <b>Host Mode</b>
@@ -142,7 +142,7 @@
* indicate the report type to generate. Existing applications may simply add and ignore this additional parameter.
*
* \section Sec_Migration091122 Migrating from 090924 to 091122
- *
+ *
* <b>Host Mode</b>
* - The HID_PARSE_UsageStackOverflow HID parser error constant is now named \ref HID_PARSE_UsageListOverflow
* - The \ref CALLBACK_HIDParser_FilterHIDReportItem() HID Parser callback now passes a complete HID_ReportItem_t to the
@@ -267,7 +267,7 @@
* library demos should update to the latest versions.
*
* <b>Device Mode</b>
- * - The Endpoint_ClearCurrentBank() macro has been removed, and is now replaced with the Endpoint_ClearIN(), Endpoint_ClearOUT()
+ * - The Endpoint_ClearCurrentBank() macro has been removed, and is now replaced with the Endpoint_ClearIN(), Endpoint_ClearOUT()
* macros. See Endpoint.h documentation for more details on the new endpoint management macros.
* - The Endpoint_ReadWriteAllowed() macro has been renamed to Endpoint_IsReadWriteAllowed() to be more consistent with the rest of
* the API naming scheme.
@@ -339,7 +339,7 @@
*
* <b>Device Mode</b>
* - The NO_CLEARSET_FEATURE_REQUEST compile time token has been renamed to FEATURELESS_CONTROL_ONLY_DEVICE, and its function expanded
- * to also remove parts of the Get Status chapter 9 request to further reduce code usage. On all applications currently using the
+ * to also remove parts of the Get Status chapter 9 request to further reduce code usage. On all applications currently using the
* NO_CLEARSET_FEATURE_REQUEST compile time token, it can be replaced with the FEATURELESS_CONTROL_ONLY_DEVICE token with no further
* modifications required.
*
@@ -560,3 +560,4 @@
* finished enumerating the device. Projects relying on the event only firing in Host mode should be updated
* so that the event action only occurs when the USB_Mode global is set to USB_MODE_HOST.
*/
+
diff --git a/LUFA/ManPages/ProgrammingApps.txt b/LUFA/ManPages/ProgrammingApps.txt
index 4f3107502..c1b2181c8 100644
--- a/LUFA/ManPages/ProgrammingApps.txt
+++ b/LUFA/ManPages/ProgrammingApps.txt
@@ -3,7 +3,7 @@
* This file contains special DoxyGen information for the generation of the main page and other special
* documentation pages. It is not a project source file.
*/
-
+
/** \page Page_ProgrammingApps Programming an Application into a USB AVR
*
* Once you have built an application, you will need a way to program in the resulting ".HEX" file (and, if your
@@ -24,4 +24,4 @@
* If you wish to use the DFU bootloader to program in your application, refer to your DFU programmer's documentation.
* Atmel provides a free utility called FLIP which is USB AVR compatible, and an open source (Linux compatible)
* alternative exists called "dfu-programmer".
- */ \ No newline at end of file
+ */
diff --git a/LUFA/ManPages/SoftwareBootloaderJump.txt b/LUFA/ManPages/SoftwareBootloaderJump.txt
index 574398c8f..2591a8645 100644
--- a/LUFA/ManPages/SoftwareBootloaderJump.txt
+++ b/LUFA/ManPages/SoftwareBootloaderJump.txt
@@ -30,7 +30,7 @@
*
* #define MAGIC_BOOT_KEY 0xDC42ACCA
* #define BOOTLOADER_START_ADDRESS (FLASH_SIZE_BYTES - BOOTLOADER_SEC_SIZE_BYTES)
- *
+ *
* void Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3);
* void Bootloader_Jump_Check(void)
* {
@@ -38,7 +38,7 @@
* if ((MCUSR & (1 << WDRF)) && (Boot_Key == MAGIC_BOOT_KEY))
* {
* Boot_Key = 0;
- * ((void (*)(void))BOOTLOADER_START_ADDRESS)();
+ * ((void (*)(void))BOOTLOADER_START_ADDRESS)();
* }
* }
*
@@ -57,12 +57,13 @@
* // Set the bootloader key to the magic value and force a reset
* Boot_Key = MAGIC_BOOT_KEY;
* wdt_enable(WDTO_250MS);
- * for (;;);
+ * for (;;);
* }
* \endcode
*
* Note that the bootloader magic key can be any arbitrary value. The <em>FLASH_SIZE_BYTES</em> and
* <em>BOOTLOADER_SEC_SIZE_BYTES</em> tokens should be replaced with the total flash size of the AVR
* in bytes, and the allocated size of the bootloader section for the target AVR.
- *
+ *
*/
+
diff --git a/LUFA/ManPages/VIDAndPIDValues.txt b/LUFA/ManPages/VIDAndPIDValues.txt
index 9f4183e26..0b88a0c71 100644
--- a/LUFA/ManPages/VIDAndPIDValues.txt
+++ b/LUFA/ManPages/VIDAndPIDValues.txt
@@ -421,3 +421,4 @@
* to be resolved by using a unique release number in the Device Descriptor. No devices using this
* VID/PID combination may be released to the general public.
*/
+
diff --git a/LUFA/ManPages/WhyUseLUFA.txt b/LUFA/ManPages/WhyUseLUFA.txt
index b6c93580b..7a90c67e1 100644
--- a/LUFA/ManPages/WhyUseLUFA.txt
+++ b/LUFA/ManPages/WhyUseLUFA.txt
@@ -43,4 +43,4 @@
* <small>* Atmel Stack Mouse Device Demo 4292 bytes, LUFA Mouse Low Level Device Demo 3332 bytes, under identical build
* environments</small>
*/
-
+
diff --git a/LUFA/ManPages/WritingBoardDrivers.txt b/LUFA/ManPages/WritingBoardDrivers.txt
index dd0ea47c7..e09e7d0d9 100644
--- a/LUFA/ManPages/WritingBoardDrivers.txt
+++ b/LUFA/ManPages/WritingBoardDrivers.txt
@@ -24,3 +24,4 @@
* user board drivers, maintaining code compatibility and allowing for a different board to be selected through the
* project makefile with no code changes.
*/
+
diff --git a/LUFA/Scheduler/Scheduler.c b/LUFA/Scheduler/Scheduler.c
index 7113ee322..6ef1c4de4 100644
--- a/LUFA/Scheduler/Scheduler.c
+++ b/LUFA/Scheduler/Scheduler.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -38,14 +38,14 @@ bool Scheduler_HasDelayElapsed(const uint16_t Delay,
{
SchedulerDelayCounter_t CurrentTickValue_LCL;
SchedulerDelayCounter_t DelayCounter_LCL;
-
+
ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
{
CurrentTickValue_LCL = Scheduler_TickCounter;
}
-
+
DelayCounter_LCL = *DelayCounter;
-
+
if (CurrentTickValue_LCL >= DelayCounter_LCL)
{
if ((CurrentTickValue_LCL - DelayCounter_LCL) >= Delay)
@@ -60,9 +60,9 @@ bool Scheduler_HasDelayElapsed(const uint16_t Delay,
{
*DelayCounter = CurrentTickValue_LCL;
return true;
- }
+ }
}
-
+
return false;
}
@@ -70,7 +70,7 @@ void Scheduler_SetTaskMode(const TaskPtr_t Task,
const bool TaskStatus)
{
TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
-
+
while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks])
{
if (CurrTask->Task == Task)
@@ -78,7 +78,7 @@ void Scheduler_SetTaskMode(const TaskPtr_t Task,
CurrTask->TaskStatus = TaskStatus;
break;
}
-
+
CurrTask++;
}
}
@@ -87,12 +87,13 @@ void Scheduler_SetGroupTaskMode(const uint8_t GroupID,
const bool TaskStatus)
{
TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
-
+
while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks])
{
if (CurrTask->GroupID == GroupID)
CurrTask->TaskStatus = TaskStatus;
-
+
CurrTask++;
}
}
+
diff --git a/LUFA/Scheduler/Scheduler.h b/LUFA/Scheduler/Scheduler.h
index b77ec5468..b4946d65c 100644
--- a/LUFA/Scheduler/Scheduler.h
+++ b/LUFA/Scheduler/Scheduler.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -36,7 +36,7 @@
*
* \deprecated This module is deprecated and will be removed in a future library release.
*/
-
+
/** @defgroup Group_Scheduler Simple Task Scheduler - LUFA/Scheduler/Scheduler.h
*
* \deprecated This module is deprecated and will be removed in a future library release.
@@ -63,10 +63,10 @@
* Usage Example:
* \code
* #include <LUFA/Scheduler/Scheduler.h>
- *
+ *
* TASK(MyTask1); // Task prototype
* TASK(MyTask2); // Task prototype
- *
+ *
* TASK_LIST
* {
* { .Task = MyTask1, .TaskStatus = TASK_RUN, .GroupID = 1 },
@@ -100,14 +100,14 @@
*
* @{
*/
-
+
#ifndef __SCHEDULER_H__
#define __SCHEDULER_H__
/* Includes: */
#include <stdint.h>
#include <stdbool.h>
-
+
#include <util/atomic.h>
#include "../Common/Common.h"
@@ -130,7 +130,7 @@
* \endcode
*/
#define TASK(name) void name (void)
-
+
/** Defines a task list array, containing one or more task entries of the type TaskEntry_t. Each task list
* should be encased in curly braces and ended with a comma.
*
@@ -143,8 +143,8 @@
* }
* \endcode
*/
- #define TASK_LIST TaskEntry_t Scheduler_TaskList[] =
-
+ #define TASK_LIST TaskEntry_t Scheduler_TaskList[] =
+
/** Constant, giving the maximum delay in scheduler ticks which can be stored in a variable of type
* \ref SchedulerDelayCounter_t.
*/
@@ -155,14 +155,14 @@
/** Task status mode constant, for passing to \ref Scheduler_SetTaskMode() or \ref Scheduler_SetGroupTaskMode(). */
#define TASK_STOP false
-
+
/* Pseudo-Function Macros: */
#if defined(__DOXYGEN__)
/** Starts the scheduler in its infinite loop, executing running tasks. This should be placed at the end
* of the user application's main() function, as it can never return to the calling function.
*/
void Scheduler_Start(void);
-
+
/** Initialises the scheduler so that the scheduler functions can be called before the scheduler itself
* is started. This must be executed before any scheduler function calls other than Scheduler_Start(),
* and can be omitted if no such functions could be called before the scheduler is started.
@@ -176,12 +176,12 @@
/* Type Defines: */
/** Type define for a pointer to a scheduler task. */
typedef void (*TaskPtr_t)(void);
-
+
/** Type define for a variable which can hold a tick delay value for the scheduler up to the maximum delay
* possible.
*/
typedef uint16_t SchedulerDelayCounter_t;
-
+
/** \brief Scheduler Task List Entry Structure.
*
* Structure for holding a single task's information in the scheduler task list.
@@ -199,7 +199,7 @@
* functions should be used instead of direct manipulation.
*/
exter TaskEntry_t Scheduler_TaskList[];
-
+
/** Contains the total number of tasks in the task list, irrespective of if the task's status is set to
* \ref TASK_RUN or \ref TASK_STOP.
*
@@ -228,7 +228,7 @@
*DelayCounter = Scheduler_TickCounter;
}
}
-
+
/* Function Prototypes: */
/** Determines if the given tick delay has elapsed, based on the given delay period and tick counter value.
*
@@ -251,7 +251,7 @@
bool Scheduler_HasDelayElapsed(const uint16_t Delay,
SchedulerDelayCounter_t* const DelayCounter)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(2);
-
+
/** Sets the task mode for a given task.
*
* \param[in] Task Name of the task whose status is to be changed.
@@ -259,7 +259,7 @@
*/
void Scheduler_SetTaskMode(const TaskPtr_t Task,
const bool TaskStatus);
-
+
/** Sets the task mode for a given task group ID, allowing for an entire group of tasks to have their
* statuses changed at once.
*
@@ -281,7 +281,7 @@
{
Scheduler_TotalTasks = TotalTasks;
}
-
+
static inline void Scheduler_GoSchedule(const uint8_t TotalTasks) ATTR_NO_RETURN ATTR_ALWAYS_INLINE ATTR_DEPRECATED;
static inline void Scheduler_GoSchedule(const uint8_t TotalTasks)
{
@@ -290,7 +290,7 @@
for (;;)
{
TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
-
+
while (CurrTask != &Scheduler_TaskList[TotalTasks])
{
if (CurrTask->TaskStatus == TASK_RUN)
@@ -301,12 +301,13 @@
}
}
#endif
-
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
-
+
#endif
/** @} */
+
diff --git a/LUFA/Version.h b/LUFA/Version.h
index 986ad1e7f..db69d3bda 100644
--- a/LUFA/Version.h
+++ b/LUFA/Version.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
@@ -33,7 +33,7 @@
* \brief LUFA library version constants.
*
* Version constants for informational purposes and version-specific macro creation. This header file contains the
- * current LUFA version number in several forms, for use in the user-application (for example, for printing out
+ * current LUFA version number in several forms, for use in the user-application (for example, for printing out
* whilst debugging, or for testing for version compatibility).
*/
@@ -49,3 +49,4 @@
#define LUFA_VERSION_STRING "XXXXXX"
#endif
+
diff --git a/LUFA/makefile b/LUFA/makefile
index 2dbecaf8e..a28773586 100644
--- a/LUFA/makefile
+++ b/LUFA/makefile
@@ -1,7 +1,7 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2010.
-#
+#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
@@ -62,7 +62,7 @@ ifeq ($(origin LUFA_PATH), undefined)
clean:
rm -f $(LUFA_SRC_ALL_FILES:%.c=%.o)
-
+
clean_list:
doxygen:
@@ -74,4 +74,4 @@ ifeq ($(origin LUFA_PATH), undefined)
rm -rf Documentation
.PHONY: all clean clean_list doxygen clean_doxygen
-endif \ No newline at end of file
+endif