[gnoduino] arduino: remove trailing whitespace for hardware



commit c2a58980deb48404455671b402cf390c547fe66f
Author: Pascal de Bruijn <pmjdebruijn pcode nl>
Date:   Thu Jul 17 18:48:31 2014 +0200

    arduino: remove trailing whitespace for hardware

 hardware/arduino/bootloaders/atmega8/ATmegaBOOT.c  |   80 ++--
 .../arduino/bootloaders/atmega8/ATmegaBOOT.txt     |    2 +-
 hardware/arduino/bootloaders/bt/ATmegaBOOT_168.c   |   80 ++--
 .../arduino/bootloaders/lilypad/src/ATmegaBOOT.c   |   56 ++--
 hardware/arduino/bootloaders/optiboot/boot.h       |   38 +-
 hardware/arduino/bootloaders/optiboot/optiboot.c   |    6 +-
 hardware/arduino/bootloaders/optiboot/pin_defs.h   |    8 +-
 hardware/arduino/bootloaders/stk500v2/License.txt  |    8 +-
 .../bootloaders/stk500v2/avrinterruptnames.h       |   22 +-
 hardware/arduino/bootloaders/stk500v2/command.h    |    2 +-
 hardware/arduino/bootloaders/stk500v2/stk500boot.c |   26 +-
 hardware/arduino/cores/arduino/Arduino.h           |    6 +-
 hardware/arduino/cores/arduino/CDC.cpp             |   40 +-
 hardware/arduino/cores/arduino/HID.cpp             |  104 +++---
 hardware/arduino/cores/arduino/HardwareSerial.cpp  |   36 +-
 hardware/arduino/cores/arduino/HardwareSerial.h    |    2 +-
 hardware/arduino/cores/arduino/Print.cpp           |   26 +-
 hardware/arduino/cores/arduino/Print.h             |    6 +-
 hardware/arduino/cores/arduino/Stream.cpp          |    8 +-
 hardware/arduino/cores/arduino/Tone.cpp            |   20 +-
 hardware/arduino/cores/arduino/USBAPI.h            |    2 +-
 hardware/arduino/cores/arduino/USBCore.cpp         |   52 ++--
 hardware/arduino/cores/arduino/USBCore.h           |   44 +-
 hardware/arduino/cores/arduino/USBDesc.h           |   28 +-
 hardware/arduino/cores/arduino/Udp.h               |    8 +-
 hardware/arduino/cores/arduino/WCharacter.h        |   28 +-
 hardware/arduino/cores/arduino/WInterrupts.c       |   24 +-
 hardware/arduino/cores/arduino/WMath.cpp           |    4 +-
 hardware/arduino/cores/arduino/WString.cpp         |   12 +-
 hardware/arduino/cores/arduino/WString.h           |   10 +-
 hardware/arduino/cores/arduino/avr-libc/malloc.c   |    6 +-
 hardware/arduino/cores/arduino/main.cpp            |    6 +-
 hardware/arduino/cores/arduino/new.cpp             |    2 +-
 hardware/arduino/cores/arduino/new.h               |    4 +-
 hardware/arduino/cores/arduino/wiring.c            |   16 +-
 hardware/arduino/cores/arduino/wiring_analog.c     |   10 +-
 hardware/arduino/cores/arduino/wiring_digital.c    |   18 +-
 hardware/arduino/cores/arduino/wiring_pulse.c      |   10 +-
 hardware/arduino/cores/arduino/wiring_shift.c      |    6 +-
 hardware/arduino/firmwares/atmegaxxu2/README.txt   |    2 +-
 .../firmwares/atmegaxxu2/arduino-usbdfu/readme.txt |    2 +-
 hardware/arduino/variants/leonardo/pins_arduino.h  |   40 +-
 hardware/arduino/variants/mega/pins_arduino.h      |  432 ++++++++++----------
 hardware/arduino/variants/standard/pins_arduino.h  |    2 +-
 44 files changed, 672 insertions(+), 672 deletions(-)
---
diff --git a/hardware/arduino/bootloaders/atmega8/ATmegaBOOT.c 
b/hardware/arduino/bootloaders/atmega8/ATmegaBOOT.c
index 8c8d22a..ee0f4a2 100644
--- a/hardware/arduino/bootloaders/atmega8/ATmegaBOOT.c
+++ b/hardware/arduino/bootloaders/atmega8/ATmegaBOOT.c
@@ -170,7 +170,7 @@ int main(void)
                outb(LED_PORT, inb(LED_PORT) ^ _BV(LED));
                _delay_loop_2(0);
        }
-       
+
        //for (l=0; l<40000000; l++)
                //outb(LED_PORT, inb(LED_PORT) ^= _BV(LED));
 
@@ -190,14 +190,14 @@ int main(void)
     //if((inb(UCSRA) & _BV(RXC))){
     /* get character from UART */
                ch = getch();
-               
+
                /* A bunch of if...else if... gives smaller code than switch...case ! */
-       
-               /* Hello is anyone home ? */ 
+
+               /* Hello is anyone home ? */
                if(ch=='0') {
                  nothing_response();
                }
-       
+
                /* Request programmer ID */
                /* Not using PROGMEM string due to boot block in m128 being beyond 64kB boundry  */
                /* Would need to selectively manipulate RAMPZ, and it's only 9 characters anyway so who 
cares.  */
@@ -214,14 +214,14 @@ int main(void)
                                putch(0x10);
                  }
                }
-       
+
                /* AVR ISP/STK500 board commands  DON'T CARE so default nothing_response */
                else if(ch=='@') {
                  ch2 = getch();
                  if (ch2>0x85) getch();
                  nothing_response();
                }
-       
+
                /* AVR ISP/STK500 board requests */
                else if(ch=='A') {
                  ch2 = getch();
@@ -231,41 +231,41 @@ int main(void)
                  //else if(ch2==0x98) byte_response(0x03);             // Unknown but seems to be required 
by avr studio 3.56
                  else byte_response(0x00);                             // Covers various unnecessary 
responses we don't care about
                }
-       
+
                /* Device Parameters  DON'T CARE, DEVICE IS FIXED  */
                else if(ch=='B') {
                  getNch(20);
                  nothing_response();
                }
-       
+
                /* Parallel programming stuff  DON'T CARE  */
                else if(ch=='E') {
                  getNch(5);
                  nothing_response();
                }
-       
+
                /* Enter programming mode  */
                else if(ch=='P') {
                  nothing_response();
                  // FIXME: modified only here by DojoCorp, Mumbai, India, 20050626
                  //time_count=0; // exted the delay once entered prog.mode
                }
-       
+
                /* Leave programming mode  */
                else if(ch=='Q') {
                  nothing_response();
-                 //time_count=MAX_TIME_COUNT_MORATORY;         // once the programming is done, 
+                 //time_count=MAX_TIME_COUNT_MORATORY;         // once the programming is done,
                                                                                                // we should 
start the application
                                                                                                // but uisp 
has problems with this,
                                                                                                // therefore 
we just change the times
                                                                                                // and give 
the programmer 1 sec to react
                }
-       
+
                /* Erase device, don't care as we will erase one page at a time anyway.  */
                else if(ch=='R') {
                  nothing_response();
                }
-       
+
                /* Set address, little endian. EEPROM in bytes, FLASH in words  */
                /* Perhaps extra address bytes may be added in future to support > 128kB FLASH.  */
                /* This might explain why little endian was used here, big endian used everywhere else.  */
@@ -274,13 +274,13 @@ int main(void)
                  address.byte[1] = getch();
                  nothing_response();
                }
-       
+
                /* Universal SPI programming command, disabled.  Would be used for fuses and lock bits.  */
                else if(ch=='V') {
                  getNch(4);
                  byte_response(0x00);
                }
-       
+
                /* Write memory, length is big endian and is in bytes  */
                else if(ch=='d') {
                  length.byte[1] = getch();
@@ -295,11 +295,11 @@ int main(void)
                                        for(w=0;w<length.word;w++) {
                                                eeprom_wb(address.word,buff[w]);
                                                address.word++;
-                                       }                       
+                                       }
                                } else {                                                //Write to FLASH one 
page at a time
                                        //if (address.byte[1]>127) address_high = 0x01; //Only possible with 
m128, m256 will need 3rd address byte. FIXME
                                        //else address_high = 0x00;
-                       
+
                                        //address.word = address.word << 1;             //address * 2 -> byte 
location
                                        //if ((length.byte[0] & 0x01)) length.word++;   //Even up an odd 
number of bytes
                                        cli();                                  //Disable interrupts, just to 
be sure
@@ -309,7 +309,7 @@ int main(void)
                                                         "lds   r30,address     \n\t"   //Address of FLASH 
location (in words)
                                                         "lds   r31,address+1   \n\t"
                                                         "lsl r30                               \n\t"  
//address * 2 -> byte location
-                                                        "rol r31                               \n\t" 
+                                                        "rol r31                               \n\t"
                                                         "ldi   r28,lo8(buff)   \n\t"   //Start of buffer 
array in RAM
                                                         "ldi   r29,hi8(buff)   \n\t"
                                                         "lds   r24,length      \n\t"   //Length of data to 
be written (in bytes)
@@ -317,9 +317,9 @@ int main(void)
                                                         "sbrs r24,0            \n\t"  //Even up an odd 
number of bytes
                                                         "rjmp length_loop              \n\t"
                                                         "adiw r24,1            \n\t"
-                                                        "length_loop:          \n\t"   //Main loop, repeat 
for number of words in block                                                                                  
                               
+                                                        "length_loop:          \n\t"   //Main loop, repeat 
for number of words in block
                                                         "cpi   r17,0x00        \n\t"   //If 
page_word_count=0 then erase page
-                                                        "brne  no_page_erase   \n\t"                         
                   
+                                                        "brne  no_page_erase   \n\t"
                                                         "rcall  wait_spm               \n\t"
 //                                                      "wait_spm1:            \n\t"
 //                                                      "lds   r16,%0          \n\t"   //Wait for previous 
spm to complete
@@ -328,20 +328,20 @@ int main(void)
 //                                                      "breq  wait_spm1       \n\t"
                                                         "ldi   r16,0x03        \n\t"   //Erase page pointed 
to by Z
                                                         "sts   %0,r16          \n\t"
-                                                        "spm                   \n\t"                         
                           
+                                                        "spm                   \n\t"
                                                         "rcall  wait_spm               \n\t"
 //                                                      "wait_spm2:            \n\t"
 //                                                      "lds   r16,%0          \n\t"   //Wait for previous 
spm to complete
 //                                                      "andi  r16,1           \n\t"
 //                                                      "cpi   r16,1           \n\t"
-//                                                      "breq  wait_spm2       \n\t"                         
                                           
+//                                                      "breq  wait_spm2       \n\t"
                                                         "ldi   r16,0x11        \n\t"   //Re-enable RWW 
section
-                                                        "sts   %0,r16          \n\t"                         
                                           
+                                                        "sts   %0,r16          \n\t"
                                                         "spm                   \n\t"
-                                                        "no_page_erase:                \n\t"                 
                                   
+                                                        "no_page_erase:                \n\t"
                                                         "ld    r0,Y+           \n\t"   //Write 2 bytes into 
page buffer
-                                                        "ld    r1,Y+           \n\t"                         
                           
-                                                                                
+                                                        "ld    r1,Y+           \n\t"
+
                                                         "rcall  wait_spm               \n\t"
 //                                                      "wait_spm3:            \n\t"
 //                                                      "lds   r16,%0          \n\t"   //Wait for previous 
spm to complete
@@ -351,7 +351,7 @@ int main(void)
                                                         "ldi   r16,0x01        \n\t"   //Load r0,r1 into 
FLASH page buffer
                                                         "sts   %0,r16          \n\t"
                                                         "spm                   \n\t"
-                                                                                
+
                                                         "inc   r17             \n\t"   //page_word_count++
                                                         "cpi r17,%1            \n\t"
                                                         "brlo  same_page       \n\t"   //Still same page in 
FLASH
@@ -371,23 +371,23 @@ int main(void)
 //                                                      "lds   r16,%0          \n\t"   //Wait for previous 
spm to complete
 //                                                      "andi  r16,1           \n\t"
 //                                                      "cpi   r16,1           \n\t"
-//                                                      "breq  wait_spm5       \n\t"                         
                                           
+//                                                      "breq  wait_spm5       \n\t"
                                                         "ldi   r16,0x11        \n\t"   //Re-enable RWW 
section
-                                                        "sts   %0,r16          \n\t"                         
                                           
-                                                        "spm                   \n\t"                         
                           
-                                                        "same_page:            \n\t"                         
                           
+                                                        "sts   %0,r16          \n\t"
+                                                        "spm                   \n\t"
+                                                        "same_page:            \n\t"
                                                         "adiw  r30,2           \n\t"   //Next word in FLASH
                                                         "sbiw  r24,2           \n\t"   //length-2
                                                         "breq  final_write     \n\t"   //Finished
                                                         "rjmp  length_loop     \n\t"
-                                                        
+
                                                         "wait_spm:  \n\t"
                                                         "lds   r16,%0          \n\t"   //Wait for previous 
spm to complete
                                                         "andi  r16,1           \n\t"
                                                         "cpi   r16,1           \n\t"
                                                         "breq  wait_spm       \n\t"
                                                         "ret                   \n\t"
-                                                        
+
                                                         "final_write:          \n\t"
                                                         "cpi   r17,0           \n\t"
                                                         "breq  block_done      \n\t"
@@ -396,15 +396,15 @@ int main(void)
                                                         "block_done:           \n\t"
                                                         "clr   __zero_reg__    \n\t"   //restore zero 
register
                                                         : "=m" (SPMCR) : "M" (PAGE_SIZE) : 
"r0","r16","r17","r24","r25","r28","r29","r30","r31");
-                       
+
                                        /* Should really add a wait for RWW section to be enabled, don't 
actually need it since we never */
                                        /* exit the bootloader without a power cycle anyhow */
                                }
                                putch(0x14);
                                putch(0x10);
-                       }               
+                       }
                }
-       
+
                /* Read memory block mode, length is big endian.  */
                else if(ch=='t') {
                  length.byte[1] = getch();
@@ -420,7 +420,7 @@ int main(void)
                                        if (flags.eeprom) {                             // Byte access EEPROM 
read
                                                putch(eeprom_rb(address.word));
                                                address.word++;
-                                       } else {        
+                                       } else {
                                                if (!flags.rampz) putch(pgm_read_byte_near(address.word));
                                                address.word++;
                                        }
@@ -428,7 +428,7 @@ int main(void)
                                putch(0x10);
                  }
                }
-       
+
                /* Get device signature bytes  */
                else if(ch=='u') {
                  if (getch() == ' ') {
@@ -439,7 +439,7 @@ int main(void)
                                putch(0x10);
                  }
                }
-       
+
                /* Read oscillator calibration byte */
                else if(ch=='v') {
                  byte_response(0x00);
diff --git a/hardware/arduino/bootloaders/atmega8/ATmegaBOOT.txt 
b/hardware/arduino/bootloaders/atmega8/ATmegaBOOT.txt
index b0e19b3..a017a99 100644
--- a/hardware/arduino/bootloaders/atmega8/ATmegaBOOT.txt
+++ b/hardware/arduino/bootloaders/atmega8/ATmegaBOOT.txt
@@ -1,4 +1,4 @@
 Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr/lib --infodir=/usr/share/info 
--mandir=/usr/share/man --bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib --enable-shared 
--with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking 
--disable-libssp --build=i686-linux-gnu --host=i686-linux-gnu --target=avr
 Thread model: single
-gcc version 4.3.5 (GCC) 
+gcc version 4.3.5 (GCC)
 
diff --git a/hardware/arduino/bootloaders/bt/ATmegaBOOT_168.c 
b/hardware/arduino/bootloaders/bt/ATmegaBOOT_168.c
index c73eefa..680ca35 100644
--- a/hardware/arduino/bootloaders/bt/ATmegaBOOT_168.c
+++ b/hardware/arduino/bootloaders/bt/ATmegaBOOT_168.c
@@ -64,7 +64,7 @@
 #include <avr/io.h>
 #include <avr/pgmspace.h>
 #include <avr/interrupt.h>
-#include <avr/wdt.h>               
+#include <avr/wdt.h>
 
 
 #define set_output(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
@@ -88,7 +88,7 @@
 
 #define F_CPU     16000000L
 
-#include <util/delay.h> 
+#include <util/delay.h>
 
 
 /* 20060803: hacked by DojoCorp */
@@ -306,7 +306,7 @@ int main(void)
 #endif
     }
 
-#ifdef __AVR_ATmega128__    
+#ifdef __AVR_ATmega128__
     /* no bootuart was selected, default to uart 0 */
     if(!bootuart) {
       bootuart = 1;
@@ -334,7 +334,7 @@ int main(void)
     UBRR = (uint8_t)(F_CPU/(BAUD_RATE*16L)-1);
     UBRRHI = (F_CPU/(BAUD_RATE*16L)-1) >> 8;
     UCSRA = 0x00;
-    UCSRB = _BV(TXEN)|_BV(RXEN);       
+    UCSRB = _BV(TXEN)|_BV(RXEN);
 #elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
 
        UBRR0H = ((F_CPU / 16 + BAUD_RATE / 2) / BAUD_RATE - 1) >> 8;
@@ -362,17 +362,17 @@ int main(void)
 
     /* set LED pin as output */
     LED_DDR |= _BV(LED);
-              
 
-     
+
+
       set_output(DDRD,PIND7);
-         high(PORTD,PD7);    
+         high(PORTD,PD7);
          for (i = 0; i < 16; i++) {
-                
+
                        _delay_loop_2(0);
          }
-       
-       
+
+
          low(PORTD,PD7);
 
 
@@ -383,13 +383,13 @@ int main(void)
 #else
     flash_led(3);
 #endif
-    
+
     /* 20050803: by DojoCorp, this is one of the parts provoking the
                  system to stop listening, cancelled from the original */
     //putch('\0');
-        
 
-   //message("SET BT PAGEMODE 3 2000 1");    
+
+   //message("SET BT PAGEMODE 3 2000 1");
 putch('S');
 putch('E');
 putch('T');
@@ -416,8 +416,8 @@ putch(' ');
 putch('1');
 putch(0x0D);
 
-  
-         //put_s("SET BT ROLE 0 f 7d00");  
+
+         //put_s("SET BT ROLE 0 f 7d00");
        putch('S');
        putch('E');
        putch('T');
@@ -453,7 +453,7 @@ putch(0x0D);
 
        /* A bunch of if...else if... gives smaller code than switch...case ! */
 
-       /* Hello is anyone home ? */ 
+       /* Hello is anyone home ? */
        if(ch=='0') {
            nothing_response();
        }
@@ -567,7 +567,7 @@ putch(0x0D);
                        eeprom_write_byte((void *)address.word,buff[w]);
 #endif
                        address.word++;
-                   }                   
+                   }
                }
                else {                                          //Write to FLASH one page at a time
                    if (address.byte[1]>127) address_high = 0x01;       //Only possible with m128, m256 will 
need 3rd address byte. FIXME
@@ -589,9 +589,9 @@ putch(0x0D);
                                 "ldi   r29,hi8(buff)   \n\t"
                                 "lds   r24,length      \n\t"   //Length of data to be written (in bytes)
                                 "lds   r25,length+1    \n\t"
-                                "length_loop:          \n\t"   //Main loop, repeat for number of words in 
block                                                                                                         
        
+                                "length_loop:          \n\t"   //Main loop, repeat for number of words in 
block
                                 "cpi   r17,0x00        \n\t"   //If page_word_count=0 then erase page
-                                "brne  no_page_erase   \n\t"                                            
+                                "brne  no_page_erase   \n\t"
                                 "wait_spm1:            \n\t"
                                 "lds   r16,%0          \n\t"   //Wait for previous spm to complete
                                 "andi  r16,1           \n\t"
@@ -599,7 +599,7 @@ putch(0x0D);
                                 "breq  wait_spm1       \n\t"
                                 "ldi   r16,0x03        \n\t"   //Erase page pointed to by Z
                                 "sts   %0,r16          \n\t"
-                                "spm                   \n\t"                                                 
   
+                                "spm                   \n\t"
 #ifdef __AVR_ATmega163__
                                 ".word 0xFFFF          \n\t"
                                 "nop                   \n\t"
@@ -608,19 +608,19 @@ putch(0x0D);
                                 "lds   r16,%0          \n\t"   //Wait for previous spm to complete
                                 "andi  r16,1           \n\t"
                                 "cpi   r16,1           \n\t"
-                                "breq  wait_spm2       \n\t"                                                 
                   
+                                "breq  wait_spm2       \n\t"
 
                                 "ldi   r16,0x11        \n\t"   //Re-enable RWW section
-                                "sts   %0,r16          \n\t"                                                 
                   
+                                "sts   %0,r16          \n\t"
                                 "spm                   \n\t"
 #ifdef __AVR_ATmega163__
                                 ".word 0xFFFF          \n\t"
                                 "nop                   \n\t"
 #endif
-                                "no_page_erase:                \n\t"                                         
           
+                                "no_page_erase:                \n\t"
                                 "ld    r0,Y+           \n\t"   //Write 2 bytes into page buffer
-                                "ld    r1,Y+           \n\t"                                                 
   
-                                                        
+                                "ld    r1,Y+           \n\t"
+
                                 "wait_spm3:            \n\t"
                                 "lds   r16,%0          \n\t"   //Wait for previous spm to complete
                                 "andi  r16,1           \n\t"
@@ -629,7 +629,7 @@ putch(0x0D);
                                 "ldi   r16,0x01        \n\t"   //Load r0,r1 into FLASH page buffer
                                 "sts   %0,r16          \n\t"
                                 "spm                   \n\t"
-                                                        
+
                                 "inc   r17             \n\t"   //page_word_count++
                                 "cpi r17,%1            \n\t"
                                 "brlo  same_page       \n\t"   //Still same page in FLASH
@@ -642,7 +642,7 @@ putch(0x0D);
                                 "breq  wait_spm4       \n\t"
 #ifdef __AVR_ATmega163__
                                 "andi  r30,0x80        \n\t"   // m163 requires Z6:Z1 to be zero during page 
write
-#endif                                                                                                       
   
+#endif
                                 "ldi   r16,0x05        \n\t"   //Write page pointed to by Z
                                 "sts   %0,r16          \n\t"
                                 "spm                   \n\t"
@@ -655,15 +655,15 @@ putch(0x0D);
                                 "lds   r16,%0          \n\t"   //Wait for previous spm to complete
                                 "andi  r16,1           \n\t"
                                 "cpi   r16,1           \n\t"
-                                "breq  wait_spm5       \n\t"                                                 
                   
+                                "breq  wait_spm5       \n\t"
                                 "ldi   r16,0x11        \n\t"   //Re-enable RWW section
-                                "sts   %0,r16          \n\t"                                                 
                   
-                                "spm                   \n\t"                                                 
   
+                                "sts   %0,r16          \n\t"
+                                "spm                   \n\t"
 #ifdef __AVR_ATmega163__
                                 ".word 0xFFFF          \n\t"
                                 "nop                   \n\t"
 #endif
-                                "same_page:            \n\t"                                                 
   
+                                "same_page:            \n\t"
                                 "adiw  r30,2           \n\t"   //Next word in FLASH
                                 "sbiw  r24,2           \n\t"   //length-2
                                 "breq  final_write     \n\t"   //Finished
@@ -686,9 +686,9 @@ putch(0x0D);
                }
                putch(0x14);
                putch(0x10);
-           }           
+           }
        }
-    
+
 
         /* Read memory block mode, length is big endian.  */
         else if(ch=='t') {
@@ -803,7 +803,7 @@ putch(0x0D);
                                putch('0');
                            }
 
-                       } 
+                       }
 
                        /* read byte from address */
                        else if(ch == 'r') {
@@ -947,7 +947,7 @@ char getch(void)
 #elif defined (__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
     uint32_t count = 0;
     while(!(UCSR0A & _BV(RXC0))){
-       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/               
+       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/
        /* HACKME:: here is a good place to count times*/
        count++;
        if (count > MAX_TIME_COUNT)
@@ -958,7 +958,7 @@ char getch(void)
     /* m8,16,32,169,8515,8535,163 */
     uint32_t count = 0;
     while(!(UCSRA & _BV(RXC))){
-       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/               
+       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/
        /* HACKME:: here is a good place to count times*/
        count++;
        if (count > MAX_TIME_COUNT)
@@ -977,7 +977,7 @@ void getNch(uint8_t count)
        if(bootuart == 1) {
            while(!(UCSR0A & _BV(RXC0)));
            UDR0;
-       } 
+       }
        else if(bootuart == 2) {
            while(!(UCSR1A & _BV(RXC1)));
            UDR1;
@@ -987,14 +987,14 @@ void getNch(uint8_t count)
        UDR0;
 #else
        /* m8,16,32,169,8515,8535,163 */
-       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/               
+       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/
        //while(!(UCSRA & _BV(RXC)));
        //UDR;
     uint8_t i;
     for(i=0;i<count;i++) {
        getch(); // need to handle time out
     }
-#endif         
+#endif
     }
 }
 
@@ -1025,7 +1025,7 @@ void flash_led(uint8_t count)
     if (count == 0) {
       count = 3;
     }
-    
+
     for (i = 0; i < count; ++i) {
        LED_PORT |= _BV(LED);
        for(l = 0; l < (2 * F_CPU); ++l);
diff --git a/hardware/arduino/bootloaders/lilypad/src/ATmegaBOOT.c 
b/hardware/arduino/bootloaders/lilypad/src/ATmegaBOOT.c
index 915bc57..a7fb524 100644
--- a/hardware/arduino/bootloaders/lilypad/src/ATmegaBOOT.c
+++ b/hardware/arduino/bootloaders/lilypad/src/ATmegaBOOT.c
@@ -296,7 +296,7 @@ int main(void)
 #endif
     }
 
-#ifdef __AVR_ATmega128__    
+#ifdef __AVR_ATmega128__
     /* no bootuart was selected, default to uart 0 */
     if(!bootuart) {
       bootuart = 1;
@@ -324,7 +324,7 @@ int main(void)
     UBRR = (uint8_t)(F_CPU/(BAUD_RATE*16L)-1);
     UBRRHI = (F_CPU/(BAUD_RATE*16L)-1) >> 8;
     UCSRA = 0x00;
-    UCSRB = _BV(TXEN)|_BV(RXEN);       
+    UCSRB = _BV(TXEN)|_BV(RXEN);
 #elif defined __AVR_ATmega168__
     UBRR0L = (uint8_t)(F_CPU/(BAUD_RATE*16L)-1);
     UBRR0H = (F_CPU/(BAUD_RATE*16L)-1) >> 8;
@@ -362,7 +362,7 @@ int main(void)
 #else
     flash_led(NUM_LED_FLASHES);
 #endif
-    
+
     /* 20050803: by DojoCorp, this is one of the parts provoking the
                  system to stop listening, cancelled from the original */
     //putch('\0');
@@ -376,7 +376,7 @@ int main(void)
 
        /* A bunch of if...else if... gives smaller code than switch...case ! */
 
-       /* Hello is anyone home ? */ 
+       /* Hello is anyone home ? */
        if(ch=='0') {
            nothing_response();
        }
@@ -493,7 +493,7 @@ int main(void)
                        eeprom_write_byte((void *)address.word,buff[w]);
 #endif
                        address.word++;
-                   }                   
+                   }
                }
                else {                                          //Write to FLASH one page at a time
                    if (address.byte[1]>127) address_high = 0x01;       //Only possible with m128, m256 will 
need 3rd address byte. FIXME
@@ -515,9 +515,9 @@ int main(void)
                                 "ldi   r29,hi8(buff)   \n\t"
                                 "lds   r24,length      \n\t"   //Length of data to be written (in bytes)
                                 "lds   r25,length+1    \n\t"
-                                "length_loop:          \n\t"   //Main loop, repeat for number of words in 
block                                                                                                         
        
+                                "length_loop:          \n\t"   //Main loop, repeat for number of words in 
block
                                 "cpi   r17,0x00        \n\t"   //If page_word_count=0 then erase page
-                                "brne  no_page_erase   \n\t"                                            
+                                "brne  no_page_erase   \n\t"
                                 "wait_spm1:            \n\t"
                                 "lds   r16,%0          \n\t"   //Wait for previous spm to complete
                                 "andi  r16,1           \n\t"
@@ -525,7 +525,7 @@ int main(void)
                                 "breq  wait_spm1       \n\t"
                                 "ldi   r16,0x03        \n\t"   //Erase page pointed to by Z
                                 "sts   %0,r16          \n\t"
-                                "spm                   \n\t"                                                 
   
+                                "spm                   \n\t"
 #ifdef __AVR_ATmega163__
                                 ".word 0xFFFF          \n\t"
                                 "nop                   \n\t"
@@ -534,19 +534,19 @@ int main(void)
                                 "lds   r16,%0          \n\t"   //Wait for previous spm to complete
                                 "andi  r16,1           \n\t"
                                 "cpi   r16,1           \n\t"
-                                "breq  wait_spm2       \n\t"                                                 
                   
+                                "breq  wait_spm2       \n\t"
 
                                 "ldi   r16,0x11        \n\t"   //Re-enable RWW section
-                                "sts   %0,r16          \n\t"                                                 
                   
+                                "sts   %0,r16          \n\t"
                                 "spm                   \n\t"
 #ifdef __AVR_ATmega163__
                                 ".word 0xFFFF          \n\t"
                                 "nop                   \n\t"
 #endif
-                                "no_page_erase:                \n\t"                                         
           
+                                "no_page_erase:                \n\t"
                                 "ld    r0,Y+           \n\t"   //Write 2 bytes into page buffer
-                                "ld    r1,Y+           \n\t"                                                 
   
-                                                        
+                                "ld    r1,Y+           \n\t"
+
                                 "wait_spm3:            \n\t"
                                 "lds   r16,%0          \n\t"   //Wait for previous spm to complete
                                 "andi  r16,1           \n\t"
@@ -555,7 +555,7 @@ int main(void)
                                 "ldi   r16,0x01        \n\t"   //Load r0,r1 into FLASH page buffer
                                 "sts   %0,r16          \n\t"
                                 "spm                   \n\t"
-                                                        
+
                                 "inc   r17             \n\t"   //page_word_count++
                                 "cpi r17,%1            \n\t"
                                 "brlo  same_page       \n\t"   //Still same page in FLASH
@@ -568,7 +568,7 @@ int main(void)
                                 "breq  wait_spm4       \n\t"
 #ifdef __AVR_ATmega163__
                                 "andi  r30,0x80        \n\t"   // m163 requires Z6:Z1 to be zero during page 
write
-#endif                                                                                                       
   
+#endif
                                 "ldi   r16,0x05        \n\t"   //Write page pointed to by Z
                                 "sts   %0,r16          \n\t"
                                 "spm                   \n\t"
@@ -581,15 +581,15 @@ int main(void)
                                 "lds   r16,%0          \n\t"   //Wait for previous spm to complete
                                 "andi  r16,1           \n\t"
                                 "cpi   r16,1           \n\t"
-                                "breq  wait_spm5       \n\t"                                                 
                   
+                                "breq  wait_spm5       \n\t"
                                 "ldi   r16,0x11        \n\t"   //Re-enable RWW section
-                                "sts   %0,r16          \n\t"                                                 
                   
-                                "spm                   \n\t"                                                 
   
+                                "sts   %0,r16          \n\t"
+                                "spm                   \n\t"
 #ifdef __AVR_ATmega163__
                                 ".word 0xFFFF          \n\t"
                                 "nop                   \n\t"
 #endif
-                                "same_page:            \n\t"                                                 
   
+                                "same_page:            \n\t"
                                 "adiw  r30,2           \n\t"   //Next word in FLASH
                                 "sbiw  r24,2           \n\t"   //length-2
                                 "breq  final_write     \n\t"   //Finished
@@ -615,9 +615,9 @@ int main(void)
            } else {
                if (++error_count == MAX_ERROR_COUNT)
                    app_start();
-           }           
+           }
        }
-    
+
 
         /* Read memory block mode, length is big endian.  */
         else if(ch=='t') {
@@ -735,7 +735,7 @@ int main(void)
                                putch('0');
                            }
 
-                       } 
+                       }
 
                        /* read byte from address */
                        else if(ch == 'r') {
@@ -880,7 +880,7 @@ char getch(void)
 #elif defined __AVR_ATmega168__
     uint32_t count = 0;
     while(!(UCSR0A & _BV(RXC0))){
-       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/               
+       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/
        /* HACKME:: here is a good place to count times*/
        count++;
        if (count > MAX_TIME_COUNT)
@@ -891,7 +891,7 @@ char getch(void)
     /* m8,16,32,169,8515,8535,163 */
     uint32_t count = 0;
     while(!(UCSRA & _BV(RXC))){
-       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/               
+       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/
        /* HACKME:: here is a good place to count times*/
        count++;
        if (count > MAX_TIME_COUNT)
@@ -910,7 +910,7 @@ void getNch(uint8_t count)
        if(bootuart == 1) {
            while(!(UCSR0A & _BV(RXC0)));
            UDR0;
-       } 
+       }
        else if(bootuart == 2) {
            while(!(UCSR1A & _BV(RXC1)));
            UDR1;
@@ -920,14 +920,14 @@ void getNch(uint8_t count)
        UDR0;
 #else
        /* m8,16,32,169,8515,8535,163 */
-       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/               
+       /* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/
        //while(!(UCSRA & _BV(RXC)));
        //UDR;
     uint8_t i;
     for(i=0;i<count;i++) {
        getch(); // need to handle time out
     }
-#endif         
+#endif
     }
 }
 
@@ -966,7 +966,7 @@ void flash_led(uint8_t count)
     if (count == 0) {
       count = 3;
     }
-    
+
     for (i = 0; i < count; ++i) {
        LED_PORT |= _BV(LED);
        for(l = 0; l < (F_CPU / 1000); ++l);
diff --git a/hardware/arduino/bootloaders/optiboot/boot.h b/hardware/arduino/bootloaders/optiboot/boot.h
index 2639cd8..07a37e3 100644
--- a/hardware/arduino/bootloaders/optiboot/boot.h
+++ b/hardware/arduino/bootloaders/optiboot/boot.h
@@ -54,8 +54,8 @@
     macros are designed to work with all sizes of flash memory.
 
     Global interrupts are not automatically disabled for these macros. It
-    is left up to the programmer to do this. See the code example below. 
-    Also see the processor datasheet for caveats on having global interrupts 
+    is left up to the programmer to do this. See the code example below.
+    Also see the processor datasheet for caveats on having global interrupts
     enabled during writing of the Flash.
 
     \note Not all AVR processors provide bootloader support. See your
@@ -73,7 +73,7 @@
     #include <inttypes.h>
     #include <avr/interrupt.h>
     #include <avr/pgmspace.h>
-    
+
     void boot_program_page (uint32_t page, uint8_t *buf)
     {
         uint16_t i;
@@ -83,7 +83,7 @@
 
         sreg = SREG;
         cli();
-    
+
         eeprom_busy_wait ();
 
         boot_page_erase (page);
@@ -95,7 +95,7 @@
 
             uint16_t w = *buf++;
             w += (*buf++) << 8;
-        
+
             boot_page_fill (page + i, w);
         }
 
@@ -498,11 +498,11 @@
 
      If bits 5..2 in R0 are cleared (zero), the corresponding Boot Lock bit
      will be programmed if an SPM instruction is executed within four cycles
-     after BLBSET and SPMEN (or SELFPRGEN) are set in SPMCR. The Z-pointer is 
-     don't care during this operation, but for future compatibility it is 
-     recommended to load the Z-pointer with $0001 (same as used for reading the 
-     Lock bits). For future compatibility It is also recommended to set bits 7, 
-     6, 1, and 0 in R0 to 1 when writing the Lock bits. When programming the 
+     after BLBSET and SPMEN (or SELFPRGEN) are set in SPMCR. The Z-pointer is
+     don't care during this operation, but for future compatibility it is
+     recommended to load the Z-pointer with $0001 (same as used for reading the
+     Lock bits). For future compatibility It is also recommended to set bits 7,
+     6, 1, and 0 in R0 to 1 when writing the Lock bits. When programming the
      Lock bits the entire Flash can be read during the operation. */
 
 #define __boot_lock_bits_set_short(lock_bits)                    \
@@ -564,8 +564,8 @@
 /*
    Reading lock and fuse bits:
 
-     Similarly to writing the lock bits above, set BLBSET and SPMEN (or 
-     SELFPRGEN) bits in __SPMREG, and then (within four clock cycles) issue an 
+     Similarly to writing the lock bits above, set BLBSET and SPMEN (or
+     SELFPRGEN) bits in __SPMREG, and then (within four clock cycles) issue an
      LPM instruction.
 
      Z address:       contents:
@@ -697,13 +697,13 @@
 /** \ingroup avr_boot
     \def boot_page_fill(address, data)
 
-    Fill the bootloader temporary page buffer for flash 
-    address with data word. 
+    Fill the bootloader temporary page buffer for flash
+    address with data word.
 
-    \note The address is a byte address. The data is a word. The AVR 
+    \note The address is a byte address. The data is a word. The AVR
     writes data to the buffer a word at a time, but addresses the buffer
     per byte! So, increment your address by 2 between calls, and send 2
-    data bytes in a word format! The LSB of the data is written to the lower 
+    data bytes in a word format! The LSB of the data is written to the lower
     address; the MSB of the data is written to the higher address.*/
 
 /** \ingroup avr_boot
@@ -716,9 +716,9 @@
 /** \ingroup avr_boot
     \def boot_page_write(address)
 
-    Write the bootloader temporary page buffer 
+    Write the bootloader temporary page buffer
     to flash page that contains address.
-    
+
     \note address is a byte address in flash, not a word address. */
 
 /** \ingroup avr_boot
@@ -753,7 +753,7 @@
    instruction sequences after LPM.
 
    FLASHEND is defined in the ioXXXX.h file.
-   USHRT_MAX is defined in <limits.h>. */ 
+   USHRT_MAX is defined in <limits.h>. */
 
 #if defined(__AVR_ATmega161__) || defined(__AVR_ATmega163__) \
     || defined(__AVR_ATmega323__)
diff --git a/hardware/arduino/bootloaders/optiboot/optiboot.c 
b/hardware/arduino/bootloaders/optiboot/optiboot.c
index d499d85..08c0c19 100644
--- a/hardware/arduino/bootloaders/optiboot/optiboot.c
+++ b/hardware/arduino/bootloaders/optiboot/optiboot.c
@@ -114,7 +114,7 @@
 /* 500,1000,2000,4000,8000 supported.                     */
 /*                                                        */
 /**********************************************************/
-
+
 /**********************************************************/
 /* Version Numbers!                                       */
 /*                                                        */
@@ -152,7 +152,7 @@
 asm("  .section .version\n"
     "optiboot_version:  .word " MAKEVER(OPTIBOOT_MAJVER, OPTIBOOT_MINVER) "\n"
     "  .section .text\n");
-
+
 #include <inttypes.h>
 #include <avr/io.h>
 #include <avr/pgmspace.h>
@@ -579,7 +579,7 @@ uint8_t getch(void) {
        */
     watchdogReset();
   }
-  
+
   ch = UDR0;
 #endif
 
diff --git a/hardware/arduino/bootloaders/optiboot/pin_defs.h 
b/hardware/arduino/bootloaders/optiboot/pin_defs.h
index 27d7772..cd32812 100644
--- a/hardware/arduino/bootloaders/optiboot/pin_defs.h
+++ b/hardware/arduino/bootloaders/optiboot/pin_defs.h
@@ -1,5 +1,5 @@
 #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega88) || 
defined(__AVR_ATmega8__) || defined(__AVR_ATmega88__)
-/* Onboard LED is connected to pin PB5 in Arduino NG, Diecimila, and Duemilanove */ 
+/* Onboard LED is connected to pin PB5 in Arduino NG, Diecimila, and Duemilanove */
 #define LED_DDR     DDRB
 #define LED_PORT    PORTB
 #define LED_PIN     PINB
@@ -28,7 +28,7 @@
 
 /* Luminet support */
 #if defined(__AVR_ATtiny84__)
-/* Red LED is connected to pin PA4 */ 
+/* Red LED is connected to pin PA4 */
 #define LED_DDR     DDRA
 #define LED_PORT    PORTA
 #define LED_PIN     PINA
@@ -45,7 +45,7 @@
 
 /* Sanguino support */
 #if defined(__AVR_ATmega644P__)
-/* Onboard LED is connected to pin PB0 on Sanguino */ 
+/* Onboard LED is connected to pin PB0 on Sanguino */
 #define LED_DDR     DDRB
 #define LED_PORT    PORTB
 #define LED_PIN     PINB
@@ -63,7 +63,7 @@
 
 /* Mega support */
 #if defined(__AVR_ATmega1280__)
-/* Onboard LED is connected to pin PB7 on Arduino Mega */ 
+/* Onboard LED is connected to pin PB7 on Arduino Mega */
 #define LED_DDR     DDRB
 #define LED_PORT    PORTB
 #define LED_PIN     PINB
diff --git a/hardware/arduino/bootloaders/stk500v2/License.txt 
b/hardware/arduino/bootloaders/stk500v2/License.txt
index a66eb90..f425f5f 100644
--- a/hardware/arduino/bootloaders/stk500v2/License.txt
+++ b/hardware/arduino/bootloaders/stk500v2/License.txt
@@ -55,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
diff --git a/hardware/arduino/bootloaders/stk500v2/avrinterruptnames.h 
b/hardware/arduino/bootloaders/stk500v2/avrinterruptnames.h
index f862f9a..def42f5 100644
--- a/hardware/arduino/bootloaders/stk500v2/avrinterruptnames.h
+++ b/hardware/arduino/bootloaders/stk500v2/avrinterruptnames.h
@@ -19,8 +19,8 @@
 //#include     "avrinterruptnames.h"
 
 //**************************************************************************************************
-//*    this defines the interrupt vectors and allows us to compile ONLY those strings that are actually 
-//*    in the target CPU. This way we do not have to keep making changes based on cpu, it will be 
+//*    this defines the interrupt vectors and allows us to compile ONLY those strings that are actually
+//*    in the target CPU. This way we do not have to keep making changes based on cpu, it will be
 //*    automatic even if we add a new CPU
 #ifndef _AVR_IO_H_
        #include        <avr/io.h>
@@ -497,7 +497,7 @@ PGM_P gInterruptNameTable[] PROGMEM =
 
 //**************************************************************************************************
 #if defined(__AVR_ATmega324P__ ) || defined(__AVR_ATmega644__ ) || defined(__AVR_ATmega644P__)
-#pragma mark __AVR_ATmega324P__  __AVR_ATmega644__ __AVR_ATmega644P__ 
+#pragma mark __AVR_ATmega324P__  __AVR_ATmega644__ __AVR_ATmega644P__
 
 #define        _INTERRUPT_NAMES_DEFINED_
 
@@ -585,13 +585,13 @@ PGM_P gInterruptNameTable[]       PROGMEM =
        gAvrInt_USART1_RX,              //      29
        gAvrInt_USART1_UDRE,    //      30
        gAvrInt_USART1_TX,              //      31
-       //*     these are NOT documented in  doc8272.pdf 
+       //*     these are NOT documented in  doc8272.pdf
        //*     they are in iom1284p.h
        gAvrInt_TIMER3_CAPT,    //      32
        gAvrInt_TIMER3_COMPA,   //      33
        gAvrInt_TIMER3_COMPB,   //      34
        gAvrInt_TIMER3_OVF,             //      35
-       
+
 
 };
 
@@ -754,7 +754,7 @@ PGM_P gInterruptNameTable[] PROGMEM =
        gAvrInt_USART1_UDRE,    //      27
        gAvrInt_USART1_TX,              //      28
        gAvrInt_ANALOG_COMP,    //      29
-       
+
        gAvrInt_ADC,                    //      30
        gAvrInt_EE_READY,               //      31
 
@@ -816,7 +816,7 @@ PGM_P gInterruptNameTable[] PROGMEM =
        gAvrInt_USART1_UDRE,    //      27
        gAvrInt_USART1_TX,              //      28
        gAvrInt_ANALOG_COMP,    //      29
-       
+
        gAvrInt_ADC,                    //      30
        gAvrInt_EE_READY,               //      31
 
@@ -1012,14 +1012,14 @@ PGM_P gInterruptNameTable[]     PROGMEM =
        gAvrInt_USART3_TX,              //      56
 #endif
        gAvrInt_TRN_PLL_LOCK,   //      57
-       gAvrInt_TRN_PLL_UNLOCK, //      58      
+       gAvrInt_TRN_PLL_UNLOCK, //      58
        gAvrInt_TRN_RX_START,   //      59
        gAvrInt_TRN_RX_END,             //      60
        gAvrInt_TRN_CAAED_DONE, //      61
        gAvrInt_TRN_FRAME_MATCH,//      62
        gAvrInt_TRN_TX_END,             //      63
        gAvrInt_TRN_AWAKE,              //      64
-       
+
        gAvrInt_SCNT_CMP1,              //      65
        gAvrInt_SCNT_CMP2,              //      66
        gAvrInt_SCNT_CMP3,              //      67
@@ -1027,8 +1027,8 @@ PGM_P gInterruptNameTable[]       PROGMEM =
        gAvrInt_SCNT_BACKOFF,   //      69
        gAvrInt_AES_READY,              //      70
        gAvrInt_BAT_LOW,                //      71
-       
-       
+
+
 };
 
 #endif
diff --git a/hardware/arduino/bootloaders/stk500v2/command.h b/hardware/arduino/bootloaders/stk500v2/command.h
index 03b1b38..e8c1a80 100644
--- a/hardware/arduino/bootloaders/stk500v2/command.h
+++ b/hardware/arduino/bootloaders/stk500v2/command.h
@@ -56,7 +56,7 @@
 #define CMD_PROGRAM_LOCK_PP                 0x29
 #define CMD_READ_LOCK_PP                    0x2A
 #define CMD_READ_SIGNATURE_PP               0x2B
-#define CMD_READ_OSCCAL_PP                  0x2C    
+#define CMD_READ_OSCCAL_PP                  0x2C
 
 #define CMD_SET_CONTROL_STACK               0x2D
 
diff --git a/hardware/arduino/bootloaders/stk500v2/stk500boot.c 
b/hardware/arduino/bootloaders/stk500v2/stk500boot.c
index e7494df..2a25dc8 100644
--- a/hardware/arduino/bootloaders/stk500v2/stk500boot.c
+++ b/hardware/arduino/bootloaders/stk500v2/stk500boot.c
@@ -83,7 +83,7 @@ LICENSE:
 //*    Nov  9, 2010    <MLS> Issue 392:Fixed bug that 3 !!! in code would cause it to jump to monitor
 //*    Jun 24, 2011    <MLS> Removed analogRead (was not used)
 //*    Dec 29, 2011    <MLS> Issue 181: added watch dog timmer support
-//*    Dec 29, 2011    <MLS> Issue 505:  bootloader is comparing the seqNum to 1 or the current sequence 
+//*    Dec 29, 2011    <MLS> Issue 505:  bootloader is comparing the seqNum to 1 or the current sequence
 //*    Jan  1, 2012    <MLS> Issue 543: CMD_CHIP_ERASE_ISP now returns STATUS_CMD_FAILED instead of 
STATUS_CMD_OK
 //*    Jan  1, 2012    <MLS> Issue 543: Write EEPROM now does something (NOT TESTED)
 //*    Jan  1, 2012    <MLS> Issue 544: stk500v2 bootloader doesn't support reading fuses
@@ -93,8 +93,8 @@ LICENSE:
 //*    these are used to test issues
 //*    http://code.google.com/p/arduino/issues/detail?id=505
 //*    Reported by mark.stubbs, Mar 14, 2011
-//*    The STK500V2 bootloader is comparing the seqNum to 1 or the current sequence 
-//*    (IE: Requiring the sequence to be 1 or match seqNum before continuing).  
+//*    The STK500V2 bootloader is comparing the seqNum to 1 or the current sequence
+//*    (IE: Requiring the sequence to be 1 or match seqNum before continuing).
 //*    The correct behavior is for the STK500V2 to accept the PC's sequence number, and echo it back for the 
reply message.
 #define        _FIX_ISSUE_505_
 //************************************************************************
@@ -681,7 +681,7 @@ int main(void)
                                {
                                //      c       =       recchar();
                                        c       =       recchar_timeout();
-                                       
+
                                }
 
                        #ifdef ENABLE_MONITOR
@@ -1113,7 +1113,7 @@ int main(void)
                        }
                        sendchar(checksum);
                        seqNum++;
-       
+
                #ifndef REMOVE_BOOTLOADER_LED
                        //*     <MLS>   toggle the LED
                        PROGLED_PORT    ^=      (1<<PROGLED_PIN);       // active high LED ON
@@ -1614,7 +1614,7 @@ int               errorCount;
 
 
 #if (FLASHEND > 0x08000)
-//*    this includes the interrupt names for the monitor portion. There is no longer enough 
+//*    this includes the interrupt names for the monitor portion. There is no longer enough
 //*    memory to include this
 //     #include        "avrinterruptnames.h"
 //     #ifndef _INTERRUPT_NAMES_DEFINED_
@@ -1661,7 +1661,7 @@ unsigned long     absoluteAddr;
                sendchar('=');
                sendchar(0x20);
 
-       
+
                //*     the AVR is LITTLE ENDIAN, swap the byte order
        #if (FLASHEND > 0x10000)
                byte1   =       pgm_read_byte_far(myMemoryPtr++);
@@ -1686,7 +1686,7 @@ unsigned long     absoluteAddr;
                sendchar(0x20);
                PrintHexByte(byte3);
                sendchar(0x20);
-       
+
                if (word1 == 0xffff)
                {
                        PrintFromPROGMEM(gTextMsg_noVector, 0);
@@ -1706,7 +1706,7 @@ unsigned long     absoluteAddr;
                        PrintHexByte((absoluteAddr >> 16) & 0x00ff);
                        PrintHexByte((absoluteAddr >> 8) & 0x00ff);
                        PrintHexByte((absoluteAddr) & 0x00ff);
-       
+
                }
                else if ((word1 & 0xfE0E) == 0x940c)
                {
@@ -1715,9 +1715,9 @@ unsigned long     absoluteAddr;
                                                                ((byte1 & 0xf0) << 17) +
                                                                ((byte2 & 0x01) << 21) +
                                                                word2;
-                                                       
+
                        absoluteAddr    =       myFullAddress << 1;
-                                                       
+
                        PrintFromPROGMEM(gTextMsg_jmp, 0);
                        PrintHexByte((myFullAddress >> 16) & 0x00ff);
                        PrintHexByte((myFullAddress >> 8) & 0x00ff);
@@ -2074,7 +2074,7 @@ int                               ii, jj;
                                        gEepromIndex    =       0;
                                }
                                break;
-               
+
                        case 'F':
                                PrintFromPROGMEMln(gTextMsg_HELP_MSG_F, 2);
                                DumpHex(kDUMP_FLASH, gFlashIndex, 16);
@@ -2111,7 +2111,7 @@ int                               ii, jj;
                                PrintFromPROGMEMln(gTextMsg_HELP_MSG_Y, 2);
                                AVR_PortOutput();
                                break;
-                       
+
                        default:
                                PrintFromPROGMEMln(gTextMsg_HUH, 0);
                                break;
diff --git a/hardware/arduino/cores/arduino/Arduino.h b/hardware/arduino/cores/arduino/Arduino.h
index 425dfcb..56caee6 100644
--- a/hardware/arduino/cores/arduino/Arduino.h
+++ b/hardware/arduino/cores/arduino/Arduino.h
@@ -64,7 +64,7 @@ extern "C"{
 #define DEFAULT 0
 #define EXTERNAL 1
 #define INTERNAL 2
-#else  
+#else
 #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284__) || 
defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega644A__) || 
defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__)
 #define INTERNAL1V1 2
 #define INTERNAL2V56 3
@@ -155,7 +155,7 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
 
 // Get the bit location within the hardware port of the given virtual pin.
 // This comes from the pins_*.c file for the active board configuration.
-// 
+//
 // These perform slightly better as macros compared to inline functions
 //
 #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
@@ -198,7 +198,7 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
 #define TIMER4A 11
 #define TIMER4B 12
 #define TIMER4C 13
-#define TIMER4D 14     
+#define TIMER4D 14
 #define TIMER5A 15
 #define TIMER5B 16
 #define TIMER5C 17
diff --git a/hardware/arduino/cores/arduino/CDC.cpp b/hardware/arduino/cores/arduino/CDC.cpp
index aae91c2..0ad4d3c 100644
--- a/hardware/arduino/cores/arduino/CDC.cpp
+++ b/hardware/arduino/cores/arduino/CDC.cpp
@@ -1,19 +1,19 @@
 
 
-/* Copyright (c) 2011, Peter Barrett  
-**  
-** Permission to use, copy, modify, and/or distribute this software for  
-** any purpose with or without fee is hereby granted, provided that the  
-** above copyright notice and this permission notice appear in all copies.  
-** 
-** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL  
-** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED  
-** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR  
-** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES  
-** OR ANY DAMAGES 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.  
+/* Copyright (c) 2011, Peter Barrett
+**
+** Permission to use, copy, modify, and/or distribute this software for
+** any purpose with or without fee is hereby granted, provided that the
+** above copyright notice and this permission notice appear in all copies.
+**
+** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+** OR ANY DAMAGES 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.
 */
 
 #include "Platform.h"
@@ -87,7 +87,7 @@ bool WEAK CDC_Setup(Setup& setup)
                {
                        _usbLineInfo.lineState = setup.wValueL;
 
-                       // auto-reset into the bootloader is triggered when the port, already 
+                       // auto-reset into the bootloader is triggered when the port, already
                        // open at 1200 bps, is closed.  this is the signal to start the watchdog
                        // with a relatively long period so it can finish housekeeping tasks
                        // like servicing endpoints before the sketch ends
@@ -101,7 +101,7 @@ bool WEAK CDC_Setup(Setup& setup)
                                        // twiggle more than once before stabilizing.
                                        // To avoid spurious resets we set the watchdog to 250ms and 
eventually
                                        // cancel if DTR goes back high.
-       
+
                                        wdt_disable();
                                        wdt_reset();
                                        *(uint16_t *)0x0800 = 0x0;
@@ -165,12 +165,12 @@ size_t Serial_::write(uint8_t c)
 
 size_t Serial_::write(const uint8_t *buffer, size_t size)
 {
-       /* only try to send bytes if the high-level CDC connection itself 
+       /* only try to send bytes if the high-level CDC connection itself
         is open (not just the pipe) - the OS should set lineState when the port
         is opened and clear lineState when the port is closed.
         bytes sent before the user opens the connection or after
         the connection is closed are lost - just like with a UART. */
-       
+
        // TODO - ZE - check behavior on different OSes and test what happens if an
        // open connection isn't broken cleanly (cable is yanked out, host dies
        // or locks up, or host virtual serial port hangs)
@@ -189,14 +189,14 @@ size_t Serial_::write(const uint8_t *buffer, size_t size)
 
 // This operator is a convenient way for a sketch to check whether the
 // port has actually been configured and opened by the host (as opposed
-// to just being connected to the host).  It can be used, for example, in 
+// to just being connected to the host).  It can be used, for example, in
 // setup() before printing to ensure that an application on the host is
 // actually ready to receive and display the data.
 // We add a short delay before returning to fix a bug observed by Federico
 // where the port is configured (lineState != 0) but not quite opened.
 Serial_::operator bool() {
        bool result = false;
-       if (_usbLineInfo.lineState > 0) 
+       if (_usbLineInfo.lineState > 0)
                result = true;
        delay(10);
        return result;
diff --git a/hardware/arduino/cores/arduino/HID.cpp b/hardware/arduino/cores/arduino/HID.cpp
index ac63608..1f0aba5 100644
--- a/hardware/arduino/cores/arduino/HID.cpp
+++ b/hardware/arduino/cores/arduino/HID.cpp
@@ -1,19 +1,19 @@
 
 
-/* Copyright (c) 2011, Peter Barrett  
-**  
-** Permission to use, copy, modify, and/or distribute this software for  
-** any purpose with or without fee is hereby granted, provided that the  
-** above copyright notice and this permission notice appear in all copies.  
-** 
-** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL  
-** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED  
-** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR  
-** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES  
-** OR ANY DAMAGES 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.  
+/* Copyright (c) 2011, Peter Barrett
+**
+** Permission to use, copy, modify, and/or distribute this software for
+** any purpose with or without fee is hereby granted, provided that the
+** above copyright notice and this permission notice appear in all copies.
+**
+** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+** OR ANY DAMAGES 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.
 */
 
 #include "Platform.h"
@@ -45,7 +45,7 @@ Keyboard_ Keyboard;
 
 extern const u8 _hidReportDescriptor[] PROGMEM;
 const u8 _hidReportDescriptor[] = {
-       
+
        //      Mouse
     0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)     // 54
     0x09, 0x02,                    // USAGE (Mouse)
@@ -82,25 +82,25 @@ const u8 _hidReportDescriptor[] = {
     0xa1, 0x01,                    // COLLECTION (Application)
     0x85, 0x02,                    //   REPORT_ID (2)
     0x05, 0x07,                    //   USAGE_PAGE (Keyboard)
-   
+
        0x19, 0xe0,                    //   USAGE_MINIMUM (Keyboard LeftControl)
     0x29, 0xe7,                    //   USAGE_MAXIMUM (Keyboard Right GUI)
     0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
     0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
     0x75, 0x01,                    //   REPORT_SIZE (1)
-    
+
        0x95, 0x08,                    //   REPORT_COUNT (8)
     0x81, 0x02,                    //   INPUT (Data,Var,Abs)
     0x95, 0x01,                    //   REPORT_COUNT (1)
     0x75, 0x08,                    //   REPORT_SIZE (8)
     0x81, 0x03,                    //   INPUT (Cnst,Var,Abs)
-    
+
        0x95, 0x06,                    //   REPORT_COUNT (6)
     0x75, 0x08,                    //   REPORT_SIZE (8)
     0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
     0x25, 0x65,                    //   LOGICAL_MAXIMUM (101)
     0x05, 0x07,                    //   USAGE_PAGE (Keyboard)
-    
+
        0x19, 0x00,                    //   USAGE_MINIMUM (Reserved (no event indicated))
     0x29, 0x65,                    //   USAGE_MAXIMUM (Keyboard Application)
     0x81, 0x00,                    //   INPUT (Data,Ary,Abs)
@@ -179,7 +179,7 @@ bool WEAK HID_Setup(Setup& setup)
                        return true;
                }
        }
-       
+
        if (REQUEST_HOSTTODEVICE_CLASS_INTERFACE == requestType)
        {
                if (HID_SET_PROTOCOL == r)
@@ -205,11 +205,11 @@ Mouse_::Mouse_(void) : _buttons(0)
 {
 }
 
-void Mouse_::begin(void) 
+void Mouse_::begin(void)
 {
 }
 
-void Mouse_::end(void) 
+void Mouse_::end(void)
 {
 }
 
@@ -240,7 +240,7 @@ void Mouse_::buttons(uint8_t b)
        }
 }
 
-void Mouse_::press(uint8_t b) 
+void Mouse_::press(uint8_t b)
 {
        buttons(_buttons | b);
 }
@@ -252,7 +252,7 @@ void Mouse_::release(uint8_t b)
 
 bool Mouse_::isPressed(uint8_t b)
 {
-       if ((b & _buttons) > 0) 
+       if ((b & _buttons) > 0)
                return true;
        return false;
 }
@@ -261,15 +261,15 @@ bool Mouse_::isPressed(uint8_t b)
 //================================================================================
 //     Keyboard
 
-Keyboard_::Keyboard_(void) 
+Keyboard_::Keyboard_(void)
 {
 }
 
-void Keyboard_::begin(void) 
+void Keyboard_::begin(void)
 {
 }
 
-void Keyboard_::end(void) 
+void Keyboard_::end(void)
 {
 }
 
@@ -290,16 +290,16 @@ const uint8_t _asciimap[128] =
        0x00,             // ETX
        0x00,             // EOT
        0x00,             // ENQ
-       0x00,             // ACK  
+       0x00,             // ACK
        0x00,             // BEL
        0x2a,                   // BS   Backspace
        0x2b,                   // TAB  Tab
        0x28,                   // LF   Enter
-       0x00,             // VT 
-       0x00,             // FF 
-       0x00,             // CR 
-       0x00,             // SO 
-       0x00,             // SI 
+       0x00,             // VT
+       0x00,             // FF
+       0x00,             // CR
+       0x00,             // SO
+       0x00,             // SI
        0x00,             // DEL
        0x00,             // DC1
        0x00,             // DC2
@@ -309,13 +309,13 @@ const uint8_t _asciimap[128] =
        0x00,             // SYN
        0x00,             // ETB
        0x00,             // CAN
-       0x00,             // EM 
+       0x00,             // EM
        0x00,             // SUB
        0x00,             // ESC
-       0x00,             // FS 
-       0x00,             // GS 
-       0x00,             // RS 
-       0x00,             // US 
+       0x00,             // FS
+       0x00,             // GS
+       0x00,             // RS
+       0x00,             // US
 
        0x2c,              //  ' '
        0x1e|SHIFT,        // !
@@ -408,7 +408,7 @@ const uint8_t _asciimap[128] =
        0x1b,          // x
        0x1c,          // y
        0x1d,          // z
-       0x2f|SHIFT,    // 
+       0x2f|SHIFT,    //
        0x31|SHIFT,    // |
        0x30|SHIFT,    // }
        0x35|SHIFT,    // ~
@@ -418,10 +418,10 @@ const uint8_t _asciimap[128] =
 uint8_t USBPutChar(uint8_t c);
 
 // press() adds the specified key (printing, non-printing, or modifier)
-// to the persistent key report and sends the report.  Because of the way 
-// USB HID works, the host acts like the key remains pressed until we 
+// to the persistent key report and sends the report.  Because of the way
+// USB HID works, the host acts like the key remains pressed until we
 // call release(), releaseAll(), or otherwise clear the report and resend.
-size_t Keyboard_::press(uint8_t k) 
+size_t Keyboard_::press(uint8_t k)
 {
        uint8_t i;
        if (k >= 136) {                 // it's a non-printing key (not a modifier)
@@ -440,13 +440,13 @@ size_t Keyboard_::press(uint8_t k)
                        k &= 0x7F;
                }
        }
-       
+
        // Add k to the key report only if it's not already present
        // and if there is an empty slot.
-       if (_keyReport.keys[0] != k && _keyReport.keys[1] != k && 
+       if (_keyReport.keys[0] != k && _keyReport.keys[1] != k &&
                _keyReport.keys[2] != k && _keyReport.keys[3] != k &&
                _keyReport.keys[4] != k && _keyReport.keys[5] != k) {
-               
+
                for (i=0; i<6; i++) {
                        if (_keyReport.keys[i] == 0x00) {
                                _keyReport.keys[i] = k;
@@ -456,7 +456,7 @@ size_t Keyboard_::press(uint8_t k)
                if (i == 6) {
                        setWriteError();
                        return 0;
-               }       
+               }
        }
        sendReport(&_keyReport);
        return 1;
@@ -465,7 +465,7 @@ size_t Keyboard_::press(uint8_t k)
 // release() takes the specified key out of the persistent key report and
 // sends the report.  This tells the OS the key is no longer pressed and that
 // it shouldn't be repeated any more.
-size_t Keyboard_::release(uint8_t k) 
+size_t Keyboard_::release(uint8_t k)
 {
        uint8_t i;
        if (k >= 136) {                 // it's a non-printing key (not a modifier)
@@ -483,7 +483,7 @@ size_t Keyboard_::release(uint8_t k)
                        k &= 0x7F;
                }
        }
-       
+
        // Test the key report to see if k is present.  Clear it if it exists.
        // Check all positions in case the key is present more than once (which it shouldn't be)
        for (i=0; i<6; i++) {
@@ -499,17 +499,17 @@ size_t Keyboard_::release(uint8_t k)
 void Keyboard_::releaseAll(void)
 {
        _keyReport.keys[0] = 0;
-       _keyReport.keys[1] = 0; 
+       _keyReport.keys[1] = 0;
        _keyReport.keys[2] = 0;
-       _keyReport.keys[3] = 0; 
+       _keyReport.keys[3] = 0;
        _keyReport.keys[4] = 0;
-       _keyReport.keys[5] = 0; 
+       _keyReport.keys[5] = 0;
        _keyReport.modifiers = 0;
        sendReport(&_keyReport);
 }
 
 size_t Keyboard_::write(uint8_t c)
-{      
+{
        uint8_t p = press(c);           // Keydown
        uint8_t r = release(c);         // Keyup
        return (p);                                     // just return the result of press() since release() 
almost always returns 1
diff --git a/hardware/arduino/cores/arduino/HardwareSerial.cpp 
b/hardware/arduino/cores/arduino/HardwareSerial.cpp
index 1a2f8ce..0d4928c 100644
--- a/hardware/arduino/cores/arduino/HardwareSerial.cpp
+++ b/hardware/arduino/cores/arduino/HardwareSerial.cpp
@@ -15,7 +15,7 @@
   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-  
+
   Modified 23 November 2006 by David A. Mellis
   Modified 28 September 2010 by Mark Sproul
   Modified 14 August 2012 by Alarus
@@ -28,7 +28,7 @@
 #include "Arduino.h"
 #include "wiring_private.h"
 
-// this next line disables the entire HardwareSerial.cpp, 
+// this next line disables the entire HardwareSerial.cpp,
 // this is so I can support Attiny series and any other chip without a uart
 #if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)
 
@@ -230,7 +230,7 @@ ISR(USART_UDRE_vect)
     // There is more data in the output buffer. Send the next byte
     unsigned char c = tx_buffer.buffer[tx_buffer.tail];
     tx_buffer.tail = (tx_buffer.tail + 1) % SERIAL_BUFFER_SIZE;
-       
+
   #if defined(UDR0)
     UDR0 = c;
   #elif defined(UDR)
@@ -254,7 +254,7 @@ ISR(USART1_UDRE_vect)
     // There is more data in the output buffer. Send the next byte
     unsigned char c = tx_buffer1.buffer[tx_buffer1.tail];
     tx_buffer1.tail = (tx_buffer1.tail + 1) % SERIAL_BUFFER_SIZE;
-       
+
     UDR1 = c;
   }
 }
@@ -271,7 +271,7 @@ ISR(USART2_UDRE_vect)
     // There is more data in the output buffer. Send the next byte
     unsigned char c = tx_buffer2.buffer[tx_buffer2.tail];
     tx_buffer2.tail = (tx_buffer2.tail + 1) % SERIAL_BUFFER_SIZE;
-       
+
     UDR2 = c;
   }
 }
@@ -288,7 +288,7 @@ ISR(USART3_UDRE_vect)
     // There is more data in the output buffer. Send the next byte
     unsigned char c = tx_buffer3.buffer[tx_buffer3.tail];
     tx_buffer3.tail = (tx_buffer3.tail + 1) % SERIAL_BUFFER_SIZE;
-       
+
     UDR3 = c;
   }
 }
@@ -335,7 +335,7 @@ void HardwareSerial::begin(unsigned long baud)
 #endif
 
 try_again:
-  
+
   if (use_u2x) {
     *_ucsra = 1 << _u2x;
     baud_setting = (F_CPU / 4 / baud - 1) / 2;
@@ -343,7 +343,7 @@ try_again:
     *_ucsra = 0;
     baud_setting = (F_CPU / 8 / baud - 1) / 2;
   }
-  
+
   if ((baud_setting > 4095) && use_u2x)
   {
     use_u2x = false;
@@ -378,7 +378,7 @@ void HardwareSerial::begin(unsigned long baud, byte config)
 #endif
 
 try_again:
-  
+
   if (use_u2x) {
     *_ucsra = 1 << _u2x;
     baud_setting = (F_CPU / 4 / baud - 1) / 2;
@@ -386,7 +386,7 @@ try_again:
     *_ucsra = 0;
     baud_setting = (F_CPU / 8 / baud - 1) / 2;
   }
-  
+
   if ((baud_setting > 4095) && use_u2x)
   {
     use_u2x = false;
@@ -402,7 +402,7 @@ try_again:
   config |= 0x80; // select UCSRC register (shared with UBRRH)
 #endif
   *_ucsrc = config;
-  
+
   sbi(*_ucsrb, _rxen);
   sbi(*_ucsrb, _txen);
   sbi(*_ucsrb, _rxcie);
@@ -417,9 +417,9 @@ void HardwareSerial::end()
 
   cbi(*_ucsrb, _rxen);
   cbi(*_ucsrb, _txen);
-  cbi(*_ucsrb, _rxcie);  
+  cbi(*_ucsrb, _rxcie);
   cbi(*_ucsrb, _udrie);
-  
+
   // clear any received data
   _rx_buffer->head = _rx_buffer->tail;
 }
@@ -460,21 +460,21 @@ void HardwareSerial::flush()
 size_t HardwareSerial::write(uint8_t c)
 {
   int i = (_tx_buffer->head + 1) % SERIAL_BUFFER_SIZE;
-       
-  // If the output buffer is full, there's nothing for it other than to 
+
+  // If the output buffer is full, there's nothing for it other than to
   // wait for the interrupt handler to empty it a bit
   // ???: return 0 here instead?
   while (i == _tx_buffer->tail)
     ;
-       
+
   _tx_buffer->buffer[_tx_buffer->head] = c;
   _tx_buffer->head = i;
-       
+
   sbi(*_ucsrb, _udrie);
   // clear the TXC bit -- "can be cleared by writing a one to its bit location"
   transmitting = true;
   sbi(*_ucsra, TXC0);
-  
+
   return 1;
 }
 
diff --git a/hardware/arduino/cores/arduino/HardwareSerial.h b/hardware/arduino/cores/arduino/HardwareSerial.h
index a73117f..becb4e6 100644
--- a/hardware/arduino/cores/arduino/HardwareSerial.h
+++ b/hardware/arduino/cores/arduino/HardwareSerial.h
@@ -98,7 +98,7 @@ class HardwareSerial : public Stream
   extern HardwareSerial Serial;
 #elif defined(USBCON)
   #include "USBAPI.h"
-//  extern HardwareSerial Serial_;  
+//  extern HardwareSerial Serial_;
 #endif
 #if defined(UBRR1H)
   extern HardwareSerial Serial1;
diff --git a/hardware/arduino/cores/arduino/Print.cpp b/hardware/arduino/cores/arduino/Print.cpp
index 5df5630..2abd6aa 100644
--- a/hardware/arduino/cores/arduino/Print.cpp
+++ b/hardware/arduino/cores/arduino/Print.cpp
@@ -1,21 +1,21 @@
 /*
  Print.cpp - Base class that provides print() and println()
  Copyright (c) 2008 David A. Mellis.  All right reserved.
- 
+
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
- 
+
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
- 
+
  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- 
+
  Modified 23 November 2006 by David A. Mellis
  */
 
@@ -218,15 +218,15 @@ size_t Print::printNumber(unsigned long n, uint8_t base) {
   return write(str);
 }
 
-size_t Print::printFloat(double number, uint8_t digits) 
-{ 
+size_t Print::printFloat(double number, uint8_t digits)
+{
   size_t n = 0;
-  
+
   if (isnan(number)) return print("nan");
   if (isinf(number)) return print("inf");
   if (number > 4294967040.0) return print ("ovf");  // constant determined empirically
   if (number <-4294967040.0) return print ("ovf");  // constant determined empirically
-  
+
   // Handle negative numbers
   if (number < 0.0)
   {
@@ -238,7 +238,7 @@ size_t Print::printFloat(double number, uint8_t digits)
   double rounding = 0.5;
   for (uint8_t i=0; i<digits; ++i)
     rounding /= 10.0;
-  
+
   number += rounding;
 
   // Extract the integer part of the number and print it
@@ -248,7 +248,7 @@ size_t Print::printFloat(double number, uint8_t digits)
 
   // Print the decimal point, but only if there are digits beyond
   if (digits > 0) {
-    n += print("."); 
+    n += print(".");
   }
 
   // Extract digits from the remainder one at a time
@@ -257,8 +257,8 @@ size_t Print::printFloat(double number, uint8_t digits)
     remainder *= 10.0;
     int toPrint = int(remainder);
     n += print(toPrint);
-    remainder -= toPrint; 
-  } 
-  
+    remainder -= toPrint;
+  }
+
   return n;
 }
diff --git a/hardware/arduino/cores/arduino/Print.h b/hardware/arduino/cores/arduino/Print.h
index 7b53aa4..23d3da4 100644
--- a/hardware/arduino/cores/arduino/Print.h
+++ b/hardware/arduino/cores/arduino/Print.h
@@ -41,10 +41,10 @@ class Print
     void setWriteError(int err = 1) { write_error = err; }
   public:
     Print() : write_error(0) {}
-  
+
     int getWriteError() { return write_error; }
     void clearWriteError() { setWriteError(0); }
-  
+
     virtual size_t write(uint8_t) = 0;
     size_t write(const char *str) {
       if (str == NULL) return 0;
@@ -54,7 +54,7 @@ class Print
     size_t write(const char *buffer, size_t size) {
       return write((const uint8_t *)buffer, size);
     }
-    
+
     size_t print(const __FlashStringHelper *);
     size_t print(const String &);
     size_t print(const char[]);
diff --git a/hardware/arduino/cores/arduino/Stream.cpp b/hardware/arduino/cores/arduino/Stream.cpp
index f21a411..29a7ec5 100644
--- a/hardware/arduino/cores/arduino/Stream.cpp
+++ b/hardware/arduino/cores/arduino/Stream.cpp
@@ -99,21 +99,21 @@ bool Stream::findUntil(char *target, size_t targetLen, char *terminator, size_t
   size_t index = 0;  // maximum target string length is 64k bytes!
   size_t termIndex = 0;
   int c;
-  
+
   if( *target == 0)
     return true;   // return true if target is a null string
   while( (c = timedRead()) > 0){
-    
+
     if(c != target[index])
       index = 0; // reset index if any char does not match
-    
+
     if( c == target[index]){
       //////Serial.print("found "); Serial.write(c); Serial.print("index now"); Serial.println(index+1);
       if(++index >= targetLen){ // return true if all chars in the target match
         return true;
       }
     }
-    
+
     if(termLen > 0 && c == terminator[termIndex]){
       if(++termIndex >= termLen)
         return false;       // return false if terminate string found before target string
diff --git a/hardware/arduino/cores/arduino/Tone.cpp b/hardware/arduino/cores/arduino/Tone.cpp
index 9bb6fe7..1ceaaf1 100644
--- a/hardware/arduino/cores/arduino/Tone.cpp
+++ b/hardware/arduino/cores/arduino/Tone.cpp
@@ -103,13 +103,13 @@ const uint8_t PROGMEM tone_pin_to_timer_PGM[] = { 2 /*, 1 */ };
 static uint8_t tone_pins[AVAILABLE_TONE_PINS] = { 255 /*, 255 */ };
 
 #elif defined(__AVR_ATmega32U4__)
- 
+
 #define AVAILABLE_TONE_PINS 1
 #define USE_TIMER3
- 
+
 const uint8_t PROGMEM tone_pin_to_timer_PGM[] = { 3 /*, 1 */ };
 static uint8_t tone_pins[AVAILABLE_TONE_PINS] = { 255 /*, 255 */ };
- 
+
 #else
 
 #define AVAILABLE_TONE_PINS 1
@@ -127,13 +127,13 @@ static int8_t toneBegin(uint8_t _pin)
 {
   int8_t _timer = -1;
 
-  // if we're already using the pin, the timer should be configured.  
+  // if we're already using the pin, the timer should be configured.
   for (int i = 0; i < AVAILABLE_TONE_PINS; i++) {
     if (tone_pins[i] == _pin) {
       return pgm_read_byte(tone_pin_to_timer_PGM + i);
     }
   }
-  
+
   // search for an unused timer.
   for (int i = 0; i < AVAILABLE_TONE_PINS; i++) {
     if (tone_pins[i] == 255) {
@@ -142,7 +142,7 @@ static int8_t toneBegin(uint8_t _pin)
       break;
     }
   }
-  
+
   if (_timer != -1)
   {
     // Set timer specific stuff
@@ -251,7 +251,7 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration)
   {
     // Set the pinMode as OUTPUT
     pinMode(_pin, OUTPUT);
-    
+
     // if we are using an 8 bit timer, scan through prescalars to find the best fit
     if (_timer == 0 || _timer == 2)
     {
@@ -342,7 +342,7 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration)
 #endif
 
     }
-    
+
 
     // Calculate the toggle count
     if (duration > 0)
@@ -478,14 +478,14 @@ void disableTimer(uint8_t _timer)
 void noTone(uint8_t _pin)
 {
   int8_t _timer = -1;
-  
+
   for (int i = 0; i < AVAILABLE_TONE_PINS; i++) {
     if (tone_pins[i] == _pin) {
       _timer = pgm_read_byte(tone_pin_to_timer_PGM + i);
       tone_pins[i] = 255;
     }
   }
-  
+
   disableTimer(_timer);
 
   digitalWrite(_pin, 0);
diff --git a/hardware/arduino/cores/arduino/USBAPI.h b/hardware/arduino/cores/arduino/USBAPI.h
index 4846fc2..4a2266f 100644
--- a/hardware/arduino/cores/arduino/USBAPI.h
+++ b/hardware/arduino/cores/arduino/USBAPI.h
@@ -65,7 +65,7 @@ public:
        void begin(void);
        void end(void);
        void click(uint8_t b = MOUSE_LEFT);
-       void move(signed char x, signed char y, signed char wheel = 0); 
+       void move(signed char x, signed char y, signed char wheel = 0);
        void press(uint8_t b = MOUSE_LEFT);             // press LEFT by default
        void release(uint8_t b = MOUSE_LEFT);   // release LEFT by default
        bool isPressed(uint8_t b = MOUSE_LEFT); // check LEFT by default
diff --git a/hardware/arduino/cores/arduino/USBCore.cpp b/hardware/arduino/cores/arduino/USBCore.cpp
index f8123e5..820c5d9 100644
--- a/hardware/arduino/cores/arduino/USBCore.cpp
+++ b/hardware/arduino/cores/arduino/USBCore.cpp
@@ -1,19 +1,19 @@
 
 
-/* Copyright (c) 2010, Peter Barrett  
-**  
-** Permission to use, copy, modify, and/or distribute this software for  
-** any purpose with or without fee is hereby granted, provided that the  
-** above copyright notice and this permission notice appear in all copies.  
-** 
-** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL  
-** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED  
-** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR  
-** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES  
-** OR ANY DAMAGES 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.  
+/* Copyright (c) 2010, Peter Barrett
+**
+** Permission to use, copy, modify, and/or distribute this software for
+** any purpose with or without fee is hereby granted, provided that the
+** above copyright notice and this permission notice appear in all copies.
+**
+** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+** OR ANY DAMAGES 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.
 */
 
 #include "Platform.h"
@@ -51,7 +51,7 @@ const u16 STRING_LANGUAGE[2] = {
 
 const u16 STRING_IPRODUCT[17] = {
        (3<<8) | (2+2*16),
-#if USB_PID == 0x8036  
+#if USB_PID == 0x8036
        'A','r','d','u','i','n','o',' ','L','e','o','n','a','r','d','o'
 #elif USB_PID == 0x8037
        'A','r','d','u','i','n','o',' ','M','i','c','r','o',' ',' ',' '
@@ -125,9 +125,9 @@ void Recv(volatile u8* data, u8 count)
 {
        while (count--)
                *data++ = UEDATX;
-       
+
        RXLED1;                                 // light the RX LED
-       RxLEDPulse = TX_RX_LED_PULSE_MS;        
+       RxLEDPulse = TX_RX_LED_PULSE_MS;
 }
 
 static inline u8 Recv8()
@@ -135,7 +135,7 @@ static inline u8 Recv8()
        RXLED1;                                 // light the RX LED
        RxLEDPulse = TX_RX_LED_PULSE_MS;
 
-       return UEDATX;  
+       return UEDATX;
 }
 
 static inline void Send8(u8 d)
@@ -235,7 +235,7 @@ int USB_Recv(u8 ep, void* d, int len)
 {
        if (!_usbConfiguration || len < 0)
                return -1;
-       
+
        LockEP lock(ep);
        u8 n = FifoByteCount();
        len = min(n,len);
@@ -245,7 +245,7 @@ int USB_Recv(u8 ep, void* d, int len)
                *dst++ = Recv8();
        if (len && !FifoByteCount())    // release empty buffer
                ReleaseRX();
-       
+
        return len;
 }
 
@@ -321,10 +321,10 @@ int USB_Send(u8 ep, const void* d, int len)
 }
 
 extern const u8 _initEndpoints[] PROGMEM;
-const u8 _initEndpoints[] = 
+const u8 _initEndpoints[] =
 {
        0,
-       
+
 #ifdef CDC_ENABLED
        EP_TYPE_INTERRUPT_IN,           // CDC_ENDPOINT_ACM
        EP_TYPE_BULK_OUT,                       // CDC_ENDPOINT_OUT
@@ -453,7 +453,7 @@ static
 bool SendConfiguration(int maxlen)
 {
        //      Count and measure interfaces
-       InitControl(0); 
+       InitControl(0);
        int interfaces = SendInterfaces();
        ConfigDescriptor config = D_CONFIG(_cmark + sizeof(ConfigDescriptor),interfaces);
 
@@ -491,7 +491,7 @@ bool SendDescriptor(Setup& setup)
        {
                if (setup.wValueL == 0)
                        desc_addr = (const u8*)&STRING_LANGUAGE;
-               else if (setup.wValueL == IPRODUCT) 
+               else if (setup.wValueL == IPRODUCT)
                        desc_addr = (const u8*)&STRING_IPRODUCT;
                else if (setup.wValueL == IMANUFACTURER)
                        desc_addr = (const u8*)&STRING_IMANUFACTURER;
@@ -615,7 +615,7 @@ ISR(USB_GEN_vect)
 #ifdef CDC_ENABLED
                USB_Flush(CDC_TX);                              // Send a tx frame if found
 #endif
-               
+
                // check whether the one-shot period has elapsed.  if so, turn off the LED
                if (TxLEDPulse && !(--TxLEDPulse))
                        TXLED0;
@@ -663,7 +663,7 @@ void USBDevice_::attach()
        USBCON = ((1<<USBE)|(1<<OTGPADE));      // start USB clock
        UDIEN = (1<<EORSTE)|(1<<SOFE);          // Enable interrupts for EOR (End of Reset) and SOF (start of 
frame)
        UDCON = 0;                                                      // enable attach resistor
-       
+
        TX_RX_LED_INIT;
 }
 
diff --git a/hardware/arduino/cores/arduino/USBCore.h b/hardware/arduino/cores/arduino/USBCore.h
index 8d13806..0e9d8b4 100644
--- a/hardware/arduino/cores/arduino/USBCore.h
+++ b/hardware/arduino/cores/arduino/USBCore.h
@@ -1,18 +1,18 @@
 
-// Copyright (c) 2010, Peter Barrett 
+// Copyright (c) 2010, Peter Barrett
 /*
-** Permission to use, copy, modify, and/or distribute this software for  
-** any purpose with or without fee is hereby granted, provided that the  
-** above copyright notice and this permission notice appear in all copies.  
-**  
-** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL  
-** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED  
-** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR  
-** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES  
-** OR ANY DAMAGES 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.  
+** Permission to use, copy, modify, and/or distribute this software for
+** any purpose with or without fee is hereby granted, provided that the
+** above copyright notice and this permission notice appear in all copies.
+**
+** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+** OR ANY DAMAGES 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.
 */
 
 #ifndef __USBCORE_H__
@@ -117,8 +117,8 @@
 #define CDC_CS_ENDPOINT                         0x25
 #define CDC_DATA_INTERFACE_CLASS                0x0A
 
-#define MSC_SUBCLASS_SCSI                                              0x06 
-#define MSC_PROTOCOL_BULK_ONLY                                 0x50 
+#define MSC_SUBCLASS_SCSI                                              0x06
+#define MSC_PROTOCOL_BULK_ONLY                                 0x50
 
 #define HID_HID_DESCRIPTOR_TYPE                                        0x21
 #define HID_REPORT_DESCRIPTOR_TYPE                             0x22
@@ -214,7 +214,7 @@ typedef struct
        u8 d0;
 } CDCCSInterfaceDescriptor4;
 
-typedef struct 
+typedef struct
 {
     u8 len;
     u8         dtype;          // 0x24
@@ -222,8 +222,8 @@ typedef struct
     u8         bmCapabilities;
     u8         bDataInterface;
 } CMFunctionalDescriptor;
-       
-typedef struct 
+
+typedef struct
 {
     u8 len;
     u8         dtype;          // 0x24
@@ -231,13 +231,13 @@ typedef struct
     u8         bmCapabilities;
 } ACMFunctionalDescriptor;
 
-typedef struct 
+typedef struct
 {
        //      IAD
        IADDescriptor                           iad;    // Only needed on compound device
 
        //      Control
-       InterfaceDescriptor                     cif;    // 
+       InterfaceDescriptor                     cif;    //
        CDCCSInterfaceDescriptor        header;
        CMFunctionalDescriptor          callManagement;                 // Call Management
        ACMFunctionalDescriptor         controlManagement;              // ACM
@@ -250,7 +250,7 @@ typedef struct
        EndpointDescriptor                      out;
 } CDCDescriptor;
 
-typedef struct 
+typedef struct
 {
        InterfaceDescriptor                     msc;
        EndpointDescriptor                      in;
@@ -270,7 +270,7 @@ typedef struct
        u8      descLenH;
 } HIDDescDescriptor;
 
-typedef struct 
+typedef struct
 {
        InterfaceDescriptor                     hid;
        HIDDescDescriptor                       desc;
diff --git a/hardware/arduino/cores/arduino/USBDesc.h b/hardware/arduino/cores/arduino/USBDesc.h
index 900713e..fb5895a 100644
--- a/hardware/arduino/cores/arduino/USBDesc.h
+++ b/hardware/arduino/cores/arduino/USBDesc.h
@@ -1,19 +1,19 @@
 
 
-/* Copyright (c) 2011, Peter Barrett  
-**  
-** Permission to use, copy, modify, and/or distribute this software for  
-** any purpose with or without fee is hereby granted, provided that the  
-** above copyright notice and this permission notice appear in all copies.  
-** 
-** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL  
-** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED  
-** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR  
-** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES  
-** OR ANY DAMAGES 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.  
+/* Copyright (c) 2011, Peter Barrett
+**
+** Permission to use, copy, modify, and/or distribute this software for
+** any purpose with or without fee is hereby granted, provided that the
+** above copyright notice and this permission notice appear in all copies.
+**
+** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+** OR ANY DAMAGES 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.
 */
 
 #define CDC_ENABLED
diff --git a/hardware/arduino/cores/arduino/Udp.h b/hardware/arduino/cores/arduino/Udp.h
index dc5644b..94ae288 100644
--- a/hardware/arduino/cores/arduino/Udp.h
+++ b/hardware/arduino/cores/arduino/Udp.h
@@ -4,7 +4,7 @@
  * NOTE: UDP is fast, but has some important limitations (thanks to Warren Gray for mentioning these)
  * 1) UDP does not guarantee the order in which assembled UDP packets are received. This
  * might not happen often in practice, but in larger network topologies, a UDP
- * packet can be received out of sequence. 
+ * packet can be received out of sequence.
  * 2) UDP does not guard against lost packets - so packets *can* disappear without the sender being
  * aware of it. Again, this may not be a concern in practice on small local networks.
  * For more information, see http://www.cafeaulait.org/course/week12/35.html
@@ -17,10 +17,10 @@
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  * copies of the Software, and to permit persons to whom the Software is
  * furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -45,7 +45,7 @@ public:
   virtual void stop() =0;  // Finish with the UDP socket
 
   // Sending UDP packets
-  
+
   // Start building up a packet to send to the remote host specific in ip and port
   // Returns 1 if successful, 0 if there was a problem with the supplied IP address or port
   virtual int beginPacket(IPAddress ip, uint16_t port) =0;
diff --git a/hardware/arduino/cores/arduino/WCharacter.h b/hardware/arduino/cores/arduino/WCharacter.h
index 79733b5..253c550 100644
--- a/hardware/arduino/cores/arduino/WCharacter.h
+++ b/hardware/arduino/cores/arduino/WCharacter.h
@@ -1,17 +1,17 @@
 /*
  WCharacter.h - Character utility functions for Wiring & Arduino
  Copyright (c) 2010 Hernando Barragan.  All right reserved.
- 
+
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
- 
+
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
- 
+
  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
@@ -41,15 +41,15 @@ inline int toLowerCase(int c) __attribute__((always_inline));
 inline int toUpperCase(int c)__attribute__((always_inline));
 
 
-// Checks for an alphanumeric character. 
+// Checks for an alphanumeric character.
 // It is equivalent to (isalpha(c) || isdigit(c)).
-inline boolean isAlphaNumeric(int c) 
+inline boolean isAlphaNumeric(int c)
 {
   return ( isalnum(c) == 0 ? false : true);
 }
 
 
-// Checks for an alphabetic character. 
+// Checks for an alphabetic character.
 // It is equivalent to (isupper(c) || islower(c)).
 inline boolean isAlpha(int c)
 {
@@ -57,7 +57,7 @@ inline boolean isAlpha(int c)
 }
 
 
-// Checks whether c is a 7-bit unsigned char value 
+// Checks whether c is a 7-bit unsigned char value
 // that fits into the ASCII character set.
 inline boolean isAscii(int c)
 {
@@ -107,7 +107,7 @@ inline boolean isPrintable(int c)
 }
 
 
-// Checks for any printable character which is not a space 
+// Checks for any printable character which is not a space
 // or an alphanumeric character.
 inline boolean isPunct(int c)
 {
@@ -115,8 +115,8 @@ inline boolean isPunct(int c)
 }
 
 
-// Checks for white-space characters. For the avr-libc library, 
-// these are: space, formfeed ('\f'), newline ('\n'), carriage 
+// Checks for white-space characters. For the avr-libc library,
+// these are: space, formfeed ('\f'), newline ('\n'), carriage
 // return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').
 inline boolean isSpace(int c)
 {
@@ -131,7 +131,7 @@ inline boolean isUpperCase(int c)
 }
 
 
-// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7 
+// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7
 // 8 9 a b c d e f A B C D E F.
 inline boolean isHexadecimalDigit(int c)
 {
@@ -139,7 +139,7 @@ inline boolean isHexadecimalDigit(int c)
 }
 
 
-// Converts c to a 7-bit unsigned char value that fits into the 
+// Converts c to a 7-bit unsigned char value that fits into the
 // ASCII character set, by clearing the high-order bits.
 inline int toAscii(int c)
 {
@@ -148,8 +148,8 @@ inline int toAscii(int c)
 
 
 // Warning:
-// Many people will be unhappy if you use this function. 
-// This function will convert accented letters into random 
+// Many people will be unhappy if you use this function.
+// This function will convert accented letters into random
 // characters.
 
 // Converts the letter c to lower case, if possible.
diff --git a/hardware/arduino/cores/arduino/WInterrupts.c b/hardware/arduino/cores/arduino/WInterrupts.c
index d3fbf10..802f492 100644
--- a/hardware/arduino/cores/arduino/WInterrupts.c
+++ b/hardware/arduino/cores/arduino/WInterrupts.c
@@ -19,7 +19,7 @@
   Public License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place, Suite 330,
   Boston, MA  02111-1307  USA
-  
+
   Modified 24 November 2006 by David A. Mellis
   Modified 1 August 2010 by Mark Sproul
 */
@@ -38,18 +38,18 @@ static volatile voidFuncPtr intFunc[EXTERNAL_NUM_INTERRUPTS];
 void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
   if(interruptNum < EXTERNAL_NUM_INTERRUPTS) {
     intFunc[interruptNum] = userFunc;
-    
+
     // Configure the interrupt mode (trigger on low input, any change, rising
     // edge, or falling edge).  The mode constants were chosen to correspond
     // to the configuration bits in the hardware register, so we simply shift
     // the mode into place.
-      
+
     // Enable the interrupt.
-      
+
     switch (interruptNum) {
 #if defined(__AVR_ATmega32U4__)
        // I hate doing this, but the register assignment differs between the 1280/2560
-       // and the 32U4.  Since avrlib defines registers PCMSK1 and PCMSK2 that aren't 
+       // and the 32U4.  Since avrlib defines registers PCMSK1 and PCMSK2 that aren't
        // even present on the 32U4 this is the only way to distinguish between them.
     case 0:
        EICRA = (EICRA & ~((1<<ISC00) | (1<<ISC01))) | (mode << ISC00);
@@ -58,7 +58,7 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
     case 1:
        EICRA = (EICRA & ~((1<<ISC10) | (1<<ISC11))) | (mode << ISC10);
        EIMSK |= (1<<INT1);
-       break;  
+       break;
     case 2:
         EICRA = (EICRA & ~((1<<ISC20) | (1<<ISC21))) | (mode << ISC20);
         EIMSK |= (1<<INT2);
@@ -104,7 +104,7 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
       EICRB = (EICRB & ~((1 << ISC70) | (1 << ISC71))) | (mode << ISC70);
       EIMSK |= (1 << INT7);
       break;
-#else          
+#else
     case 0:
     #if defined(EICRA) && defined(ISC00) && defined(EIMSK)
       EICRA = (EICRA & ~((1 << ISC00) | (1 << ISC01))) | (mode << ISC00);
@@ -134,7 +134,7 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
       #warning attachInterrupt may need some more work for this cpu (case 1)
     #endif
       break;
-    
+
     case 2:
     #if defined(EICRA) && defined(ISC20) && defined(ISC21) && defined(EIMSK)
       EICRA = (EICRA & ~((1 << ISC20) | (1 << ISC21))) | (mode << ISC20);
@@ -155,7 +155,7 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
 void detachInterrupt(uint8_t interruptNum) {
   if(interruptNum < EXTERNAL_NUM_INTERRUPTS) {
     // Disable the interrupt.  (We can't assume that interruptNum is equal
-    // to the number of the EIMSK bit to clear, as this isn't true on the 
+    // to the number of the EIMSK bit to clear, as this isn't true on the
     // ATmega8.  There, INT0 is 6 and INT1 is 7.)
     switch (interruptNum) {
 #if defined(__AVR_ATmega32U4__)
@@ -170,10 +170,10 @@ void detachInterrupt(uint8_t interruptNum) {
         break;
     case 3:
         EIMSK &= ~(1<<INT3);
-        break; 
+        break;
     case 4:
         EIMSK &= ~(1<<INT6);
-        break; 
+        break;
 #elif defined(EICRA) && defined(EICRB) && defined(EIMSK)
     case 2:
       EIMSK &= ~(1 << INT0);
@@ -225,7 +225,7 @@ void detachInterrupt(uint8_t interruptNum) {
       break;
 #endif
     }
-      
+
     intFunc[interruptNum] = 0;
   }
 }
diff --git a/hardware/arduino/cores/arduino/WMath.cpp b/hardware/arduino/cores/arduino/WMath.cpp
index 2120c4c..f58979b 100644
--- a/hardware/arduino/cores/arduino/WMath.cpp
+++ b/hardware/arduino/cores/arduino/WMath.cpp
@@ -4,7 +4,7 @@
   Part of the Wiring project - http://wiring.org.co
   Copyright (c) 2004-06 Hernando Barragan
   Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/
-  
+
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
@@ -19,7 +19,7 @@
   Public License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place, Suite 330,
   Boston, MA  02111-1307  USA
-  
+
   $Id$
 */
 
diff --git a/hardware/arduino/cores/arduino/WString.cpp b/hardware/arduino/cores/arduino/WString.cpp
index ed880ce..db46118 100644
--- a/hardware/arduino/cores/arduino/WString.cpp
+++ b/hardware/arduino/cores/arduino/WString.cpp
@@ -214,10 +214,10 @@ void String::move(String &rhs)
 String & String::operator = (const String &rhs)
 {
        if (this == &rhs) return *this;
-       
+
        if (rhs.buffer) copy(rhs.buffer, rhs.len);
        else invalidate();
-       
+
        return *this;
 }
 
@@ -239,7 +239,7 @@ String & String::operator = (const char *cstr)
 {
        if (cstr) copy(cstr, strlen(cstr));
        else invalidate();
-       
+
        return *this;
 }
 
@@ -482,7 +482,7 @@ unsigned char String::equalsIgnoreCase( const String &s2 ) const
        const char *p2 = s2.buffer;
        while (*p1) {
                if (tolower(*p1++) != tolower(*p2++)) return 0;
-       } 
+       }
        return 1;
 }
 
@@ -513,7 +513,7 @@ char String::charAt(unsigned int loc) const
        return operator[](loc);
 }
 
-void String::setCharAt(unsigned int loc, char c) 
+void String::setCharAt(unsigned int loc, char c)
 {
        if (loc < len) buffer[loc] = c;
 }
@@ -622,7 +622,7 @@ String String::substring(unsigned int left, unsigned int right) const
        if (left > len) return out;
        if (right > len) right = len;
        char temp = buffer[right];  // save the replaced character
-       buffer[right] = '\0';   
+       buffer[right] = '\0';
        out = buffer + left;  // pointer arithmetic
        buffer[right] = temp;  //restore character
        return out;
diff --git a/hardware/arduino/cores/arduino/WString.h b/hardware/arduino/cores/arduino/WString.h
index 7402430..363000e 100644
--- a/hardware/arduino/cores/arduino/WString.h
+++ b/hardware/arduino/cores/arduino/WString.h
@@ -81,7 +81,7 @@ public:
        inline unsigned int length(void) const {return len;}
 
        // creates a copy of the assigned value.  if the value is null or
-       // invalid, or if the memory allocation fails, the string will be 
+       // invalid, or if the memory allocation fails, the string will be
        // marked as invalid ("if (s)" will be false).
        String & operator = (const String &rhs);
        String & operator = (const char *cstr);
@@ -92,10 +92,10 @@ public:
        #endif
 
        // concatenate (works w/ built-in types)
-       
+
        // returns true on success, false on failure (in which case, the string
-       // is left unchanged).  if the argument is null or invalid, the 
-       // concatenation is considered unsucessful.  
+       // is left unchanged).  if the argument is null or invalid, the
+       // concatenation is considered unsucessful.
        unsigned char concat(const String &str);
        unsigned char concat(const char *cstr);
        unsigned char concat(char c);
@@ -107,7 +107,7 @@ public:
        unsigned char concat(float num);
        unsigned char concat(double num);
        unsigned char concat(const __FlashStringHelper * str);
-       
+
        // if there's not enough memory for the concatenated value, the string
        // will be left unchanged (but this isn't signalled in any way)
        String & operator += (const String &rhs)        {concat(rhs); return (*this);}
diff --git a/hardware/arduino/cores/arduino/avr-libc/malloc.c 
b/hardware/arduino/cores/arduino/avr-libc/malloc.c
index 9dcfe21..70e5c70 100644
--- a/hardware/arduino/cores/arduino/avr-libc/malloc.c
+++ b/hardware/arduino/cores/arduino/avr-libc/malloc.c
@@ -29,8 +29,8 @@
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   POSSIBILITY OF SUCH DAMAGE.
 */
- 
- 
+
+
 /* $Id: malloc.c 2149 2010-06-09 20:45:37Z joerg_wunsch $ */
 
 #include <stdlib.h>
@@ -49,7 +49,7 @@
  * calls must not require more stack space, or they'll risk to collide
  * with the data segment.
  */
- 
+
 /* May be changed by the user only before the first malloc() call.  */
 
 size_t __malloc_margin = 128;
diff --git a/hardware/arduino/cores/arduino/main.cpp b/hardware/arduino/cores/arduino/main.cpp
index 091c365..d9413d2 100644
--- a/hardware/arduino/cores/arduino/main.cpp
+++ b/hardware/arduino/cores/arduino/main.cpp
@@ -33,14 +33,14 @@ int main(void)
 #if defined(USBCON)
        USBDevice.attach();
 #endif
-       
+
        setup();
-    
+
        for (;;) {
                loop();
                if (serialEventRun) serialEventRun();
        }
-        
+
        return 0;
 }
 
diff --git a/hardware/arduino/cores/arduino/new.cpp b/hardware/arduino/cores/arduino/new.cpp
index b81031e..51ea5a3 100644
--- a/hardware/arduino/cores/arduino/new.cpp
+++ b/hardware/arduino/cores/arduino/new.cpp
@@ -22,7 +22,7 @@ void operator delete[](void * ptr)
 
 int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);};
 void __cxa_guard_release (__guard *g) {*(char *)g = 1;};
-void __cxa_guard_abort (__guard *) {}; 
+void __cxa_guard_abort (__guard *) {};
 
 void __cxa_pure_virtual(void) {};
 
diff --git a/hardware/arduino/cores/arduino/new.h b/hardware/arduino/cores/arduino/new.h
index 991c86c..8c93ceb 100644
--- a/hardware/arduino/cores/arduino/new.h
+++ b/hardware/arduino/cores/arduino/new.h
@@ -1,5 +1,5 @@
 /* Header to define new/delete operators as they aren't provided by avr-gcc by default
-   Taken from http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453 
+   Taken from http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453
  */
 
 #ifndef NEW_H
@@ -16,7 +16,7 @@ __extension__ typedef int __guard __attribute__((mode (__DI__)));
 
 extern "C" int __cxa_guard_acquire(__guard *);
 extern "C" void __cxa_guard_release (__guard *);
-extern "C" void __cxa_guard_abort (__guard *); 
+extern "C" void __cxa_guard_abort (__guard *);
 
 extern "C" void __cxa_pure_virtual(void);
 
diff --git a/hardware/arduino/cores/arduino/wiring.c b/hardware/arduino/cores/arduino/wiring.c
index a3c4390..bea99d1 100644
--- a/hardware/arduino/cores/arduino/wiring.c
+++ b/hardware/arduino/cores/arduino/wiring.c
@@ -81,7 +81,7 @@ unsigned long millis()
 unsigned long micros() {
        unsigned long m;
        uint8_t oldSREG = SREG, t;
-       
+
        cli();
        m = timer0_overflow_count;
 #if defined(TCNT0)
@@ -92,7 +92,7 @@ unsigned long micros() {
        #error TIMER 0 not defined
 #endif
 
-  
+
 #ifdef TIFR0
        if ((TIFR0 & _BV(TOV0)) && (t < 255))
                m++;
@@ -102,7 +102,7 @@ unsigned long micros() {
 #endif
 
        SREG = oldSREG;
-       
+
        return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond());
 }
 
@@ -173,7 +173,7 @@ void delayMicroseconds(unsigned int us)
        // per iteration, so execute it twice for each microsecond of
        // delay requested.
        us <<= 1;
-    
+
        // partially compensate for the time taken by the preceeding commands.
        // we can't subtract any more than this or we'd overflow w/ small delays.
        us--;
@@ -191,14 +191,14 @@ void init()
        // this needs to be called before setup() or some functions won't
        // work there
        sei();
-       
+
        // on the ATmega168, timer 0 is also used for fast hardware pwm
        // (using phase-correct PWM would mean that timer 0 overflowed half as often
        // resulting in different millis() behavior on the ATmega8 and ATmega168)
 #if defined(TCCR0A) && defined(WGM01)
        sbi(TCCR0A, WGM01);
        sbi(TCCR0A, WGM00);
-#endif  
+#endif
 
        // set timer 0 prescale factor to 64
 #if defined(__AVR_ATmega128__)
@@ -283,7 +283,7 @@ void init()
        sbi(TCCR4B, CS42);              // set timer4 prescale factor to 64
        sbi(TCCR4B, CS41);
        sbi(TCCR4B, CS40);
-       sbi(TCCR4D, WGM40);             // put timer 4 in phase- and frequency-correct PWM mode 
+       sbi(TCCR4D, WGM40);             // put timer 4 in phase- and frequency-correct PWM mode
        sbi(TCCR4A, PWM4A);             // enable PWM mode for comparator OCR4A
        sbi(TCCR4C, PWM4D);             // enable PWM mode for comparator OCR4D
 #else /* beginning of timer4 block for ATMEGA1280 and ATMEGA2560 */
@@ -292,7 +292,7 @@ void init()
        sbi(TCCR4B, CS40);
        sbi(TCCR4A, WGM40);             // put timer 4 in 8-bit phase correct pwm mode
 #endif
-#endif /* end timer4 block for ATMEGA1280/2560 and similar */  
+#endif /* end timer4 block for ATMEGA1280/2560 and similar */
 
 #if defined(TCCR5B) && defined(CS51) && defined(WGM50)
        sbi(TCCR5B, CS51);              // set timer 5 prescale factor to 64
diff --git a/hardware/arduino/cores/arduino/wiring_analog.c b/hardware/arduino/cores/arduino/wiring_analog.c
index 8feead9..3750f1f 100644
--- a/hardware/arduino/cores/arduino/wiring_analog.c
+++ b/hardware/arduino/cores/arduino/wiring_analog.c
@@ -61,7 +61,7 @@ int analogRead(uint8_t pin)
        // 0 to 7 (MUX5 low) or 8 to 15 (MUX5 high).
        ADCSRB = (ADCSRB & ~(1 << MUX5)) | (((pin >> 3) & 0x01) << MUX5);
 #endif
-  
+
        // set the analog reference (high two bits of ADMUX) and select the
        // channel (low 4 bits).  this also sets ADLAR (left-adjust result)
        // to 0 (the default).
@@ -218,7 +218,7 @@ void analogWrite(uint8_t pin, int val)
                                OCR4A = val;    // set pwm duty
                                break;
                        #endif
-                       
+
                        #if defined(TCCR4A) && defined(COM4B1)
                        case TIMER4B:
                                // connect pwm to pin on timer 4, channel B
@@ -234,9 +234,9 @@ void analogWrite(uint8_t pin, int val)
                                OCR4C = val; // set pwm duty
                                break;
                        #endif
-                               
+
                        #if defined(TCCR4C) && defined(COM4D1)
-                       case TIMER4D:                           
+                       case TIMER4D:
                                // connect pwm to pin on timer 4, channel D
                                sbi(TCCR4C, COM4D1);
                                #if defined(COM4D0)             // only used on 32U4
@@ -246,7 +246,7 @@ void analogWrite(uint8_t pin, int val)
                                break;
                        #endif
 
-                                                       
+
                        #if defined(TCCR5A) && defined(COM5A1)
                        case TIMER5A:
                                // connect pwm to pin on timer 5, channel A
diff --git a/hardware/arduino/cores/arduino/wiring_digital.c b/hardware/arduino/cores/arduino/wiring_digital.c
index be323b1..c231854 100644
--- a/hardware/arduino/cores/arduino/wiring_digital.c
+++ b/hardware/arduino/cores/arduino/wiring_digital.c
@@ -40,7 +40,7 @@ void pinMode(uint8_t pin, uint8_t mode)
        reg = portModeRegister(port);
        out = portOutputRegister(port);
 
-       if (mode == INPUT) { 
+       if (mode == INPUT) {
                uint8_t oldSREG = SREG;
                 cli();
                *reg &= ~bit;
@@ -84,15 +84,15 @@ static void turnOffPWM(uint8_t timer)
                #if defined(TCCR1A) && defined(COM1B1)
                case TIMER1B:   cbi(TCCR1A, COM1B1);    break;
                #endif
-               
+
                #if defined(TCCR2) && defined(COM21)
                case  TIMER2:   cbi(TCCR2, COM21);      break;
                #endif
-               
+
                #if defined(TCCR0A) && defined(COM0A1)
                case  TIMER0A:  cbi(TCCR0A, COM0A1);    break;
                #endif
-               
+
                #if defined(TIMER0B) && defined(COM0B1)
                case  TIMER0B:  cbi(TCCR0A, COM0B1);    break;
                #endif
@@ -102,7 +102,7 @@ static void turnOffPWM(uint8_t timer)
                #if defined(TCCR2A) && defined(COM2B1)
                case  TIMER2B:  cbi(TCCR2A, COM2B1);    break;
                #endif
-               
+
                #if defined(TCCR3A) && defined(COM3A1)
                case  TIMER3A:  cbi(TCCR3A, COM3A1);    break;
                #endif
@@ -115,17 +115,17 @@ static void turnOffPWM(uint8_t timer)
 
                #if defined(TCCR4A) && defined(COM4A1)
                case  TIMER4A:  cbi(TCCR4A, COM4A1);    break;
-               #endif                                  
+               #endif
                #if defined(TCCR4A) && defined(COM4B1)
                case  TIMER4B:  cbi(TCCR4A, COM4B1);    break;
                #endif
                #if defined(TCCR4A) && defined(COM4C1)
                case  TIMER4C:  cbi(TCCR4A, COM4C1);    break;
-               #endif                  
+               #endif
                #if defined(TCCR4C) && defined(COM4D1)
                case TIMER4D:   cbi(TCCR4C, COM4D1);    break;
-               #endif                  
-                       
+               #endif
+
                #if defined(TCCR5A)
                case  TIMER5A:  cbi(TCCR5A, COM5A1);    break;
                case  TIMER5B:  cbi(TCCR5A, COM5B1);    break;
diff --git a/hardware/arduino/cores/arduino/wiring_pulse.c b/hardware/arduino/cores/arduino/wiring_pulse.c
index 0d96886..c1095d6 100644
--- a/hardware/arduino/cores/arduino/wiring_pulse.c
+++ b/hardware/arduino/cores/arduino/wiring_pulse.c
@@ -38,22 +38,22 @@ unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout)
        uint8_t port = digitalPinToPort(pin);
        uint8_t stateMask = (state ? bit : 0);
        unsigned long width = 0; // keep initialization out of time critical area
-       
+
        // convert the timeout from microseconds to a number of times through
        // the initial loop; it takes 16 clock cycles per iteration.
        unsigned long numloops = 0;
        unsigned long maxloops = microsecondsToClockCycles(timeout) / 16;
-       
+
        // wait for any previous pulse to end
        while ((*portInputRegister(port) & bit) == stateMask)
                if (numloops++ == maxloops)
                        return 0;
-       
+
        // wait for the pulse to start
        while ((*portInputRegister(port) & bit) != stateMask)
                if (numloops++ == maxloops)
                        return 0;
-       
+
        // wait for the pulse to stop
        while ((*portInputRegister(port) & bit) == stateMask) {
                if (numloops++ == maxloops)
@@ -65,5 +65,5 @@ unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout)
        // to be 20 clock cycles long and have about 16 clocks between the edge
        // and the start of the loop. There will be some error introduced by
        // the interrupt handlers.
-       return clockCyclesToMicroseconds(width * 21 + 16); 
+       return clockCyclesToMicroseconds(width * 21 + 16);
 }
diff --git a/hardware/arduino/cores/arduino/wiring_shift.c b/hardware/arduino/cores/arduino/wiring_shift.c
index cfe7867..b9bb934 100644
--- a/hardware/arduino/cores/arduino/wiring_shift.c
+++ b/hardware/arduino/cores/arduino/wiring_shift.c
@@ -46,10 +46,10 @@ void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
        for (i = 0; i < 8; i++)  {
                if (bitOrder == LSBFIRST)
                        digitalWrite(dataPin, !!(val & (1 << i)));
-               else    
+               else
                        digitalWrite(dataPin, !!(val & (1 << (7 - i))));
-                       
+
                digitalWrite(clockPin, HIGH);
-               digitalWrite(clockPin, LOW);            
+               digitalWrite(clockPin, LOW);
        }
 }
diff --git a/hardware/arduino/firmwares/atmegaxxu2/README.txt 
b/hardware/arduino/firmwares/atmegaxxu2/README.txt
index 386dcf0..6f31716 100644
--- a/hardware/arduino/firmwares/atmegaxxu2/README.txt
+++ b/hardware/arduino/firmwares/atmegaxxu2/README.txt
@@ -5,7 +5,7 @@ Uno and Arduino Mega 2560.  The arduino-usbdfu directory contains the DFU
 bootloader on the 8U2; the arduino-usbserial directory contains the actual
 usb to serial firmware.  Both should be compiled against LUFA 100807.  The
 two .hex files in this directory combine the dfu and serial firmwares into
-a single file to burn onto the 8U2.  
+a single file to burn onto the 8U2.
 
 To burn (Uno):
 avrdude -p at90usb82 -F -P usb -c avrispmkii -U flash:w:UNO-dfu_and_usbserial_combined.hex -U lfuse:w:0xFF:m 
-U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m
diff --git a/hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/readme.txt 
b/hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/readme.txt
index e376679..04664cc 100644
--- a/hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/readme.txt
+++ b/hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/readme.txt
@@ -1,6 +1,6 @@
 To setup the project and program an ATMEG8U2 with the Arduino USB DFU bootloader:
 1. unpack the source into LUFA's Bootloader directory
-2. set ARDUINO_MODEL_PID in the makefile as appropriate 
+2. set ARDUINO_MODEL_PID in the makefile as appropriate
 3. do "make clean; make; make program"
 
 Check that the board enumerates as either "Arduino Uno DFU" or "Arduino Mega 2560 DFU".  Test by uploading 
the Arduino-usbserial application firmware (see instructions in Arduino-usbserial directory)
diff --git a/hardware/arduino/variants/leonardo/pins_arduino.h 
b/hardware/arduino/variants/leonardo/pins_arduino.h
index fd75373..2595bc5 100644
--- a/hardware/arduino/variants/leonardo/pins_arduino.h
+++ b/hardware/arduino/variants/leonardo/pins_arduino.h
@@ -219,26 +219,26 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
        PC, // D5 - PC6
        PD, // D6 - PD7
        PE, // D7 - PE6
-       
+
        PB, // D8 - PB4
        PB,     // D9 - PB5
        PB, // D10 - PB6
        PB,     // D11 - PB7
        PD, // D12 - PD6
        PC, // D13 - PC7
-       
+
        PB,     // D14 - MISO - PB3
        PB,     // D15 - SCK - PB1
        PB,     // D16 - MOSI - PB2
        PB,     // D17 - SS - PB0
-       
+
        PF,     // D18 - A0 - PF7
        PF, // D19 - A1 - PF6
        PF, // D20 - A2 - PF5
        PF, // D21 - A3 - PF4
        PF, // D22 - A4 - PF1
        PF, // D23 - A5 - PF0
-       
+
        PD, // D24 / D4 - A6 - PD4
        PD, // D25 / D6 - A7 - PD7
        PB, // D26 / D8 - A8 - PB4
@@ -256,26 +256,26 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
        _BV(6), // D5 - PC6
        _BV(7), // D6 - PD7
        _BV(6), // D7 - PE6
-       
+
        _BV(4), // D8 - PB4
        _BV(5), // D9 - PB5
        _BV(6), // D10 - PB6
        _BV(7), // D11 - PB7
        _BV(6), // D12 - PD6
        _BV(7), // D13 - PC7
-       
+
        _BV(3), // D14 - MISO - PB3
        _BV(1), // D15 - SCK - PB1
        _BV(2), // D16 - MOSI - PB2
        _BV(0), // D17 - SS - PB0
-       
+
        _BV(7), // D18 - A0 - PF7
        _BV(6), // D19 - A1 - PF6
        _BV(5), // D20 - A2 - PF5
        _BV(4), // D21 - A3 - PF4
        _BV(1), // D22 - A4 - PF1
        _BV(0), // D23 - A5 - PF0
-       
+
        _BV(4), // D24 / D4 - A6 - PD4
        _BV(7), // D25 / D6 - A7 - PD7
        _BV(4), // D26 / D8 - A8 - PB4
@@ -285,24 +285,24 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
 };
 
 const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
-       NOT_ON_TIMER,   
+       NOT_ON_TIMER,
        NOT_ON_TIMER,
        NOT_ON_TIMER,
        TIMER0B,                /* 3 */
        NOT_ON_TIMER,
        TIMER3A,                /* 5 */
        TIMER4D,                /* 6 */
-       NOT_ON_TIMER,   
-       
-       NOT_ON_TIMER,   
+       NOT_ON_TIMER,
+
+       NOT_ON_TIMER,
        TIMER1A,                /* 9 */
        TIMER1B,                /* 10 */
        TIMER0A,                /* 11 */
-       
-       NOT_ON_TIMER,   
+
+       NOT_ON_TIMER,
        TIMER4A,                /* 13 */
-       
-       NOT_ON_TIMER,   
+
+       NOT_ON_TIMER,
        NOT_ON_TIMER,
        NOT_ON_TIMER,
        NOT_ON_TIMER,
@@ -323,11 +323,11 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
 
 const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
        7,      // A0                           PF7                                     ADC7
-       6,      // A1                           PF6                                     ADC6    
-       5,      // A2                           PF5                                     ADC5    
+       6,      // A1                           PF6                                     ADC6
+       5,      // A2                           PF5                                     ADC5
        4,      // A3                           PF4                                     ADC4
-       1,      // A4                           PF1                                     ADC1    
-       0,      // A5                           PF0                                     ADC0    
+       1,      // A4                           PF1                                     ADC1
+       0,      // A5                           PF0                                     ADC0
        8,      // A6           D4              PD4                                     ADC8
        10,     // A7           D6              PD7                                     ADC10
        11,     // A8           D8              PB4                                     ADC11
diff --git a/hardware/arduino/variants/mega/pins_arduino.h b/hardware/arduino/variants/mega/pins_arduino.h
index a80991b..a9254da 100644
--- a/hardware/arduino/variants/mega/pins_arduino.h
+++ b/hardware/arduino/variants/mega/pins_arduino.h
@@ -136,228 +136,228 @@ const uint16_t PROGMEM port_to_input_PGM[] = {
 };
 
 const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
-       // PORTLIST             
-       // -------------------------------------------          
-       PE      , // PE 0 ** 0 ** USART0_RX     
-       PE      , // PE 1 ** 1 ** USART0_TX     
-       PE      , // PE 4 ** 2 ** PWM2  
-       PE      , // PE 5 ** 3 ** PWM3  
-       PG      , // PG 5 ** 4 ** PWM4  
-       PE      , // PE 3 ** 5 ** PWM5  
-       PH      , // PH 3 ** 6 ** PWM6  
-       PH      , // PH 4 ** 7 ** PWM7  
-       PH      , // PH 5 ** 8 ** PWM8  
-       PH      , // PH 6 ** 9 ** PWM9  
-       PB      , // PB 4 ** 10 ** PWM10        
-       PB      , // PB 5 ** 11 ** PWM11        
-       PB      , // PB 6 ** 12 ** PWM12        
-       PB      , // PB 7 ** 13 ** PWM13        
-       PJ      , // PJ 1 ** 14 ** USART3_TX    
-       PJ      , // PJ 0 ** 15 ** USART3_RX    
-       PH      , // PH 1 ** 16 ** USART2_TX    
-       PH      , // PH 0 ** 17 ** USART2_RX    
-       PD      , // PD 3 ** 18 ** USART1_TX    
-       PD      , // PD 2 ** 19 ** USART1_RX    
-       PD      , // PD 1 ** 20 ** I2C_SDA      
-       PD      , // PD 0 ** 21 ** I2C_SCL      
-       PA      , // PA 0 ** 22 ** D22  
-       PA      , // PA 1 ** 23 ** D23  
-       PA      , // PA 2 ** 24 ** D24  
-       PA      , // PA 3 ** 25 ** D25  
-       PA      , // PA 4 ** 26 ** D26  
-       PA      , // PA 5 ** 27 ** D27  
-       PA      , // PA 6 ** 28 ** D28  
-       PA      , // PA 7 ** 29 ** D29  
-       PC      , // PC 7 ** 30 ** D30  
-       PC      , // PC 6 ** 31 ** D31  
-       PC      , // PC 5 ** 32 ** D32  
-       PC      , // PC 4 ** 33 ** D33  
-       PC      , // PC 3 ** 34 ** D34  
-       PC      , // PC 2 ** 35 ** D35  
-       PC      , // PC 1 ** 36 ** D36  
-       PC      , // PC 0 ** 37 ** D37  
-       PD      , // PD 7 ** 38 ** D38  
-       PG      , // PG 2 ** 39 ** D39  
-       PG      , // PG 1 ** 40 ** D40  
-       PG      , // PG 0 ** 41 ** D41  
-       PL      , // PL 7 ** 42 ** D42  
-       PL      , // PL 6 ** 43 ** D43  
-       PL      , // PL 5 ** 44 ** D44  
-       PL      , // PL 4 ** 45 ** D45  
-       PL      , // PL 3 ** 46 ** D46  
-       PL      , // PL 2 ** 47 ** D47  
-       PL      , // PL 1 ** 48 ** D48  
-       PL      , // PL 0 ** 49 ** D49  
-       PB      , // PB 3 ** 50 ** SPI_MISO     
-       PB      , // PB 2 ** 51 ** SPI_MOSI     
-       PB      , // PB 1 ** 52 ** SPI_SCK      
-       PB      , // PB 0 ** 53 ** SPI_SS       
-       PF      , // PF 0 ** 54 ** A0   
-       PF      , // PF 1 ** 55 ** A1   
-       PF      , // PF 2 ** 56 ** A2   
-       PF      , // PF 3 ** 57 ** A3   
-       PF      , // PF 4 ** 58 ** A4   
-       PF      , // PF 5 ** 59 ** A5   
-       PF      , // PF 6 ** 60 ** A6   
-       PF      , // PF 7 ** 61 ** A7   
-       PK      , // PK 0 ** 62 ** A8   
-       PK      , // PK 1 ** 63 ** A9   
-       PK      , // PK 2 ** 64 ** A10  
-       PK      , // PK 3 ** 65 ** A11  
-       PK      , // PK 4 ** 66 ** A12  
-       PK      , // PK 5 ** 67 ** A13  
-       PK      , // PK 6 ** 68 ** A14  
-       PK      , // PK 7 ** 69 ** A15  
+       // PORTLIST
+       // -------------------------------------------
+       PE      , // PE 0 ** 0 ** USART0_RX
+       PE      , // PE 1 ** 1 ** USART0_TX
+       PE      , // PE 4 ** 2 ** PWM2
+       PE      , // PE 5 ** 3 ** PWM3
+       PG      , // PG 5 ** 4 ** PWM4
+       PE      , // PE 3 ** 5 ** PWM5
+       PH      , // PH 3 ** 6 ** PWM6
+       PH      , // PH 4 ** 7 ** PWM7
+       PH      , // PH 5 ** 8 ** PWM8
+       PH      , // PH 6 ** 9 ** PWM9
+       PB      , // PB 4 ** 10 ** PWM10
+       PB      , // PB 5 ** 11 ** PWM11
+       PB      , // PB 6 ** 12 ** PWM12
+       PB      , // PB 7 ** 13 ** PWM13
+       PJ      , // PJ 1 ** 14 ** USART3_TX
+       PJ      , // PJ 0 ** 15 ** USART3_RX
+       PH      , // PH 1 ** 16 ** USART2_TX
+       PH      , // PH 0 ** 17 ** USART2_RX
+       PD      , // PD 3 ** 18 ** USART1_TX
+       PD      , // PD 2 ** 19 ** USART1_RX
+       PD      , // PD 1 ** 20 ** I2C_SDA
+       PD      , // PD 0 ** 21 ** I2C_SCL
+       PA      , // PA 0 ** 22 ** D22
+       PA      , // PA 1 ** 23 ** D23
+       PA      , // PA 2 ** 24 ** D24
+       PA      , // PA 3 ** 25 ** D25
+       PA      , // PA 4 ** 26 ** D26
+       PA      , // PA 5 ** 27 ** D27
+       PA      , // PA 6 ** 28 ** D28
+       PA      , // PA 7 ** 29 ** D29
+       PC      , // PC 7 ** 30 ** D30
+       PC      , // PC 6 ** 31 ** D31
+       PC      , // PC 5 ** 32 ** D32
+       PC      , // PC 4 ** 33 ** D33
+       PC      , // PC 3 ** 34 ** D34
+       PC      , // PC 2 ** 35 ** D35
+       PC      , // PC 1 ** 36 ** D36
+       PC      , // PC 0 ** 37 ** D37
+       PD      , // PD 7 ** 38 ** D38
+       PG      , // PG 2 ** 39 ** D39
+       PG      , // PG 1 ** 40 ** D40
+       PG      , // PG 0 ** 41 ** D41
+       PL      , // PL 7 ** 42 ** D42
+       PL      , // PL 6 ** 43 ** D43
+       PL      , // PL 5 ** 44 ** D44
+       PL      , // PL 4 ** 45 ** D45
+       PL      , // PL 3 ** 46 ** D46
+       PL      , // PL 2 ** 47 ** D47
+       PL      , // PL 1 ** 48 ** D48
+       PL      , // PL 0 ** 49 ** D49
+       PB      , // PB 3 ** 50 ** SPI_MISO
+       PB      , // PB 2 ** 51 ** SPI_MOSI
+       PB      , // PB 1 ** 52 ** SPI_SCK
+       PB      , // PB 0 ** 53 ** SPI_SS
+       PF      , // PF 0 ** 54 ** A0
+       PF      , // PF 1 ** 55 ** A1
+       PF      , // PF 2 ** 56 ** A2
+       PF      , // PF 3 ** 57 ** A3
+       PF      , // PF 4 ** 58 ** A4
+       PF      , // PF 5 ** 59 ** A5
+       PF      , // PF 6 ** 60 ** A6
+       PF      , // PF 7 ** 61 ** A7
+       PK      , // PK 0 ** 62 ** A8
+       PK      , // PK 1 ** 63 ** A9
+       PK      , // PK 2 ** 64 ** A10
+       PK      , // PK 3 ** 65 ** A11
+       PK      , // PK 4 ** 66 ** A12
+       PK      , // PK 5 ** 67 ** A13
+       PK      , // PK 6 ** 68 ** A14
+       PK      , // PK 7 ** 69 ** A15
 };
 
 const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
-       // PIN IN PORT          
-       // -------------------------------------------          
-       _BV( 0 )        , // PE 0 ** 0 ** USART0_RX     
-       _BV( 1 )        , // PE 1 ** 1 ** USART0_TX     
-       _BV( 4 )        , // PE 4 ** 2 ** PWM2  
-       _BV( 5 )        , // PE 5 ** 3 ** PWM3  
-       _BV( 5 )        , // PG 5 ** 4 ** PWM4  
-       _BV( 3 )        , // PE 3 ** 5 ** PWM5  
-       _BV( 3 )        , // PH 3 ** 6 ** PWM6  
-       _BV( 4 )        , // PH 4 ** 7 ** PWM7  
-       _BV( 5 )        , // PH 5 ** 8 ** PWM8  
-       _BV( 6 )        , // PH 6 ** 9 ** PWM9  
-       _BV( 4 )        , // PB 4 ** 10 ** PWM10        
-       _BV( 5 )        , // PB 5 ** 11 ** PWM11        
-       _BV( 6 )        , // PB 6 ** 12 ** PWM12        
-       _BV( 7 )        , // PB 7 ** 13 ** PWM13        
-       _BV( 1 )        , // PJ 1 ** 14 ** USART3_TX    
-       _BV( 0 )        , // PJ 0 ** 15 ** USART3_RX    
-       _BV( 1 )        , // PH 1 ** 16 ** USART2_TX    
-       _BV( 0 )        , // PH 0 ** 17 ** USART2_RX    
-       _BV( 3 )        , // PD 3 ** 18 ** USART1_TX    
-       _BV( 2 )        , // PD 2 ** 19 ** USART1_RX    
-       _BV( 1 )        , // PD 1 ** 20 ** I2C_SDA      
-       _BV( 0 )        , // PD 0 ** 21 ** I2C_SCL      
-       _BV( 0 )        , // PA 0 ** 22 ** D22  
-       _BV( 1 )        , // PA 1 ** 23 ** D23  
-       _BV( 2 )        , // PA 2 ** 24 ** D24  
-       _BV( 3 )        , // PA 3 ** 25 ** D25  
-       _BV( 4 )        , // PA 4 ** 26 ** D26  
-       _BV( 5 )        , // PA 5 ** 27 ** D27  
-       _BV( 6 )        , // PA 6 ** 28 ** D28  
-       _BV( 7 )        , // PA 7 ** 29 ** D29  
-       _BV( 7 )        , // PC 7 ** 30 ** D30  
-       _BV( 6 )        , // PC 6 ** 31 ** D31  
-       _BV( 5 )        , // PC 5 ** 32 ** D32  
-       _BV( 4 )        , // PC 4 ** 33 ** D33  
-       _BV( 3 )        , // PC 3 ** 34 ** D34  
-       _BV( 2 )        , // PC 2 ** 35 ** D35  
-       _BV( 1 )        , // PC 1 ** 36 ** D36  
-       _BV( 0 )        , // PC 0 ** 37 ** D37  
-       _BV( 7 )        , // PD 7 ** 38 ** D38  
-       _BV( 2 )        , // PG 2 ** 39 ** D39  
-       _BV( 1 )        , // PG 1 ** 40 ** D40  
-       _BV( 0 )        , // PG 0 ** 41 ** D41  
-       _BV( 7 )        , // PL 7 ** 42 ** D42  
-       _BV( 6 )        , // PL 6 ** 43 ** D43  
-       _BV( 5 )        , // PL 5 ** 44 ** D44  
-       _BV( 4 )        , // PL 4 ** 45 ** D45  
-       _BV( 3 )        , // PL 3 ** 46 ** D46  
-       _BV( 2 )        , // PL 2 ** 47 ** D47  
-       _BV( 1 )        , // PL 1 ** 48 ** D48  
-       _BV( 0 )        , // PL 0 ** 49 ** D49  
-       _BV( 3 )        , // PB 3 ** 50 ** SPI_MISO     
-       _BV( 2 )        , // PB 2 ** 51 ** SPI_MOSI     
-       _BV( 1 )        , // PB 1 ** 52 ** SPI_SCK      
-       _BV( 0 )        , // PB 0 ** 53 ** SPI_SS       
-       _BV( 0 )        , // PF 0 ** 54 ** A0   
-       _BV( 1 )        , // PF 1 ** 55 ** A1   
-       _BV( 2 )        , // PF 2 ** 56 ** A2   
-       _BV( 3 )        , // PF 3 ** 57 ** A3   
-       _BV( 4 )        , // PF 4 ** 58 ** A4   
-       _BV( 5 )        , // PF 5 ** 59 ** A5   
-       _BV( 6 )        , // PF 6 ** 60 ** A6   
-       _BV( 7 )        , // PF 7 ** 61 ** A7   
-       _BV( 0 )        , // PK 0 ** 62 ** A8   
-       _BV( 1 )        , // PK 1 ** 63 ** A9   
-       _BV( 2 )        , // PK 2 ** 64 ** A10  
-       _BV( 3 )        , // PK 3 ** 65 ** A11  
-       _BV( 4 )        , // PK 4 ** 66 ** A12  
-       _BV( 5 )        , // PK 5 ** 67 ** A13  
-       _BV( 6 )        , // PK 6 ** 68 ** A14  
-       _BV( 7 )        , // PK 7 ** 69 ** A15  
+       // PIN IN PORT
+       // -------------------------------------------
+       _BV( 0 )        , // PE 0 ** 0 ** USART0_RX
+       _BV( 1 )        , // PE 1 ** 1 ** USART0_TX
+       _BV( 4 )        , // PE 4 ** 2 ** PWM2
+       _BV( 5 )        , // PE 5 ** 3 ** PWM3
+       _BV( 5 )        , // PG 5 ** 4 ** PWM4
+       _BV( 3 )        , // PE 3 ** 5 ** PWM5
+       _BV( 3 )        , // PH 3 ** 6 ** PWM6
+       _BV( 4 )        , // PH 4 ** 7 ** PWM7
+       _BV( 5 )        , // PH 5 ** 8 ** PWM8
+       _BV( 6 )        , // PH 6 ** 9 ** PWM9
+       _BV( 4 )        , // PB 4 ** 10 ** PWM10
+       _BV( 5 )        , // PB 5 ** 11 ** PWM11
+       _BV( 6 )        , // PB 6 ** 12 ** PWM12
+       _BV( 7 )        , // PB 7 ** 13 ** PWM13
+       _BV( 1 )        , // PJ 1 ** 14 ** USART3_TX
+       _BV( 0 )        , // PJ 0 ** 15 ** USART3_RX
+       _BV( 1 )        , // PH 1 ** 16 ** USART2_TX
+       _BV( 0 )        , // PH 0 ** 17 ** USART2_RX
+       _BV( 3 )        , // PD 3 ** 18 ** USART1_TX
+       _BV( 2 )        , // PD 2 ** 19 ** USART1_RX
+       _BV( 1 )        , // PD 1 ** 20 ** I2C_SDA
+       _BV( 0 )        , // PD 0 ** 21 ** I2C_SCL
+       _BV( 0 )        , // PA 0 ** 22 ** D22
+       _BV( 1 )        , // PA 1 ** 23 ** D23
+       _BV( 2 )        , // PA 2 ** 24 ** D24
+       _BV( 3 )        , // PA 3 ** 25 ** D25
+       _BV( 4 )        , // PA 4 ** 26 ** D26
+       _BV( 5 )        , // PA 5 ** 27 ** D27
+       _BV( 6 )        , // PA 6 ** 28 ** D28
+       _BV( 7 )        , // PA 7 ** 29 ** D29
+       _BV( 7 )        , // PC 7 ** 30 ** D30
+       _BV( 6 )        , // PC 6 ** 31 ** D31
+       _BV( 5 )        , // PC 5 ** 32 ** D32
+       _BV( 4 )        , // PC 4 ** 33 ** D33
+       _BV( 3 )        , // PC 3 ** 34 ** D34
+       _BV( 2 )        , // PC 2 ** 35 ** D35
+       _BV( 1 )        , // PC 1 ** 36 ** D36
+       _BV( 0 )        , // PC 0 ** 37 ** D37
+       _BV( 7 )        , // PD 7 ** 38 ** D38
+       _BV( 2 )        , // PG 2 ** 39 ** D39
+       _BV( 1 )        , // PG 1 ** 40 ** D40
+       _BV( 0 )        , // PG 0 ** 41 ** D41
+       _BV( 7 )        , // PL 7 ** 42 ** D42
+       _BV( 6 )        , // PL 6 ** 43 ** D43
+       _BV( 5 )        , // PL 5 ** 44 ** D44
+       _BV( 4 )        , // PL 4 ** 45 ** D45
+       _BV( 3 )        , // PL 3 ** 46 ** D46
+       _BV( 2 )        , // PL 2 ** 47 ** D47
+       _BV( 1 )        , // PL 1 ** 48 ** D48
+       _BV( 0 )        , // PL 0 ** 49 ** D49
+       _BV( 3 )        , // PB 3 ** 50 ** SPI_MISO
+       _BV( 2 )        , // PB 2 ** 51 ** SPI_MOSI
+       _BV( 1 )        , // PB 1 ** 52 ** SPI_SCK
+       _BV( 0 )        , // PB 0 ** 53 ** SPI_SS
+       _BV( 0 )        , // PF 0 ** 54 ** A0
+       _BV( 1 )        , // PF 1 ** 55 ** A1
+       _BV( 2 )        , // PF 2 ** 56 ** A2
+       _BV( 3 )        , // PF 3 ** 57 ** A3
+       _BV( 4 )        , // PF 4 ** 58 ** A4
+       _BV( 5 )        , // PF 5 ** 59 ** A5
+       _BV( 6 )        , // PF 6 ** 60 ** A6
+       _BV( 7 )        , // PF 7 ** 61 ** A7
+       _BV( 0 )        , // PK 0 ** 62 ** A8
+       _BV( 1 )        , // PK 1 ** 63 ** A9
+       _BV( 2 )        , // PK 2 ** 64 ** A10
+       _BV( 3 )        , // PK 3 ** 65 ** A11
+       _BV( 4 )        , // PK 4 ** 66 ** A12
+       _BV( 5 )        , // PK 5 ** 67 ** A13
+       _BV( 6 )        , // PK 6 ** 68 ** A14
+       _BV( 7 )        , // PK 7 ** 69 ** A15
 };
 
 const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
-       // TIMERS               
-       // -------------------------------------------          
-       NOT_ON_TIMER    , // PE 0 ** 0 ** USART0_RX     
-       NOT_ON_TIMER    , // PE 1 ** 1 ** USART0_TX     
-       TIMER3B , // PE 4 ** 2 ** PWM2  
-       TIMER3C , // PE 5 ** 3 ** PWM3  
-       TIMER0B , // PG 5 ** 4 ** PWM4  
-       TIMER3A , // PE 3 ** 5 ** PWM5  
-       TIMER4A , // PH 3 ** 6 ** PWM6  
-       TIMER4B , // PH 4 ** 7 ** PWM7  
-       TIMER4C , // PH 5 ** 8 ** PWM8  
-       TIMER2B , // PH 6 ** 9 ** PWM9  
-       TIMER2A , // PB 4 ** 10 ** PWM10        
-       TIMER1A , // PB 5 ** 11 ** PWM11        
-       TIMER1B , // PB 6 ** 12 ** PWM12        
-       TIMER0A , // PB 7 ** 13 ** PWM13        
-       NOT_ON_TIMER    , // PJ 1 ** 14 ** USART3_TX    
-       NOT_ON_TIMER    , // PJ 0 ** 15 ** USART3_RX    
-       NOT_ON_TIMER    , // PH 1 ** 16 ** USART2_TX    
-       NOT_ON_TIMER    , // PH 0 ** 17 ** USART2_RX    
-       NOT_ON_TIMER    , // PD 3 ** 18 ** USART1_TX    
-       NOT_ON_TIMER    , // PD 2 ** 19 ** USART1_RX    
-       NOT_ON_TIMER    , // PD 1 ** 20 ** I2C_SDA      
-       NOT_ON_TIMER    , // PD 0 ** 21 ** I2C_SCL      
-       NOT_ON_TIMER    , // PA 0 ** 22 ** D22  
-       NOT_ON_TIMER    , // PA 1 ** 23 ** D23  
-       NOT_ON_TIMER    , // PA 2 ** 24 ** D24  
-       NOT_ON_TIMER    , // PA 3 ** 25 ** D25  
-       NOT_ON_TIMER    , // PA 4 ** 26 ** D26  
-       NOT_ON_TIMER    , // PA 5 ** 27 ** D27  
-       NOT_ON_TIMER    , // PA 6 ** 28 ** D28  
-       NOT_ON_TIMER    , // PA 7 ** 29 ** D29  
-       NOT_ON_TIMER    , // PC 7 ** 30 ** D30  
-       NOT_ON_TIMER    , // PC 6 ** 31 ** D31  
-       NOT_ON_TIMER    , // PC 5 ** 32 ** D32  
-       NOT_ON_TIMER    , // PC 4 ** 33 ** D33  
-       NOT_ON_TIMER    , // PC 3 ** 34 ** D34  
-       NOT_ON_TIMER    , // PC 2 ** 35 ** D35  
-       NOT_ON_TIMER    , // PC 1 ** 36 ** D36  
-       NOT_ON_TIMER    , // PC 0 ** 37 ** D37  
-       NOT_ON_TIMER    , // PD 7 ** 38 ** D38  
-       NOT_ON_TIMER    , // PG 2 ** 39 ** D39  
-       NOT_ON_TIMER    , // PG 1 ** 40 ** D40  
-       NOT_ON_TIMER    , // PG 0 ** 41 ** D41  
-       NOT_ON_TIMER    , // PL 7 ** 42 ** D42  
-       NOT_ON_TIMER    , // PL 6 ** 43 ** D43  
-       TIMER5C , // PL 5 ** 44 ** D44  
-       TIMER5B , // PL 4 ** 45 ** D45  
-       TIMER5A , // PL 3 ** 46 ** D46  
-       NOT_ON_TIMER    , // PL 2 ** 47 ** D47  
-       NOT_ON_TIMER    , // PL 1 ** 48 ** D48  
-       NOT_ON_TIMER    , // PL 0 ** 49 ** D49  
-       NOT_ON_TIMER    , // PB 3 ** 50 ** SPI_MISO     
-       NOT_ON_TIMER    , // PB 2 ** 51 ** SPI_MOSI     
-       NOT_ON_TIMER    , // PB 1 ** 52 ** SPI_SCK      
-       NOT_ON_TIMER    , // PB 0 ** 53 ** SPI_SS       
-       NOT_ON_TIMER    , // PF 0 ** 54 ** A0   
-       NOT_ON_TIMER    , // PF 1 ** 55 ** A1   
-       NOT_ON_TIMER    , // PF 2 ** 56 ** A2   
-       NOT_ON_TIMER    , // PF 3 ** 57 ** A3   
-       NOT_ON_TIMER    , // PF 4 ** 58 ** A4   
-       NOT_ON_TIMER    , // PF 5 ** 59 ** A5   
-       NOT_ON_TIMER    , // PF 6 ** 60 ** A6   
-       NOT_ON_TIMER    , // PF 7 ** 61 ** A7   
-       NOT_ON_TIMER    , // PK 0 ** 62 ** A8   
-       NOT_ON_TIMER    , // PK 1 ** 63 ** A9   
-       NOT_ON_TIMER    , // PK 2 ** 64 ** A10  
-       NOT_ON_TIMER    , // PK 3 ** 65 ** A11  
-       NOT_ON_TIMER    , // PK 4 ** 66 ** A12  
-       NOT_ON_TIMER    , // PK 5 ** 67 ** A13  
-       NOT_ON_TIMER    , // PK 6 ** 68 ** A14  
-       NOT_ON_TIMER    , // PK 7 ** 69 ** A15  
+       // TIMERS
+       // -------------------------------------------
+       NOT_ON_TIMER    , // PE 0 ** 0 ** USART0_RX
+       NOT_ON_TIMER    , // PE 1 ** 1 ** USART0_TX
+       TIMER3B , // PE 4 ** 2 ** PWM2
+       TIMER3C , // PE 5 ** 3 ** PWM3
+       TIMER0B , // PG 5 ** 4 ** PWM4
+       TIMER3A , // PE 3 ** 5 ** PWM5
+       TIMER4A , // PH 3 ** 6 ** PWM6
+       TIMER4B , // PH 4 ** 7 ** PWM7
+       TIMER4C , // PH 5 ** 8 ** PWM8
+       TIMER2B , // PH 6 ** 9 ** PWM9
+       TIMER2A , // PB 4 ** 10 ** PWM10
+       TIMER1A , // PB 5 ** 11 ** PWM11
+       TIMER1B , // PB 6 ** 12 ** PWM12
+       TIMER0A , // PB 7 ** 13 ** PWM13
+       NOT_ON_TIMER    , // PJ 1 ** 14 ** USART3_TX
+       NOT_ON_TIMER    , // PJ 0 ** 15 ** USART3_RX
+       NOT_ON_TIMER    , // PH 1 ** 16 ** USART2_TX
+       NOT_ON_TIMER    , // PH 0 ** 17 ** USART2_RX
+       NOT_ON_TIMER    , // PD 3 ** 18 ** USART1_TX
+       NOT_ON_TIMER    , // PD 2 ** 19 ** USART1_RX
+       NOT_ON_TIMER    , // PD 1 ** 20 ** I2C_SDA
+       NOT_ON_TIMER    , // PD 0 ** 21 ** I2C_SCL
+       NOT_ON_TIMER    , // PA 0 ** 22 ** D22
+       NOT_ON_TIMER    , // PA 1 ** 23 ** D23
+       NOT_ON_TIMER    , // PA 2 ** 24 ** D24
+       NOT_ON_TIMER    , // PA 3 ** 25 ** D25
+       NOT_ON_TIMER    , // PA 4 ** 26 ** D26
+       NOT_ON_TIMER    , // PA 5 ** 27 ** D27
+       NOT_ON_TIMER    , // PA 6 ** 28 ** D28
+       NOT_ON_TIMER    , // PA 7 ** 29 ** D29
+       NOT_ON_TIMER    , // PC 7 ** 30 ** D30
+       NOT_ON_TIMER    , // PC 6 ** 31 ** D31
+       NOT_ON_TIMER    , // PC 5 ** 32 ** D32
+       NOT_ON_TIMER    , // PC 4 ** 33 ** D33
+       NOT_ON_TIMER    , // PC 3 ** 34 ** D34
+       NOT_ON_TIMER    , // PC 2 ** 35 ** D35
+       NOT_ON_TIMER    , // PC 1 ** 36 ** D36
+       NOT_ON_TIMER    , // PC 0 ** 37 ** D37
+       NOT_ON_TIMER    , // PD 7 ** 38 ** D38
+       NOT_ON_TIMER    , // PG 2 ** 39 ** D39
+       NOT_ON_TIMER    , // PG 1 ** 40 ** D40
+       NOT_ON_TIMER    , // PG 0 ** 41 ** D41
+       NOT_ON_TIMER    , // PL 7 ** 42 ** D42
+       NOT_ON_TIMER    , // PL 6 ** 43 ** D43
+       TIMER5C , // PL 5 ** 44 ** D44
+       TIMER5B , // PL 4 ** 45 ** D45
+       TIMER5A , // PL 3 ** 46 ** D46
+       NOT_ON_TIMER    , // PL 2 ** 47 ** D47
+       NOT_ON_TIMER    , // PL 1 ** 48 ** D48
+       NOT_ON_TIMER    , // PL 0 ** 49 ** D49
+       NOT_ON_TIMER    , // PB 3 ** 50 ** SPI_MISO
+       NOT_ON_TIMER    , // PB 2 ** 51 ** SPI_MOSI
+       NOT_ON_TIMER    , // PB 1 ** 52 ** SPI_SCK
+       NOT_ON_TIMER    , // PB 0 ** 53 ** SPI_SS
+       NOT_ON_TIMER    , // PF 0 ** 54 ** A0
+       NOT_ON_TIMER    , // PF 1 ** 55 ** A1
+       NOT_ON_TIMER    , // PF 2 ** 56 ** A2
+       NOT_ON_TIMER    , // PF 3 ** 57 ** A3
+       NOT_ON_TIMER    , // PF 4 ** 58 ** A4
+       NOT_ON_TIMER    , // PF 5 ** 59 ** A5
+       NOT_ON_TIMER    , // PF 6 ** 60 ** A6
+       NOT_ON_TIMER    , // PF 7 ** 61 ** A7
+       NOT_ON_TIMER    , // PK 0 ** 62 ** A8
+       NOT_ON_TIMER    , // PK 1 ** 63 ** A9
+       NOT_ON_TIMER    , // PK 2 ** 64 ** A10
+       NOT_ON_TIMER    , // PK 3 ** 65 ** A11
+       NOT_ON_TIMER    , // PK 4 ** 66 ** A12
+       NOT_ON_TIMER    , // PK 5 ** 67 ** A13
+       NOT_ON_TIMER    , // PK 6 ** 68 ** A14
+       NOT_ON_TIMER    , // PK 7 ** 69 ** A15
 };
 
 #endif
diff --git a/hardware/arduino/variants/standard/pins_arduino.h 
b/hardware/arduino/variants/standard/pins_arduino.h
index 3d4a9f6..edcd754 100644
--- a/hardware/arduino/variants/standard/pins_arduino.h
+++ b/hardware/arduino/variants/standard/pins_arduino.h
@@ -93,7 +93,7 @@ static const uint8_t A7 = 21;
 //
 // 0-7 PE0-PE7   works
 // 8-13 PB0-PB5  works
-// 14-21 PA0-PA7 works 
+// 14-21 PA0-PA7 works
 // 22-29 PH0-PH7 works
 // 30-35 PG5-PG0 works
 // 36-43 PC7-PC0 works


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]