diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-10-12 18:34:02 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-10-12 18:34:02 +0300 |
| commit | 0f44b955cc1ae7c86629e42b2c593e203d2b8791 (patch) | |
| tree | 1afc8444f93a46935f66b0499b0f7f94ad1769d9 | |
| parent | acfdb3df7cb48fe9b28c3c9a8ec22006a11182a8 (diff) | |
| parent | 58c5fd1b27813f0d13171b7c163cf9b8f49d7ddd (diff) | |
Update pollserial for Leonardo
| -rwxr-xr-x | demopal/lib/pollserial/pollserial.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/demopal/lib/pollserial/pollserial.h b/demopal/lib/pollserial/pollserial.h index 0e97fbb..6ee8efd 100755 --- a/demopal/lib/pollserial/pollserial.h +++ b/demopal/lib/pollserial/pollserial.h @@ -24,6 +24,19 @@ #ifndef PSERIAL_H
#define PSERIAL_H
+#if defined(__AVR_ATmega32U4__)
+// Serial 0 on leonardo is used for USB, thus we need to use Serial 1.
+#define UDR0 UDR1
+#define UCSR0A UCSR1A
+#define RXC0 RXC1
+#define U2X0 U2X1
+#define UBRR0 UBRR1
+#define UCSR0B UCSR1B
+#define TXEN0 TXEN1
+#define RXEN0 RXEN1
+#define UDRE0 UDRE1
+#endif
+
#include <inttypes.h>
#include "Print.h"
@@ -48,4 +61,4 @@ class pollserial : public Print { };
void USART_recieve();
-#endif
\ No newline at end of file +#endif
|
