Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #8 in main branch #9

Merged
merged 4 commits into from
Jul 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Streaming
version=6.0.2
version=6.0.3
author=Mikal Hart <[email protected]>
maintainer=Peter Polidoro <[email protected]>
sentence=Streaming C++-style Output with Operator <<
Expand Down
9 changes: 8 additions & 1 deletion src/Streaming.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename T>
Expand Down Expand Up @@ -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<const char *>(val)); }
#endif

// _BASED<T> get the width of a value
template<typename T>
Expand Down Expand Up @@ -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<const __FlashStringHelper*>(reinterpret_cast<const char *>(format_string)+1);
return format_char;
}
#endif

template<typename Ft>
inline bool check_backslash(char& format_char, Ft& format_string)
Expand Down