25 #ifndef ACE_SEGMENT_WRITER_STRING_SCROLLER_H
26 #define ACE_SEGMENT_WRITER_STRING_SCROLLER_H
30 #include "StringWriter.h"
32 class __FlashStringHelper;
34 namespace ace_segment {
42 template <
typename T_LED_MODULE>
51 T_LED_MODULE&
ledModule() {
return mCharWriter.ledModule(); }
55 return mCharWriter.patternWriter();
62 uint8_t
getNumDigits()
const {
return mCharWriter.getNumDigits(); }
67 mIsFlashString =
false;
68 mStringLength = strlen(s);
76 mIsFlashString =
true;
77 mStringLength = strlen_P((
const char*) fs);
87 bool isDone = mStringPos >= mStringLength;
98 mIsFlashString =
false;
99 mStringLength = strlen(s);
100 mStringPos = mStringLength;
107 mIsFlashString =
true;
108 mStringLength = strlen_P((
const char*) fs);
109 mStringPos = mStringLength;
119 bool isDone = (mStringPos <= -numDigits);
134 int16_t stringPos = mStringPos;
135 for (uint8_t pos = 0; pos < numDigits; pos++) {
137 if (stringPos < 0 || stringPos >= mStringLength) {
145 if (mIsFlashString) {
146 c = pgm_read_byte((
const uint8_t*) mString + stringPos);
148 c = *((
const char*) mString + stringPos);
151 mCharWriter.writeCharAt(pos, c);
159 CharWriter<T_LED_MODULE>& mCharWriter;
162 uint8_t mStringLength;