aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/LowLevel/JoystickHostWithParser
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Host/LowLevel/JoystickHostWithParser')
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c25
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h19
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.c19
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h25
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c58
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h17
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.txt11
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/makefile49
8 files changed, 115 insertions, 108 deletions
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c
index 3eaf7d960..20eaec7c9 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/JoystickHostWithParser/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
@@ -50,7 +50,7 @@ uint8_t ProcessConfigurationDescriptor(void)
uint8_t ConfigDescriptorData[512];
void* CurrConfigLocation = ConfigDescriptorData;
uint16_t CurrConfigBytesRem;
-
+
USB_Descriptor_Interface_t* HIDInterface = NULL;
USB_Descriptor_HID_t* HIDDescriptor = NULL;
USB_Descriptor_Endpoint_t* DataINEndpoint = NULL;
@@ -95,12 +95,12 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Save the HID descriptor for later use */
- HIDDescriptor = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_HID_t);
+ HIDDescriptor = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_HID_t);
/* Skip the remainder of the loop as we have not found an endpoint yet */
continue;
}
-
+
/* Retrieve the endpoint address from the endpoint descriptor */
USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);
@@ -108,7 +108,7 @@ uint8_t ProcessConfigurationDescriptor(void)
if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
DataINEndpoint = EndpointData;
}
-
+
/* Configure the HID data IN pipe */
Pipe_ConfigurePipe(JOYSTICK_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
@@ -140,7 +140,7 @@ uint8_t DComp_NextJoystickInterface(void* CurrentDescriptor)
return DESCRIPTOR_SEARCH_Found;
}
}
-
+
return DESCRIPTOR_SEARCH_NotFound;
}
@@ -181,5 +181,6 @@ uint8_t DComp_NextHID(void* CurrentDescriptor)
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)
return DESCRIPTOR_SEARCH_Found;
else
- return DESCRIPTOR_SEARCH_NotFound;
+ return DESCRIPTOR_SEARCH_NotFound;
}
+
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h
index 58c63f9e5..5aafe7d39 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/JoystickHostWithParser/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
@@ -38,9 +38,9 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h>
-
+
#include "HIDReport.h"
-
+
/* Macros: */
/** Interface Class value for the Human Interface Device class. */
#define JOYSTICK_CLASS 0x03
@@ -53,7 +53,7 @@
/** Descriptor header type constant for a HID report descriptor. */
#define DTYPE_Report 0x22
-
+
/** Pipe number for the joystick report data pipe. */
#define JOYSTICK_DATA_IN_PIPE 1
@@ -78,3 +78,4 @@
uint8_t DComp_NextHID(void* CurrentDescriptor);
#endif
+
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.c b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.c
index bda99bdd0..76e26a0d5 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.c
+++ b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.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 GetHIDReportData(void)
{
/* Create a buffer big enough to hold the entire returned HID report */
uint8_t HIDReportData[HIDReportSize];
-
+
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
@@ -66,7 +66,7 @@ uint8_t GetHIDReportData(void)
/* Send the HID report to the parser for processing */
if (USB_ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful)
return ParseError;
-
+
return ParseSuccessful;
}
@@ -100,7 +100,7 @@ bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem)
/* If a collection with the joystick usage was not found, indicate that we are not interested in this item */
if (!IsJoystick)
return false;
-
+
/* Check the attributes of the current joystick item - see if we are interested in it or not;
* only store BUTTON and GENERIC_DESKTOP_CONTROL items into the Processed HID Report
* structure to save RAM and ignore the rest
@@ -108,3 +108,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/LowLevel/JoystickHostWithParser/HIDReport.h b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h
index da73ff823..0808806f7 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h
+++ b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.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 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/Host/HIDParser.h>
-
+
#include "JoystickHostWithParser.h"
/* Macros: */
@@ -66,16 +66,16 @@
ParseError = 1, /**< Failed to fully process the HID report descriptor */
ParseControlError = 2, /**< Control error occurred while trying to read the device HID descriptor */
};
-
+
/* Type Defines: */
/** Type define for a HID descriptor. */
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
-
+
uint16_t HIDSpec; /**< Implemented HID class specification, in BCD encoded format */
uint8_t CountryCode; /**< Country code value for localized hardware */
-
+
uint8_t TotalHIDDescriptors; /**< Total number of HID report descriptors in the current interface */
uint8_t HIDReportType; /**< HID report type of the first HID report descriptor */
@@ -88,7 +88,8 @@
/* Function Prototypes: */
uint8_t GetHIDReportData(void);
-
+
bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem);
-
+
#endif
+
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c
index c7739e97f..3bd27da11 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c
+++ b/Demos/Host/LowLevel/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"
/** Main program entry point. This routine configures the hardware required by the application, then
@@ -64,7 +64,7 @@ void SetupHardware(void)
/* Disable clock division */
clock_prescale_set(clock_div_1);
-
+
/* Hardware Initialization */
SerialStream_Init(9600, false);
LEDs_Init();
@@ -118,7 +118,7 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8
" -- 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);
}
@@ -134,7 +134,7 @@ void Joystick_HID_Task(void)
{
case HOST_STATE_Addressed:
puts_P(PSTR("Getting Config Data.\r\n"));
-
+
/* Get and process the configuration descriptor data */
if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
{
@@ -144,7 +144,7 @@ void Joystick_HID_Task(void)
puts_P(PSTR(ESC_FG_RED "Invalid Device.\r\n"));
printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
-
+
/* Indicate error via status LEDs */
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
@@ -152,7 +152,7 @@ void Joystick_HID_Task(void)
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break;
}
-
+
/* Set the device configuration to the first configuration (rarely do devices use multiple configurations) */
if ((ErrorCode = USB_Host_SetDeviceConfiguration(1)) != HOST_SENDCONTROL_Successful)
{
@@ -161,12 +161,12 @@ void Joystick_HID_Task(void)
/* Indicate error via status LEDs */
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
-
+
/* Wait until USB device disconnected */
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break;
}
-
+
printf_P(PSTR("Processing HID Report (Size %d Bytes).\r\n"), HIDReportSize);
/* Get and process the device's first HID report descriptor */
@@ -178,21 +178,21 @@ void Joystick_HID_Task(void)
puts_P(PSTR("Not a valid Joystick." ESC_FG_WHITE));
else
printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
-
+
/* Indicate error via status LEDs */
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
-
+
/* Wait until USB device disconnected */
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break;
}
-
+
printf("Total Reports: %d\r\n", HIDReportInfo.TotalDeviceReports);
for (uint8_t i = 0; i < HIDReportInfo.TotalDeviceReports; i++)
{
HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
-
+
uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
@@ -211,9 +211,9 @@ void Joystick_HID_Task(void)
break;
case HOST_STATE_Configured:
/* Select and unfreeze joystick data pipe */
- Pipe_SelectPipe(JOYSTICK_DATA_IN_PIPE);
+ Pipe_SelectPipe(JOYSTICK_DATA_IN_PIPE);
Pipe_Unfreeze();
-
+
/* Check to see if a packet has been received */
if (Pipe_IsINReceived())
{
@@ -225,11 +225,11 @@ void Joystick_HID_Task(void)
/* Load in the joystick report */
Pipe_Read_Stream_LE(JoystickReport, Pipe_BytesInPipe());
-
+
/* Process the read in joystick report from the device */
ProcessJoystickReport(JoystickReport);
}
-
+
/* Clear the IN endpoint, ready for next data packet */
Pipe_ClearIN();
}
@@ -254,7 +254,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
{
/* Create a temporary item pointer to the next report item */
HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
-
+
bool FoundData;
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
@@ -262,7 +262,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
{
/* Get the joystick button value */
FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem);
-
+
/* For multi-report devices - if the requested data was not in the issued report, continue */
if (!(FoundData))
continue;
@@ -278,13 +278,13 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
{
/* Get the joystick relative position value */
FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem);
-
+
/* For multi-report devices - if the requested data was not in the issued report, continue */
if (!(FoundData))
continue;
-
+
int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t);
-
+
/* Check to see if a (non-zero) delta movement has been indicated */
if (DeltaMovement)
{
@@ -296,7 +296,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
}
}
}
-
+
/* Display the button information on the board LEDs */
LEDs_SetAllLEDs(LEDMask);
-} \ No newline at end of file
+}
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h
index 5f34dba03..403465fbe 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h
+++ b/Demos/Host/LowLevel/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
@@ -49,7 +49,7 @@
#include <LUFA/Drivers/Peripheral/SerialStream.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
-
+
#include "ConfigDescriptor.h"
#include "HIDReport.h"
@@ -69,7 +69,7 @@
/* Function Prototypes: */
void Joystick_HID_Task(void);
void SetupHardware(void);
-
+
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
void EVENT_USB_Host_DeviceAttached(void);
void EVENT_USB_Host_DeviceUnattached(void);
@@ -80,3 +80,4 @@
void ProcessJoystickReport(uint8_t* JoystickReport);
#endif
+
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.txt b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.txt
index 055890b70..0fa97f868 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.txt
+++ b/Demos/Host/LowLevel/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/LowLevel/JoystickHostWithParser/makefile b/Demos/Host/LowLevel/JoystickHostWithParser/makefile
index 39b13ed36..ec35eeb38 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/makefile
+++ b/Demos/Host/LowLevel/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
@@ -135,7 +135,7 @@ SRC = $(TARGET).c \
# List C++ source files here. (C dependencies are automatically generated.)
-CPPSRC =
+CPPSRC =
# List Assembler source files here.
@@ -148,7 +148,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
@@ -262,7 +262,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
@@ -275,7 +275,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)
@@ -287,7 +287,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)
@@ -299,7 +299,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 =
@@ -322,7 +322,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))
@@ -356,7 +356,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
@@ -390,7 +390,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
@@ -419,7 +419,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:
@@ -438,10 +438,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.
@@ -506,11 +506,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)
@@ -537,9 +537,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)
@@ -637,14 +637,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.
@@ -666,7 +666,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.
@@ -710,3 +710,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
+