Run wspurify script on /trunk/ and /branches/ C source files, to remove any trailing whitespace at the end of each line.
This commit is contained in:
parent
77f354609f
commit
f201f6697b
278 changed files with 1000 additions and 910 deletions
|
|
@ -54,7 +54,7 @@
|
|||
#include "../StdDescriptors.h"
|
||||
#include "../USBInterrupt.h"
|
||||
#include "../Endpoint.h"
|
||||
|
||||
|
||||
/* Enable C linkage for C++ Compilers: */
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
*/
|
||||
#define USB_DEVICE_OPT_FULLSPEED (0 << 0)
|
||||
//@}
|
||||
|
||||
|
||||
#if (!defined(NO_INTERNAL_SERIAL) || defined(__DOXYGEN__))
|
||||
/** String descriptor index for the device's unique serial number string descriptor within the device.
|
||||
* This unique serial number is used by the host to associate resources to the device (such as drivers or COM port
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
* model.
|
||||
*/
|
||||
#define INTERNAL_SERIAL_LENGTH_BITS (8 * (1 + (offsetof(NVM_PROD_SIGNATURES_t, COORDY1) - offsetof(NVM_PROD_SIGNATURES_t, LOTNUM0))))
|
||||
|
||||
|
||||
/** Start address of the internal serial number, in the appropriate address space, if present on the selected microcontroller
|
||||
* model.
|
||||
*/
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
#define INTERNAL_SERIAL_LENGTH_BITS 0
|
||||
#define INTERNAL_SERIAL_START_ADDRESS 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Function Prototypes: */
|
||||
/** Sends a Remote Wakeup request to the host. This signals to the host that the device should
|
||||
* be taken out of suspended mode, and communications should resume.
|
||||
|
|
@ -211,17 +211,17 @@
|
|||
{
|
||||
return ((USB.ADDR != 0) ? true : false);
|
||||
}
|
||||
|
||||
|
||||
static inline void USB_Device_GetSerialString(uint16_t* const UnicodeString) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void USB_Device_GetSerialString(uint16_t* const UnicodeString)
|
||||
{
|
||||
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
|
||||
GlobalInterruptDisable();
|
||||
|
||||
|
||||
uint8_t SigReadAddress = INTERNAL_SERIAL_START_ADDRESS;
|
||||
|
||||
for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++)
|
||||
{
|
||||
{
|
||||
uint8_t SerialByte;
|
||||
|
||||
NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc;
|
||||
|
|
@ -239,7 +239,7 @@
|
|||
UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ?
|
||||
(('A' - 10) + SerialByte) : ('0' + SerialByte));
|
||||
}
|
||||
|
||||
|
||||
SetGlobalInterruptMask(CurrentGlobalInt);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -268,3 +268,4 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -51,13 +51,13 @@ bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Number,
|
|||
const uint8_t Size)
|
||||
{
|
||||
Endpoint_SelectEndpoint(Number | Direction);
|
||||
|
||||
|
||||
USB_Endpoint_SelectedHandle->CTRL = 0;
|
||||
USB_Endpoint_SelectedHandle->STATUS = (Direction == ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0;
|
||||
USB_Endpoint_SelectedHandle->CTRL = Config;
|
||||
USB_Endpoint_SelectedHandle->CNT = 0;
|
||||
USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data;
|
||||
|
||||
|
||||
USB_Endpoint_SelectedFIFO->Length = (Direction == ENDPOINT_DIR_IN) ? Size : 0;
|
||||
USB_Endpoint_SelectedFIFO->Position = 0;
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ 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)
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@
|
|||
uint8_t Length;
|
||||
uint8_t Position;
|
||||
} Endpoint_FIFO_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Endpoint_FIFO_t OUT;
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
#endif
|
||||
|
||||
/* Public Interface - May be used in end-application: */
|
||||
/* Macros: */
|
||||
/* Macros: */
|
||||
/** \name Endpoint Bank Mode Masks */
|
||||
//@{
|
||||
/** Mask for the bank mode selection for the \ref Endpoint_ConfigureEndpoint() macro. This indicates
|
||||
|
|
@ -234,7 +234,7 @@
|
|||
static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber)
|
||||
{
|
||||
USB_Endpoint_SelectedEndpoint = EndpointNumber;
|
||||
|
||||
|
||||
if (EndpointNumber & ENDPOINT_DIR_IN)
|
||||
{
|
||||
USB_Endpoint_SelectedFIFO = &USB_Endpoint_FIFOs[EndpointNumber & ENDPOINT_EPNUM_MASK].IN;
|
||||
|
|
@ -290,7 +290,7 @@
|
|||
const uint8_t Banks)
|
||||
{
|
||||
uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | Banks | Endpoint_BytesToEPSizeMask(Size));
|
||||
|
||||
|
||||
// TODO - Fix once limitations are lifted
|
||||
if ((Banks != ENDPOINT_BANK_SINGLE) || (Size > 64))
|
||||
return false;
|
||||
|
|
@ -307,10 +307,10 @@
|
|||
EPConfigMask |= USB_EP_TYPE_BULK_gc;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (Type == EP_TYPE_CONTROL)
|
||||
Endpoint_ConfigureEndpoint_PRV(Number, (Direction ^ ENDPOINT_DIR_IN), EPConfigMask, Size);
|
||||
|
||||
|
||||
return Endpoint_ConfigureEndpoint_PRV(Number, Direction, EPConfigMask, Size);
|
||||
}
|
||||
|
||||
|
|
@ -439,7 +439,7 @@
|
|||
static inline bool Endpoint_IsINReady(void)
|
||||
{
|
||||
Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN);
|
||||
|
||||
|
||||
return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false);
|
||||
}
|
||||
|
||||
|
|
@ -459,7 +459,7 @@
|
|||
USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -479,7 +479,7 @@
|
|||
USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -523,7 +523,7 @@
|
|||
*/
|
||||
static inline void Endpoint_ClearOUT(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_ClearOUT(void)
|
||||
{
|
||||
{
|
||||
USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm);
|
||||
USB_Endpoint_SelectedFIFO->Position = 0;
|
||||
}
|
||||
|
|
@ -543,7 +543,7 @@
|
|||
static inline void Endpoint_StallTransaction(void)
|
||||
{
|
||||
USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm;
|
||||
|
||||
|
||||
if ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_TYPE_gm) == USB_EP_TYPE_CONTROL_gc)
|
||||
{
|
||||
Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint ^ ENDPOINT_DIR_IN);
|
||||
|
|
@ -636,7 +636,7 @@
|
|||
{
|
||||
uint16_t Byte0 = Endpoint_Read_8();
|
||||
uint16_t Byte1 = Endpoint_Read_8();
|
||||
|
||||
|
||||
return ((Byte1 << 8) | Byte0);
|
||||
}
|
||||
|
||||
|
|
@ -652,7 +652,7 @@
|
|||
{
|
||||
uint16_t Byte0 = Endpoint_Read_8();
|
||||
uint16_t Byte1 = Endpoint_Read_8();
|
||||
|
||||
|
||||
return ((Byte0 << 8) | Byte1);
|
||||
}
|
||||
|
||||
|
|
@ -709,7 +709,7 @@
|
|||
uint32_t Byte1 = Endpoint_Read_8();
|
||||
uint32_t Byte2 = Endpoint_Read_8();
|
||||
uint32_t Byte3 = Endpoint_Read_8();
|
||||
|
||||
|
||||
return ((Byte3 << 24) | (Byte2 << 16) | (Byte1 << 8) | Byte0);
|
||||
}
|
||||
|
||||
|
|
@ -727,7 +727,7 @@
|
|||
uint32_t Byte1 = Endpoint_Read_8();
|
||||
uint32_t Byte2 = Endpoint_Read_8();
|
||||
uint32_t Byte3 = Endpoint_Read_8();
|
||||
|
||||
|
||||
return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2011.
|
||||
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.lufa-lib.org
|
||||
*/
|
||||
|
|
@ -9,13 +9,13 @@
|
|||
/*
|
||||
Copyright 2011 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
|
||||
|
|
|
|||
|
|
@ -81,3 +81,4 @@ uint8_t TEMPLATE_FUNC_NAME (void* const Buffer,
|
|||
#undef TEMPLATE_TRANSFER_BYTE
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -90,3 +90,4 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer,
|
|||
#undef TEMPLATE_TRANSFER_BYTE
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -86,3 +86,4 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer,
|
|||
#undef TEMPLATE_BUFFER_MOVE
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -61,9 +61,9 @@ void USB_Init(
|
|||
#if !defined(USE_STATIC_OPTIONS)
|
||||
USB_Options = Options;
|
||||
#endif
|
||||
|
||||
|
||||
USB_IsInitialized = true;
|
||||
|
||||
|
||||
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
|
||||
GlobalInterruptDisable();
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ void USB_Init(
|
|||
USB.CAL0 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL0));
|
||||
USB.CAL1 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL1));
|
||||
NVM.CMD = 0;
|
||||
|
||||
|
||||
USB.EPPTR = (intptr_t)&USB_EndpointTable;
|
||||
USB.CTRLA = (USB_STFRNUM_bm | USB_MAXEP_gm);
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ void USB_Disable(void)
|
|||
USB_Detach();
|
||||
USB_Controller_Disable();
|
||||
|
||||
USB_IsInitialized = false;
|
||||
USB_IsInitialized = false;
|
||||
}
|
||||
|
||||
void USB_ResetInterface(void)
|
||||
|
|
@ -104,14 +104,14 @@ void USB_ResetInterface(void)
|
|||
CLK.USBCTRL = (((F_USB / 6000000) - 1) << CLK_USBPSDIV_gp);
|
||||
else
|
||||
CLK.USBCTRL = (((F_USB / 48000000) - 1) << CLK_USBPSDIV_gp);
|
||||
|
||||
|
||||
if (USB_Options & USB_OPT_PLLCLKSRC)
|
||||
CLK.USBCTRL |= (CLK_USBSRC_PLL_gc | CLK_USBSEN_bm);
|
||||
else
|
||||
CLK.USBCTRL |= (CLK_USBSRC_RC32M_gc | CLK_USBSEN_bm);
|
||||
|
||||
USB_Device_SetDeviceAddress(0);
|
||||
|
||||
|
||||
USB_INT_DisableAllInterrupts();
|
||||
USB_INT_ClearAllInterrupts();
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ static void USB_Init_Device(void)
|
|||
|
||||
#if !defined(FIXED_CONTROL_ENDPOINT_SIZE)
|
||||
USB_Descriptor_Device_t* DeviceDescriptorPtr;
|
||||
|
||||
|
||||
#if defined(ARCH_HAS_MULTI_ADDRESS_SPACE) && \
|
||||
!(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))
|
||||
uint8_t DescriptorAddressSpace;
|
||||
|
|
@ -159,7 +159,7 @@ static void USB_Init_Device(void)
|
|||
#else
|
||||
USB_Device_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -177,3 +177,4 @@ static void USB_Init_Device(void)
|
|||
USB_Attach();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -67,12 +67,12 @@
|
|||
} Endpoints[16];
|
||||
uint16_t FrameNum;
|
||||
} ATTR_PACKED USB_EndpointTable_t;
|
||||
|
||||
|
||||
/* External Variables: */
|
||||
extern USB_EndpointTable_t USB_EndpointTable;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Includes: */
|
||||
#if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
|
||||
#include "../Device.h"
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
#if !defined(F_USB)
|
||||
#error F_USB is not defined. You must define F_USB to the frequency of the unprescaled USB controller clock in your project makefile.
|
||||
#endif
|
||||
|
||||
|
||||
#if (F_USB % 6000000)
|
||||
#error Invalid F_USB specified. F_USB must be a multiple of 6MHz for USB Low Speed operation, and a multiple of 48MHz for Full Speed operation.
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ ISR(USB_BUSEVENT_vect)
|
|||
if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Resume))
|
||||
{
|
||||
USB_INT_Clear(USB_INT_BUSEVENTI_Resume);
|
||||
|
||||
|
||||
if (USB_Device_ConfigurationNumber)
|
||||
USB_DeviceState = DEVICE_STATE_Configured;
|
||||
else
|
||||
|
|
@ -86,7 +86,7 @@ ISR(USB_BUSEVENT_vect)
|
|||
if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Reset))
|
||||
{
|
||||
USB_INT_Clear(USB_INT_BUSEVENTI_Reset);
|
||||
|
||||
|
||||
USB_DeviceState = DEVICE_STATE_Default;
|
||||
USB_Device_ConfigurationNumber = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@
|
|||
USB.INTCTRLA |= USB_BUSEVIE_bm;
|
||||
return;
|
||||
case USB_INT_SOFI:
|
||||
USB.INTCTRLA |= USB_SOFIE_bm;
|
||||
return;
|
||||
USB.INTCTRLA |= USB_SOFIE_bm;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -90,11 +90,11 @@
|
|||
USB.INTCTRLA &= ~USB_BUSEVIE_bm;
|
||||
return;
|
||||
case USB_INT_SOFI:
|
||||
USB.INTCTRLA &= ~USB_SOFIE_bm;
|
||||
return;
|
||||
USB.INTCTRLA &= ~USB_SOFIE_bm;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline void USB_INT_Clear(const uint8_t Interrupt) ATTR_ALWAYS_INLINE;
|
||||
static inline void USB_INT_Clear(const uint8_t Interrupt)
|
||||
{
|
||||
|
|
@ -110,11 +110,11 @@
|
|||
USB.INTFLAGSACLR = USB_RSTIF_bm;
|
||||
return;
|
||||
case USB_INT_SOFI:
|
||||
USB.INTFLAGSACLR = USB_SOFIF_bm;
|
||||
return;
|
||||
USB.INTFLAGSACLR = USB_SOFIF_bm;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline bool USB_INT_IsEnabled(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline bool USB_INT_IsEnabled(const uint8_t Interrupt)
|
||||
{
|
||||
|
|
@ -125,10 +125,10 @@
|
|||
case USB_INT_SOFI:
|
||||
return ((USB.INTCTRLA & USB_SOFIE_bm) ? true : false);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt)
|
||||
{
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
case USB_INT_SOFI:
|
||||
return ((USB.INTFLAGSACLR & USB_SOFIF_bm) ? true : false);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue