aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/ClassDriver/JoystickHostWithParser
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 /Demos/Host/ClassDriver/JoystickHostWithParser
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 'Demos/Host/ClassDriver/JoystickHostWithParser')
-rw-r--r--Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c39
-rw-r--r--Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h23
-rw-r--r--Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.txt11
-rw-r--r--Demos/Host/ClassDriver/JoystickHostWithParser/makefile49
4 files changed, 63 insertions, 59 deletions
diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c
index fb48c2b17..8d87e88c2 100644
--- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c
+++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.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
@@ -33,7 +33,7 @@
* Main source file for the JoystickHostWithParser demo. This file contains the main tasks of
* the demo and is responsible for the initial application hardware configuration.
*/
-
+
#include "JoystickHostWithParser.h"
/** Processed HID report descriptor items structure, containing information on each HID report element */
@@ -52,14 +52,14 @@ USB_ClassInfo_HID_Host_t Joystick_HID_Interface =
.DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false,
-
+
.HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol,
-
+
.HIDParserData = &HIDReportInfo
},
};
-
+
/** Main program entry point. This routine configures the hardware required by the application, then
* enters a loop to run the application tasks in sequence.
*/
@@ -78,7 +78,7 @@ int main(void)
{
case HOST_STATE_Addressed:
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
-
+
uint16_t ConfigDescriptorSize;
uint8_t ConfigDescriptorData[512];
@@ -99,7 +99,7 @@ int main(void)
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break;
}
-
+
if (USB_Host_SetDeviceConfiguration(1) != HOST_SENDCONTROL_Successful)
{
puts_P(PSTR("Error Setting Device Configuration.\r\n"));
@@ -115,7 +115,7 @@ int main(void)
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break;
}
-
+
puts_P(PSTR("Joystick Enumerated.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_READY);
USB_HostState = HOST_STATE_Configured;
@@ -131,7 +131,7 @@ int main(void)
for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)
{
HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
-
+
/* Update the report item value if it is contained within the current report */
if (!(USB_GetHIDReportItemInfo(JoystickReport, ReportItem)))
continue;
@@ -149,7 +149,7 @@ int main(void)
(ReportItem->ItemType == HID_REPORT_ITEM_In))
{
int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t);
-
+
if (DeltaMovement)
{
if (ReportItem->Attributes.Usage.Usage == USAGE_X)
@@ -159,13 +159,13 @@ int main(void)
}
}
}
-
+
LEDs_SetAllLEDs(LEDMask);
}
-
+
break;
}
-
+
HID_Host_USBTask(&Joystick_HID_Interface);
USB_USBTask();
}
@@ -235,7 +235,7 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode,
" -- Error Code %d\r\n"
" -- Sub Error Code %d\r\n"
" -- In State %d\r\n" ESC_FG_WHITE), ErrorCode, SubErrorCode, USB_HostState);
-
+
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
@@ -277,3 +277,4 @@ bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem)
return ((CurrentItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) ||
(CurrentItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL));
}
+
diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h
index 1cebb924c..51f641dd4 100644
--- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h
+++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.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 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
-
+
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
#define LEDMASK_USB_NOTREADY LEDS_LED1
@@ -78,17 +78,18 @@
/** HID Report Descriptor Usage value for a Y axis movement. */
#define USAGE_Y 0x31
-
+
/* Function Prototypes: */
void SetupHardware(void);
-
+
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
void EVENT_USB_Host_DeviceAttached(void);
void EVENT_USB_Host_DeviceUnattached(void);
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode,
const uint8_t SubErrorCode);
void EVENT_USB_Host_DeviceEnumerationComplete(void);
-
+
bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem);
-
+
#endif
+
diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.txt b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.txt
index 055890b70..0fa97f868 100644
--- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.txt
+++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.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.
*/
-
+
/** \mainpage Joystick Host With HID Descriptor Parser Demo
*
* \section SSec_Compat Demo Compatibility:
@@ -25,7 +25,7 @@
* <td><b>USB Class:</b></td>
* <td>Human Interface Device (HID)</td>
* </tr>
- * <tr>
+ * <tr>
* <td><b>USB Subclass:</b></td>
* <td>N/A</td>
* </tr>
@@ -41,19 +41,19 @@
* </tr>
* </table>
*
- * \section SSec_Description Project Description:
+ * \section SSec_Description Project Description:
*
* Joystick host demonstration application. This gives a simple reference
* application for implementing a USB Joystick host, for USB joysticks using
* the standard joystick HID profile. It uses a HID parser for the HID
* reports, allowing for correct operation across all USB joysticks. This
* demo supports joysticks with a single HID report.
- *
+ *
* Joystick movement and button presses are displayed on the board LEDs.
* On connection to a USB joystick, the report items will be processed and
* printed as a formatted list through the USART before the joystick is
* fully enumerated.
- *
+ *
* Currently only single interface joysticks are supported.
*
* \section SSec_Options Project Options
@@ -68,3 +68,4 @@
* </tr>
* </table>
*/
+
diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/makefile b/Demos/Host/ClassDriver/JoystickHostWithParser/makefile
index a82f4e29c..a585f3f9f 100644
--- a/Demos/Host/ClassDriver/JoystickHostWithParser/makefile
+++ b/Demos/Host/ClassDriver/JoystickHostWithParser/makefile
@@ -47,7 +47,7 @@
# make doxygen = Generate DoxyGen documentation for the project (must have
# DoxyGen installed)
#
-# make debug = Start either simulavr or avarice as specified for debugging,
+# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
@@ -64,14 +64,14 @@ MCU = at90usb1287
# Target board (see library "Board Types" documentation, NONE for projects not requiring
-# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
# "Board" inside the application directory.
BOARD = USBKEY
# Processor frequency.
-# This will define a symbol, F_CPU, in all source code files equal to the
-# processor frequency in Hz. You can then use this symbol in your source code to
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
@@ -84,7 +84,7 @@ F_CPU = 8000000
# Input clock frequency.
-# This will define a symbol, F_CLOCK, in all source code files equal to the
+# This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
@@ -133,7 +133,7 @@ SRC = $(TARGET).c \
# List C++ source files here. (C dependencies are automatically generated.)
-CPPSRC =
+CPPSRC =
# List Assembler source files here.
@@ -146,7 +146,7 @@ CPPSRC =
ASRC =
-# Optimization level, can be [0, 1, 2, 3, s].
+# Optimization level, can be [0, 1, 2, 3, s].
# 0 = turn off optimization. s = optimize for size.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
@@ -260,7 +260,7 @@ CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
# for use in COFF files, additional information about filenames
# and function names needs to be present in the assembler source
# files -- see avr-libc docs [FIXME: not yet described there]
-# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
# dump that will be displayed for a given single line of source input.
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
@@ -273,7 +273,7 @@ PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
# If this is left blank, then it will use the Standard printf version.
-PRINTF_LIB =
+PRINTF_LIB =
#PRINTF_LIB = $(PRINTF_LIB_MIN)
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
@@ -285,7 +285,7 @@ SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
# If this is left blank, then it will use the Standard scanf version.
-SCANF_LIB =
+SCANF_LIB =
#SCANF_LIB = $(SCANF_LIB_MIN)
#SCANF_LIB = $(SCANF_LIB_FLOAT)
@@ -297,7 +297,7 @@ MATH_LIB = -lm
# Each directory must be seperated by a space.
# Use forward slashes for directory separators.
# For a directory that has spaces, enclose it in quotes.
-EXTRALIBDIRS =
+EXTRALIBDIRS =
@@ -320,7 +320,7 @@ EXTMEMOPTS =
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
-LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
@@ -354,7 +354,7 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
#AVRDUDE_NO_VERIFY = -V
# Increase verbosity level. Please use this when submitting bug
-# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
# to submit bug reports.
#AVRDUDE_VERBOSE = -v -v
@@ -388,7 +388,7 @@ JTAG_DEV = /dev/com1
DEBUG_PORT = 4242
# Debugging host used to communicate between GDB / avarice / simulavr, normally
-# just set to localhost unless doing some sort of crazy debugging when
+# just set to localhost unless doing some sort of crazy debugging when
# avarice is running on a different computer.
DEBUG_HOST = localhost
@@ -417,7 +417,7 @@ WINSHELL = cmd
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = -------- end --------
-MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
@@ -436,10 +436,10 @@ MSG_CREATING_LIBRARY = Creating library:
# Define all object files.
-OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
# Define all listing files.
-LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
# Compiler flags to generate dependency files.
@@ -504,11 +504,11 @@ sizeafter:
# Display compiler version information.
-gccversion :
+gccversion :
@$(CC) --version
-# Program the device.
+# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
@@ -535,9 +535,9 @@ dfu-ee: $(TARGET).hex $(TARGET).eep
# Generate avr-gdb config/init file which does the following:
-# define the reset signal, load the target file, connect to target, and set
+# define the reset signal, load the target file, connect to target, and set
# a breakpoint at main().
-gdb-config:
+gdb-config:
@$(REMOVE) $(GDBINIT_FILE)
@echo define reset >> $(GDBINIT_FILE)
@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
@@ -635,14 +635,14 @@ extcoff: $(TARGET).elf
$(OBJDIR)/%.o : %.c
@echo
@echo $(MSG_COMPILING) $<
- $(CC) -c $(ALL_CFLAGS) $< -o $@
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
# Compile: create object files from C++ source files.
$(OBJDIR)/%.o : %.cpp
@echo
@echo $(MSG_COMPILING_CPP) $<
- $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
# Compile: create assembler files from C source files.
@@ -664,7 +664,7 @@ $(OBJDIR)/%.o : %.S
# Create preprocessed source for use in sending a bug report.
%.i : %.c
- $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
# Target: clean project.
@@ -708,3 +708,4 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
build elf hex eep lss sym coff extcoff doxygen clean \
clean_list clean_doxygen program dfu flip flip-ee dfu-ee \
debug gdb-config
+