Permalink
Browse files

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...
1 parent 40d7615 commit fad6096b693867df4c7892f43b9254c9b1b1b01a Felix.Niessen@gmail.com committed May 22, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 Serial.pde
View
@@ -420,10 +420,10 @@ ISR(USART_RX_vect){
uint8_t SerialRead(uint8_t port) {
#if defined(PROMICRO)
- #if !defined(TEENSY20)
- if(port == 0) return USB_Recv(USB_CDC_RX);
- #else
+ #if defined(TEENSY20) || (ARDUINO > 100)
if(port == 0) return Serial.read();
+ #else
+ if(port == 0) return USB_Recv(USB_CDC_RX);
#endif
port = 0;
#endif
@@ -435,7 +435,11 @@ uint8_t SerialRead(uint8_t port) {
uint8_t SerialAvailable(uint8_t port) {
#if defined(PROMICRO)
#if !defined(TEENSY20)
- if(port == 0) return USB_Available(USB_CDC_RX);
+ #if(ARDUINO > 100)
+ if(port == 0) return Serial.available();
+ #else
+ if(port == 0) return USB_Available(USB_CDC_RX);
+ #endif
#else
if(port == 0) return T_USB_Available(USB_CDC_RX);
#endif

0 comments on commit fad6096

Please sign in to comment.