From a4980c3d5ed9ed1a1329c8c565d0eaa1df4f7579 Mon Sep 17 00:00:00 2001 From: gazoodle Date: Sat, 18 Jul 2020 12:05:17 +0100 Subject: [PATCH 1/2] Arduino MEGA AVR boards use the light traits --- src/Streaming.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Streaming.h b/src/Streaming.h index 33db9e4..879bff6 100644 --- a/src/Streaming.h +++ b/src/Streaming.h @@ -41,9 +41,12 @@ #if defined(ARDUINO) && ARDUINO >= 100 #include "Arduino.h" #else +#ifndef STREAMING_CONSOLE #include "WProgram.h" #endif -#ifdef ARDUINO_ARCH_AVR +#endif + +#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR) // No stl library, so need trivial version of std::is_signed ... namespace std { template @@ -212,8 +215,10 @@ inline uint8_t get_value_width(T val) inline uint8_t get_value_width(const char * val) { return strlen(val); } +#ifdef ARDUINO inline uint8_t get_value_width(const __FlashStringHelper * val) { return strlen_P(reinterpret_cast(val)); } +#endif // _BASED get the width of a value template @@ -255,12 +260,14 @@ inline char get_next_format_char(const char *& format_string) return format_char; } +#ifdef ARDUINO inline char get_next_format_char(const __FlashStringHelper*& format_string) { char format_char = pgm_read_byte(format_string); if ( format_char > 0 ) format_string = reinterpret_cast(reinterpret_cast(format_string)+1); return format_char; } +#endif template inline bool check_backslash(char& format_char, Ft& format_string) From cbe967d39c9674c058c9e6982641ad44d740dc54 Mon Sep 17 00:00:00 2001 From: gazoodle Date: Sat, 18 Jul 2020 12:09:35 +0100 Subject: [PATCH 2/2] Bump version --- README.org | 2 +- library.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 26804ed..0502caa 100644 --- a/README.org +++ b/README.org @@ -4,7 +4,7 @@ * Library Information - Name :: Streaming - - Version :: 6.0.2 + - Version :: 6.0.3 - License :: GNU LGPL - URL :: https://github.com/janelia-arduino/Streaming - Author :: Mikal Hart diff --git a/library.properties b/library.properties index ae015a3..0554c89 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Streaming -version=6.0.2 +version=6.0.3 author=Mikal Hart maintainer=Peter Polidoro sentence=Streaming C++-style Output with Operator <<