From 4ed0bd2bd562ad815e62e0a2dbb34d854d2c6929 Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Sat, 2 Jun 2012 20:08:46 +0200 Subject: Added support for interrupt on INT2 and INT3 on the Leonardo --- cores/arduino/WInterrupts.c | 36 ++++++++++++++++++++++++++++++------ cores/arduino/wiring_private.h | 2 ++ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/cores/arduino/WInterrupts.c b/cores/arduino/WInterrupts.c index 8f3ec84..62efc9c 100644 --- a/cores/arduino/WInterrupts.c +++ b/cores/arduino/WInterrupts.c @@ -59,6 +59,14 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) { EICRA = (EICRA & ~((1< Date: Sun, 3 Jun 2012 07:48:32 -0400 Subject: Check for NULL pointer in Print.write(). Otherwise, trying to print(NULL) or write(NULL) could print a random character. http://code.google.com/p/arduino/issues/detail?id=941 --- cores/arduino/Print.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cores/arduino/Print.h b/cores/arduino/Print.h index 1af6b72..dc76150 100755 --- a/cores/arduino/Print.h +++ b/cores/arduino/Print.h @@ -46,7 +46,10 @@ class Print void clearWriteError() { setWriteError(0); } virtual size_t write(uint8_t) = 0; - size_t write(const char *str) { return write((const uint8_t *)str, strlen(str)); } + size_t write(const char *str) { + if (str == NULL) return 0; + return write((const uint8_t *)str, strlen(str)); + } virtual size_t write(const uint8_t *buffer, size_t size); size_t print(const __FlashStringHelper *); -- cgit v1.2.3-18-g5258 From 3436ca97cbccd9068c79bf201cb367de60789f37 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Mon, 4 Jun 2012 23:30:41 -0400 Subject: Printing NaN values as "nan" in printFloat(). http://code.google.com/p/arduino/issues/detail?id=946 --- cores/arduino/Print.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cores/arduino/Print.cpp b/cores/arduino/Print.cpp index e541a6c..98969f5 100755 --- a/cores/arduino/Print.cpp +++ b/cores/arduino/Print.cpp @@ -226,6 +226,8 @@ size_t Print::printFloat(double number, uint8_t digits) { size_t n = 0; + if (isnan(number)) return print("nan"); + // Handle negative numbers if (number < 0.0) { -- cgit v1.2.3-18-g5258 From 29ff4f779a37019c5218145cb15b036b51fc5e25 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Thu, 14 Jun 2012 15:53:27 +0100 Subject: Adding write(str) and write(buf, size) for USB CDC. So that they work on the Leonardo. http://code.google.com/p/arduino/issues/detail?id=958 --- cores/arduino/USBAPI.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h index d5abdb6..eb2e593 100644 --- a/cores/arduino/USBAPI.h +++ b/cores/arduino/USBAPI.h @@ -39,6 +39,7 @@ public: virtual int read(void); virtual void flush(void); virtual size_t write(uint8_t); + using Print::write; // pull in write(str) and write(buf, size) from Print operator bool(); }; extern Serial_ Serial; -- cgit v1.2.3-18-g5258 From 2ef2f9d5c78ad4a1d265b7386e13c41d41ba410a Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 23 Jun 2012 10:37:35 -0500 Subject: Print "inf" for infinite floating point numbers (using isinf()). http://code.google.com/p/arduino/issues/detail?id=961 --- cores/arduino/Print.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/arduino/Print.cpp b/cores/arduino/Print.cpp index 98969f5..711251c 100755 --- a/cores/arduino/Print.cpp +++ b/cores/arduino/Print.cpp @@ -227,6 +227,7 @@ size_t Print::printFloat(double number, uint8_t digits) size_t n = 0; if (isnan(number)) return print("nan"); + if (isinf(number)) return print("inf"); // Handle negative numbers if (number < 0.0) -- cgit v1.2.3-18-g5258