15
15
#define COLOR_BLACK 0x0000
16
16
#define DEBOUNCE_READ_SERIAL 300
17
17
18
- class fastSerialDisplay
18
+ class FastSerialDisplay
19
19
{
20
20
private:
21
21
struct Capture
@@ -95,7 +95,7 @@ class fastSerialDisplay
95
95
boolean isCommand (const char *);
96
96
void serialPrintFormatted (const char *formatStr, ...);
97
97
bool containsOnlyDigits (const char *);
98
- inline void serialPrintFormattedMacro (fastSerialDisplay *disp, const char *fmt, ...)
98
+ inline void serialPrintFormattedMacro (FastSerialDisplay *disp, const char *fmt, ...)
99
99
{
100
100
#ifdef OUTPUT_CODE_ON_SERIAL
101
101
va_list args;
@@ -107,14 +107,14 @@ class fastSerialDisplay
107
107
}
108
108
109
109
public:
110
- fastSerialDisplay (DISP *d, const char *dName = nullptr );
111
- ~fastSerialDisplay ();
110
+ FastSerialDisplay (DISP *d, const char *dName = nullptr );
111
+ ~FastSerialDisplay ();
112
112
void readCommandsFromSerial (void );
113
113
void runCommands (char *);
114
114
void runCommands (const __FlashStringHelper *ifsh);
115
115
};
116
116
117
- fastSerialDisplay::fastSerialDisplay (DISP *d, const char *dName)
117
+ FastSerialDisplay::FastSerialDisplay (DISP *d, const char *dName)
118
118
{
119
119
if (dName != nullptr )
120
120
{
@@ -134,18 +134,18 @@ fastSerialDisplay::fastSerialDisplay(DISP *d, const char *dName)
134
134
lastSerialRead = millis ();
135
135
}
136
136
137
- fastSerialDisplay ::~fastSerialDisplay ()
137
+ FastSerialDisplay ::~FastSerialDisplay ()
138
138
{
139
139
}
140
140
141
- void fastSerialDisplay ::runCommands (char *commands)
141
+ void FastSerialDisplay ::runCommands (char *commands)
142
142
{
143
143
for (int i = 0 ; i < strlen (commands); i++)
144
144
{
145
145
decodeInput (*(commands + i));
146
146
}
147
147
}
148
- void fastSerialDisplay ::runCommands (const __FlashStringHelper *ifsh)
148
+ void FastSerialDisplay ::runCommands (const __FlashStringHelper *ifsh)
149
149
{
150
150
PGM_P p = reinterpret_cast <PGM_P>(ifsh);
151
151
while (1 )
@@ -157,7 +157,7 @@ void fastSerialDisplay::runCommands(const __FlashStringHelper *ifsh)
157
157
}
158
158
}
159
159
160
- bool fastSerialDisplay ::containsOnlyDigits (const char *str)
160
+ bool FastSerialDisplay ::containsOnlyDigits (const char *str)
161
161
{
162
162
for (int i = 0 ; str[i] != ' \0 ' ; i++)
163
163
{
@@ -169,7 +169,7 @@ bool fastSerialDisplay::containsOnlyDigits(const char *str)
169
169
return true ;
170
170
}
171
171
172
- float fastSerialDisplay ::getFloatFromCapture (char *capture)
172
+ float FastSerialDisplay ::getFloatFromCapture (char *capture)
173
173
{
174
174
if (containsOnlyDigits (capture))
175
175
{
@@ -181,11 +181,11 @@ float fastSerialDisplay::getFloatFromCapture(char *capture)
181
181
}
182
182
}
183
183
184
- uint32_t fastSerialDisplay ::getColorFromCapture (char *capture)
184
+ uint32_t FastSerialDisplay ::getColorFromCapture (char *capture)
185
185
{
186
186
return strtoul (capture, NULL , 16 );
187
187
}
188
- int32_t *fastSerialDisplay ::getColorFromCapture (Capture *capture, int start, int end)
188
+ int32_t *FastSerialDisplay ::getColorFromCapture (Capture *capture, int start, int end)
189
189
{
190
190
static int32_t res[MAX_ARG_CAPTURE];
191
191
for (int i = start; i <= end && i <= MAX_ARG_CAPTURE; i++)
@@ -195,12 +195,12 @@ int32_t *fastSerialDisplay::getColorFromCapture(Capture *capture, int start, int
195
195
return res;
196
196
}
197
197
198
- int32_t *fastSerialDisplay ::getIntFromCapture (Capture *capture, int count)
198
+ int32_t *FastSerialDisplay ::getIntFromCapture (Capture *capture, int count)
199
199
{
200
200
return getIntFromCapture (capture, 0 , count - 1 );
201
201
}
202
202
203
- int32_t *fastSerialDisplay ::getIntFromCapture (Capture *capture, int start, int end)
203
+ int32_t *FastSerialDisplay ::getIntFromCapture (Capture *capture, int start, int end)
204
204
{
205
205
static int32_t res[MAX_ARG_CAPTURE];
206
206
for (int i = start; i <= end && i <= MAX_ARG_CAPTURE; i++)
@@ -210,7 +210,7 @@ int32_t *fastSerialDisplay::getIntFromCapture(Capture *capture, int start, int e
210
210
return res;
211
211
}
212
212
213
- int32_t fastSerialDisplay ::getIntFromCapture (char *capture)
213
+ int32_t FastSerialDisplay ::getIntFromCapture (char *capture)
214
214
{
215
215
if (containsOnlyDigits (capture))
216
216
{
@@ -222,7 +222,7 @@ int32_t fastSerialDisplay::getIntFromCapture(char *capture)
222
222
}
223
223
}
224
224
225
- bool *fastSerialDisplay ::getBoolFromCapture (Capture *capture, int start, int end)
225
+ bool *FastSerialDisplay ::getBoolFromCapture (Capture *capture, int start, int end)
226
226
{
227
227
static bool res[MAX_ARG_CAPTURE];
228
228
for (int i = start; i <= end && i <= MAX_ARG_CAPTURE; i++)
@@ -232,7 +232,7 @@ bool *fastSerialDisplay::getBoolFromCapture(Capture *capture, int start, int end
232
232
return res;
233
233
}
234
234
235
- bool fastSerialDisplay ::getBoolFromCapture (char *capture)
235
+ bool FastSerialDisplay ::getBoolFromCapture (char *capture)
236
236
{
237
237
if (capture[0 ] == ' 1' )
238
238
{
@@ -241,7 +241,7 @@ bool fastSerialDisplay::getBoolFromCapture(char *capture)
241
241
return false ;
242
242
}
243
243
244
- int fastSerialDisplay ::getValueFromKeyword (char c)
244
+ int FastSerialDisplay ::getValueFromKeyword (char c)
245
245
{
246
246
if (strchr (displaySizeKeywords, c))
247
247
{
@@ -261,7 +261,7 @@ int fastSerialDisplay::getValueFromKeyword(char c)
261
261
return 0 ;
262
262
}
263
263
264
- void fastSerialDisplay ::captureInput (Capture *capture, char input)
264
+ void FastSerialDisplay ::captureInput (Capture *capture, char input)
265
265
{
266
266
if (capture->index [capture->argIndex ] == MAX_DATA_CAPTURE)
267
267
{
@@ -272,15 +272,15 @@ void fastSerialDisplay::captureInput(Capture *capture, char input)
272
272
capture->index [capture->argIndex ]++;
273
273
}
274
274
275
- void fastSerialDisplay ::closeCapture (Capture *capture)
275
+ void FastSerialDisplay ::closeCapture (Capture *capture)
276
276
{
277
277
capture->argIndex = 0 ;
278
278
for (int i = 0 ; i < capture->maxArg ; i++)
279
279
{
280
280
capture->capture [i][capture->index [i]] = 0 ;
281
281
}
282
282
}
283
- void fastSerialDisplay ::openCapture (Capture *capture, int maxArg)
283
+ void FastSerialDisplay ::openCapture (Capture *capture, int maxArg)
284
284
{
285
285
capture->argIndex = 0 ;
286
286
capture->maxArg = maxArg;
@@ -290,7 +290,7 @@ void fastSerialDisplay::openCapture(Capture *capture, int maxArg)
290
290
}
291
291
}
292
292
293
- void fastSerialDisplay ::nextArgCapture (Capture *capture)
293
+ void FastSerialDisplay ::nextArgCapture (Capture *capture)
294
294
{
295
295
if (capture->argIndex >= capture->maxArg )
296
296
{
@@ -303,7 +303,7 @@ void fastSerialDisplay::nextArgCapture(Capture *capture)
303
303
}
304
304
}
305
305
306
- void fastSerialDisplay ::captureCommand (char input)
306
+ void FastSerialDisplay ::captureCommand (char input)
307
307
{
308
308
captureInput (&captureData, input);
309
309
closeCapture (&captureData);
@@ -436,12 +436,12 @@ void fastSerialDisplay::captureCommand(char input)
436
436
}
437
437
}
438
438
439
- boolean fastSerialDisplay ::isCommand (const char *command)
439
+ boolean FastSerialDisplay ::isCommand (const char *command)
440
440
{
441
441
return strcmp (captureData.capture [0 ], command) == 0 ;
442
442
}
443
443
444
- void fastSerialDisplay ::decodeInput (char input)
444
+ void FastSerialDisplay ::decodeInput (char input)
445
445
{
446
446
if (input == ' ;' )
447
447
{
@@ -549,7 +549,7 @@ void fastSerialDisplay::decodeInput(char input)
549
549
}
550
550
}
551
551
552
- void fastSerialDisplay ::readCommandsFromSerial (void )
552
+ void FastSerialDisplay ::readCommandsFromSerial (void )
553
553
{
554
554
char input;
555
555
if (Serial.available ())
@@ -569,7 +569,7 @@ void fastSerialDisplay::readCommandsFromSerial(void)
569
569
delay (10 );
570
570
}
571
571
572
- void fastSerialDisplay ::executeCommand (void )
572
+ void FastSerialDisplay ::executeCommand (void )
573
573
{
574
574
int16_t x, y, x1, y1;
575
575
uint16_t w, h;
0 commit comments