Skip to content

Commit

Permalink
Run wspurify script on /trunk/ and /branches/ C source files, to remo…
Browse files Browse the repository at this point in the history
…ve any trailing whitespace at the end of each line.

git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@2007 d5102386-fcda-11dd-9fdb-3debd5008f28
  • Loading branch information
dean committed Dec 23, 2011
1 parent d5f67c6 commit 9b0c63f
Show file tree
Hide file tree
Showing 278 changed files with 1,000 additions and 910 deletions.
4 changes: 2 additions & 2 deletions Bootloaders/CDC/BootloaderAPI.h
Expand Up @@ -40,9 +40,9 @@
#include <avr/io.h>
#include <avr/boot.h>
#include <stdbool.h>

#include <LUFA/Common/Common.h>

/* Function Prototypes: */
void BootloaderAPI_ErasePage(const uint32_t Address);
void BootloaderAPI_WritePage(const uint32_t Address);
Expand Down
8 changes: 4 additions & 4 deletions Bootloaders/CDC/BootloaderCDC.c
Expand Up @@ -104,10 +104,10 @@ void SetupHardware(void)
/* Initialize USB Subsystem */
USB_Init();
LEDs_Init();

/* Bootloader active LED toggle timer initialization */
TIMSK1 = (1 << TOIE1);
TCCR1B = ((1 << CS11) | (1 << CS10));
TCCR1B = ((1 << CS11) | (1 << CS10));
}

/** ISR to periodically toggle the LEDs on the board to indicate that the bootloader is active. */
Expand Down Expand Up @@ -266,7 +266,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
{
LowByte = FetchNextCommandByte();
}

HighByte = !HighByte;
}
else
Expand Down Expand Up @@ -365,7 +365,7 @@ void CDC_Task(void)
if (Command == 'E')
{
RunBootloader = false;

/* Send confirmation byte back to the host */
WriteNextResponseByte('\r');
}
Expand Down
2 changes: 1 addition & 1 deletion Bootloaders/CDC/BootloaderCDC.h
Expand Up @@ -46,7 +46,7 @@
#include <stdbool.h>

#include "Descriptors.h"
#include "BootloaderAPI.h"
#include "BootloaderAPI.h"

#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
Expand Down
4 changes: 2 additions & 2 deletions Bootloaders/CDC/Descriptors.h
Expand Up @@ -115,14 +115,14 @@
typedef struct
{
USB_Descriptor_Configuration_Header_t Config;

// CDC Control Interface
USB_Descriptor_Interface_t CDC_CCI_Interface;
USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;

// CDC Data Interface
USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;
Expand Down
4 changes: 2 additions & 2 deletions Bootloaders/DFU/BootloaderAPI.h
Expand Up @@ -40,9 +40,9 @@
#include <avr/io.h>
#include <avr/boot.h>
#include <stdbool.h>

#include <LUFA/Common/Common.h>

/* Function Prototypes: */
void BootloaderAPI_ErasePage(const uint32_t Address);
void BootloaderAPI_WritePage(const uint32_t Address);
Expand Down
9 changes: 5 additions & 4 deletions Bootloaders/DFU/BootloaderDFU.c
Expand Up @@ -113,10 +113,10 @@ int main(void)

/* If the TCK pin is not jumpered to ground, start the user application instead */
RunBootloader = (!(PINF & (1 << 4)));

/* Re-enable JTAG debugging */
MCUCR &= ~(1 << JTD);
MCUCR &= ~(1 << JTD);
MCUCR &= ~(1 << JTD);
#endif

/* Turn on first LED on the board to indicate that the bootloader has started */
Expand Down Expand Up @@ -153,7 +153,7 @@ void SetupHardware(void)
/* Initialize the USB subsystem */
USB_Init();
LEDs_Init();

/* Bootloader active LED toggle timer initialization */
TIMSK1 = (1 << TOIE1);
TCCR1B = ((1 << CS11) | (1 << CS10));
Expand Down Expand Up @@ -181,7 +181,7 @@ ISR(TIMER1_OVF_vect, ISR_BLOCK)
* internally.
*/
void EVENT_USB_Device_ControlRequest(void)
{
{
/* Ignore any requests that aren't directed to the DFU interface */
if ((USB_ControlRequest.bmRequestType & (CONTROL_REQTYPE_TYPE | CONTROL_REQTYPE_RECIPIENT)) !=
(REQTYPE_CLASS | REQREC_INTERFACE))
Expand Down Expand Up @@ -742,3 +742,4 @@ static void ProcessReadCommand(void)
else if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x01)) // Read signature byte
ResponseByte = SignatureInfo[DataIndexToRead - 0x30];
}

8 changes: 4 additions & 4 deletions Bootloaders/DFU/Descriptors.c
Expand Up @@ -159,11 +159,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
Address = &DeviceDescriptor;
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = &ConfigurationDescriptor;
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
if (!(DescriptorNumber))
{
Address = &LanguageString;
Expand All @@ -174,10 +174,10 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
Address = &ProductString;
Size = ProductString.Header.Size;
}

break;
}

*DescriptorAddress = Address;
return Size;
}
Expand Down
2 changes: 1 addition & 1 deletion Bootloaders/DFU/Descriptors.h
Expand Up @@ -161,7 +161,7 @@
typedef struct
{
USB_Descriptor_Configuration_Header_t Config;

// DFU Interface
USB_Descriptor_Interface_t DFU_Interface;
USB_Descriptor_DFU_Functional_t DFU_Functional;
Expand Down
29 changes: 15 additions & 14 deletions Bootloaders/HID/BootloaderHID.c
Expand Up @@ -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
Expand All @@ -32,7 +32,7 @@
*
* Main source file for the HID class bootloader. This file contains the complete bootloader logic.
*/

#include "BootloaderHID.h"

/** Flag to indicate if the bootloader should be running, or should exit and allow the application code to run
Expand All @@ -41,20 +41,20 @@
*/
static bool RunBootloader = true;

/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously
/** Main program entry point. This routine configures the hardware required by the bootloader, then continuously
* runs the bootloader processing routine until instructed to soft-exit.
*/
int main(void)
{
/* Setup hardware required for the bootloader */
SetupHardware();

/* Enable global interrupts so that the USB stack can function */
sei();

while (RunBootloader)
USB_USBTask();

/* Disconnect from the host - USB interface will be reset later along with the AVR */
USB_Detach();

Expand Down Expand Up @@ -108,17 +108,17 @@ void EVENT_USB_Device_ControlRequest(void)
{
case HID_REQ_SetReport:
Endpoint_ClearSETUP();

/* Wait until the command has been sent by the host */
while (!(Endpoint_IsOUTReceived()));

/* Read in the write destination address */
#if (FLASHEND > 0xFFFF)
uint32_t PageAddress = ((uint32_t)Endpoint_Read_16_LE() << 8);
#else
uint16_t PageAddress = Endpoint_Read_16_LE();
#endif

/* Check if the command is a program page command, or a start application command */
#if (FLASHEND > 0xFFFF)
if ((uint16_t)(PageAddress >> 8) == COMMAND_STARTAPPLICATION)
Expand All @@ -133,9 +133,9 @@ void EVENT_USB_Device_ControlRequest(void)
/* Erase the given FLASH page, ready to be programmed */
boot_page_erase(PageAddress);
boot_spm_busy_wait();

/* Write each of the FLASH page's bytes in sequence */
for (uint8_t PageWord = 0; PageWord < (SPM_PAGESIZE / 2); PageWord++)
for (uint8_t PageWord = 0; PageWord < (SPM_PAGESIZE / 2); PageWord++)
{
/* Check if endpoint is empty - if so clear it and wait until ready for next packet */
if (!(Endpoint_BytesInEndpoint()))
Expand All @@ -162,3 +162,4 @@ void EVENT_USB_Device_ControlRequest(void)
break;
}
}

23 changes: 12 additions & 11 deletions Bootloaders/HID/BootloaderHID.h
Expand Up @@ -8,14 +8,14 @@

/*
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
Expand All @@ -32,7 +32,7 @@
*
* Header file for TeensyHID.c.
*/

#ifndef _TEENSYHID_H_
#define _TEENSYHID_H_
Expand All @@ -47,15 +47,16 @@
#include "Descriptors.h"

#include <LUFA/Drivers/USB/USB.h>
/* Macros: */

/* Macros: */
/** Bootloader special address to start the user application */
#define COMMAND_STARTAPPLICATION 0xFFFF

/* Function Prototypes: */
void SetupHardware(void);

void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void);

#endif

0 comments on commit 9b0c63f

Please sign in to comment.