From 47bb4d22c6a6d62efeff3d43240853cbaf248472 Mon Sep 17 00:00:00 2001 From: DrZiplok Date: Sun, 19 Dec 2010 19:57:34 +0000 Subject: [PATCH] Use the presence of UDRx as an indication that the serial port x might need to be supported. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1200 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/FastSerial/FastSerial.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/FastSerial/FastSerial.cpp b/libraries/FastSerial/FastSerial.cpp index 467c88d45f..27d5ac2596 100644 --- a/libraries/FastSerial/FastSerial.cpp +++ b/libraries/FastSerial/FastSerial.cpp @@ -33,8 +33,12 @@ #include "FastSerial.h" #include "WProgram.h" -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) +#if defined(UDR3) # define FS_MAX_PORTS 4 +#elif defined(UDR2) +# define FS_MAX_PORTS 3 +#elif defined(UDR1) +# define FS_MAX_PORTS 2 #else # define FS_MAX_PORTS 1 #endif