Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added Arduino 1.0.1 USB serial fix (just for promicro)

git-svn-id: http://multiwii.googlecode.com/svn/trunk/MultiWii_shared@803 02679b44-d973-9852-f2fa-63770883b36c
  • Loading branch information...
commit fad6096b693867df4c7892f43b9254c9b1b1b01a 1 parent 40d7615
authored May 22, 2012

Showing 1 changed file with 8 additions and 4 deletions. Show diff stats Hide diff stats

  1. 12  Serial.pde
12  Serial.pde
@@ -420,10 +420,10 @@ ISR(USART_RX_vect){
420 420
 
421 421
 uint8_t SerialRead(uint8_t port) {
422 422
   #if defined(PROMICRO)
423  
-    #if !defined(TEENSY20)
424  
-      if(port == 0) return USB_Recv(USB_CDC_RX);
425  
-    #else
  423
+     #if defined(TEENSY20) || (ARDUINO > 100)
426 424
       if(port == 0) return Serial.read();
  425
+    #else
  426
+      if(port == 0) return USB_Recv(USB_CDC_RX);      
427 427
     #endif
428 428
     port = 0;
429 429
   #endif
@@ -435,7 +435,11 @@ uint8_t SerialRead(uint8_t port) {
435 435
 uint8_t SerialAvailable(uint8_t port) {
436 436
   #if defined(PROMICRO)
437 437
     #if !defined(TEENSY20)
438  
-      if(port == 0) return USB_Available(USB_CDC_RX);
  438
+      #if(ARDUINO > 100)
  439
+        if(port == 0) return Serial.available();
  440
+      #else
  441
+        if(port == 0) return USB_Available(USB_CDC_RX);
  442
+      #endif
439 443
     #else
440 444
       if(port == 0) return T_USB_Available(USB_CDC_RX);
441 445
     #endif

0 notes on commit fad6096

Please sign in to comment.
Something went wrong with that request. Please try again.