Index: serial.c
===================================================================
--- serial.c	(revision 277)
+++ serial.c	(revision 278)
@@ -49,29 +49,29 @@
   //Set baud rate
   // - 115200 (both wired and wireless) is UBRR=8, U2X=1
   // - 9600 is U2X =1, UBRR = 107.
-	#if (USB_BAUD == 115200)
-    UBRR0H = 0x00;
-    UBRR0L = 8;
-    UCSR0A |= _BV(U2X0);
-  #elif (USB_BAUD == 9600)
-    UBRR0H = 0x00;
-    UBRR0L = 103;
-    UCSR0A |= _BV(U2X0);
-  #else //Baud rate is defined in the header file, we should not get here
-    return;
-  #endif
+#if (USB_BAUD == 115200)
+  UBRR0H = 0x00;
+  UBRR0L = 8;
+  UCSR0A |= _BV(U2X0);
+#elif (USB_BAUD == 9600)
+  UBRR0H = 0x00;
+  UBRR0L = 103;
+  UCSR0A |= _BV(U2X0);
+#else //Baud rate is defined in the header file, we should not get here
+  return;
+#endif
 
   /*Enable receiver and transmitter */
-	UCSR0B |= (1<<RXEN0)|(1<<TXEN0);
+  UCSR0B |= (1<<RXEN0)|(1<<TXEN0);
 
-	/* Set frame format: 8data, 1stop bit, asynchronous normal mode */
-	UCSR0C |= (1<<UCSZ00) | (1<<UCSZ01);
+  /* Set frame format: 8data, 1stop bit, asynchronous normal mode */
+  UCSR0C |= (1<<UCSZ00) | (1<<UCSZ01);
 
   // if we have enabled the stdio stuff, then we init it here
-  #ifdef USE_STDIO
-    /* Open the stdio stream corresponding to this port */
-    usb_fd = fdevopen(usb_putc, usb_getc);
-  #endif
+#ifdef USE_STDIO
+  /* Open the stdio stream corresponding to this port */
+  usb_fd = fdevopen(usb_putc, usb_getc);
+#endif
 }
 
 /**
@@ -83,29 +83,29 @@
   //Set baud rate
   // - 115200 (both wired and wireless) is UBRR=8, U2X=1
   // - 9600 is U2X =1, UBRR = 107.
-	#if (XBEE_BAUD == 115200)
-    UBRR1H = 0x00;
-    UBRR1L = 8;
-    UCSR1A |= _BV(U2X1);
-  #elif (XBEE_BAUD == 9600)
-    UBRR1H = 0x00;
-    UBRR1L = 103;
-    UCSR1A |= _BV(U2X1);
-  #else //Baud rate is defined in the header file, we should not get here
-    return;
-  #endif
+#if (XBEE_BAUD == 115200)
+  UBRR1H = 0x00;
+  UBRR1L = 8;
+  UCSR1A |= _BV(U2X1);
+#elif (XBEE_BAUD == 9600)
+  UBRR1H = 0x00;
+  UBRR1L = 103;
+  UCSR1A |= _BV(U2X1);
+#else //Baud rate is defined in the header file, we should not get here
+  return;
+#endif
 
-	//Enable receiver and transmitter
-	UCSR1B |= (1<<RXEN1)|(1<<TXEN1);
+  //Enable receiver and transmitter
+  UCSR1B |= (1<<RXEN1)|(1<<TXEN1);
 
-	// Set frame format: 8data, 1stop bit, asynchronous normal mode
-	UCSR1C |= (1<<UCSZ10) | (1<<UCSZ11);
+  // Set frame format: 8data, 1stop bit, asynchronous normal mode
+  UCSR1C |= (1<<UCSZ10) | (1<<UCSZ11);
 
   // if we have enabled the stdio stuff, then we init it here
-  #ifdef USE_STDIO
-    /* Open the stdio stream corresponding to this port */
-    xbee_fd = fdevopen(xbee_putc, xbee_getc);
-  #endif
+#ifdef USE_STDIO
+  /* Open the stdio stream corresponding to this port */
+  xbee_fd = fdevopen(xbee_putc, xbee_getc);
+#endif
 }
 
 /**
@@ -148,12 +148,11 @@
  **/
 int usb_puts(char *s)
 {
-	char *t = s;
-	while (*t != 0)
-	{
-		usb_putc(*t);
-		t++;
-	}
+  char *t = s;
+  while (*t != 0) {
+    usb_putc(*t);
+    t++;
+  }
   return 0;
 }
 
@@ -168,11 +167,11 @@
  **/
 int usb_getc(void)
 {
-	// Wait for the receive buffer to be filled
-	loop_until_bit_is_set(UCSR0A, RXC0);
+  // Wait for the receive buffer to be filled
+  loop_until_bit_is_set(UCSR0A, RXC0);
 
-	// Read the receive buffer
-	return UDR0;
+  // Read the receive buffer
+  return UDR0;
 }
 
 /**
@@ -187,11 +186,11 @@
  **/
 int xbee_getc(void)
 {
-	// Wait for the receive buffer to be filled
-    loop_until_bit_is_set(UCSR1A, RXC1);
+  // Wait for the receive buffer to be filled
+  loop_until_bit_is_set(UCSR1A, RXC1);
 
-	// Read the receive buffer
-	return UDR1;
+  // Read the receive buffer
+  return UDR1;
 }
 
 /**
@@ -208,16 +207,15 @@
  **/
 int usb_getc_nb(char *c)
 {
-	// check if the receive buffer is filled
+  // check if the receive buffer is filled
   if (UCSR0A & _BV(RXC0)) {
     // Read the receive buffer
     (*c) = UDR0;
     return 0;
-  }
-  else {
+  } else {
     // Return empty
     return -1;
-	}
+  }
 }
 
 /**
@@ -234,16 +232,15 @@
  **/
 int xbee_getc_nb(char *c)
 {
-	// check if the receive buffer is filled
+  // check if the receive buffer is filled
   if (UCSR1A & _BV(RXC1)) {
     // Read the receive buffer
     (*c) = UDR1;
     return 0;
-  }
-  else {
+  } else {
     // Return empty
     return -1;
-	}
+  }
 }
 
 
@@ -263,22 +260,17 @@
  *
  * @see usb_init, usb_putc
  **/
-int usb_puti(int value ) {
-	unsigned char usb_data[6]={'0','0','0','0','0','0' }, position=sizeof(usb_data), radix=10;
+int usb_puti(int value) {
+  unsigned char usb_data[6]={'0','0','0','0','0','0' }, position=sizeof(usb_data), radix=10;
 
-        /* convert int to ascii  */
-        if(value<0) { usb_putc('-'); value=-value; }
-        do { position--; *(usb_data+position)=(value%radix)+'0'; value/=radix;  } while(value);
+  /* convert int to ascii  */
+  if(value<0) { usb_putc('-'); value=-value; }
+  do { position--; *(usb_data+position)=(value%radix)+'0'; value/=radix; } while(value);
 
+  /* start displaying the number */
+  for(; position <= (sizeof(usb_data)-1); position++) {
+    usb_putc(usb_data[position]);
+  }
 
-        /* start displaying the number */
-        for(;position<=(sizeof(usb_data)-1);position++)
-          {
-
-            usb_putc(usb_data[position]);
-          }
-
-	return 0;
+  return 0;
 }
-
-
