Skip to content

Commit 93e4ab0

Browse files
committed
Pass Print * to sempPrintParserConfiguration
1 parent 1c5feb5 commit 93e4ab0

File tree

10 files changed

+28
-34
lines changed

10 files changed

+28
-34
lines changed

Examples/Base_Test/Base_Test.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void setup()
112112
// Display the parser configuration
113113
Serial.printf("&parserTable: %p\r\n", parserTable);
114114
Serial.printf("&parserNames: %p\r\n", parserNames);
115-
sempPrintParserConfiguration(parse);
115+
sempPrintParserConfiguration(parse, &Serial);
116116

117117
// Display the parse state
118118
Serial.printf("Parse State: %s\r\n", sempGetStateName(parse));
@@ -164,7 +164,7 @@ void processMessage(SEMP_PARSE_STATE *parse, uint16_t type)
164164
{
165165
displayOnce = false;
166166
Serial.println();
167-
sempPrintParserConfiguration(parse);
167+
sempPrintParserConfiguration(parse, &Serial);
168168
}
169169
}
170170

Examples/Mixed_Parser/Mixed_Parser.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void processMessage(SEMP_PARSE_STATE *parse, uint16_t type)
229229
{
230230
displayOnce = false;
231231
Serial.println();
232-
sempPrintParserConfiguration(parse);
232+
sempPrintParserConfiguration(parse, &Serial);
233233
}
234234
}
235235

Examples/Multiple_Parsers/Multiple_Parsers.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ void nmeaMessage(SEMP_PARSE_STATE *parse, uint16_t type)
238238
{
239239
displayOnce = false;
240240
Serial.println();
241-
sempPrintParserConfiguration(parse);
241+
sempPrintParserConfiguration(parse, &Serial);
242242
}
243243
}
244244

@@ -261,7 +261,7 @@ void ubloxMessage(SEMP_PARSE_STATE *parse, uint16_t type)
261261
{
262262
displayOnce = false;
263263
Serial.println();
264-
sempPrintParserConfiguration(parse);
264+
sempPrintParserConfiguration(parse, &Serial);
265265
}
266266
}
267267

Examples/NMEA_Test/NMEA_Test.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void processMessage(SEMP_PARSE_STATE *parse, uint16_t type)
138138
{
139139
displayOnce = false;
140140
Serial.println();
141-
sempPrintParserConfiguration(parse);
141+
sempPrintParserConfiguration(parse, &Serial);
142142
}
143143
}
144144

Examples/RTCM_Test/RTCM_Test.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void processMessage(SEMP_PARSE_STATE *parse, uint16_t type)
132132
{
133133
displayOnce = false;
134134
Serial.println();
135-
sempPrintParserConfiguration(parse);
135+
sempPrintParserConfiguration(parse, &Serial);
136136
}
137137
}
138138

Examples/UBLOX_Test/UBLOX_Test.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void processMessage(SEMP_PARSE_STATE *parse, uint16_t type)
174174
{
175175
displayOnce = false;
176176
Serial.println();
177-
sempPrintParserConfiguration(parse);
177+
sempPrintParserConfiguration(parse, &Serial);
178178
}
179179
}
180180

Examples/Unicore_Test/Unicore_Test.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void processMessage(SEMP_PARSE_STATE *parse, uint16_t type)
180180
{
181181
displayOnce = false;
182182
Serial.println();
183-
sempPrintParserConfiguration(parse);
183+
sempPrintParserConfiguration(parse, &Serial);
184184
}
185185
}
186186

Examples/User_Parser/User_Parser.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void userMessage(SEMP_PARSE_STATE *parse, uint16_t type)
220220
{
221221
displayOnce = false;
222222
Serial.println();
223-
sempPrintParserConfiguration(parse);
223+
sempPrintParserConfiguration(parse, &Serial);
224224
}
225225
}
226226

src/SparkFun_Extensible_Message_Parser.cpp

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ SparkFun_Extensible_Message_Parser.cpp
2121

2222
#define SEMP_ALIGN(x) ((x + SEMP_ALIGNMENT_MASK) & (~SEMP_ALIGNMENT_MASK))
2323

24-
//----------------------------------------
25-
// Globals
26-
//----------------------------------------
27-
28-
bool sempPrintErrorMessages;
29-
3024
//----------------------------------------
3125
// Support routines
3226
//----------------------------------------
@@ -125,28 +119,28 @@ const char * sempGetTypeName(SEMP_PARSE_STATE *parse, uint16_t type)
125119
}
126120

127121
// Print the parser's configuration
128-
void sempPrintParserConfiguration(SEMP_PARSE_STATE *parse)
122+
void sempPrintParserConfiguration(SEMP_PARSE_STATE *parse, Print *print)
129123
{
130-
if (parse->printError)
124+
if (print)
131125
{
132-
sempPrintln(parse->printError, "SparkFun Extensible Message Parser");
133-
sempPrintf(parse->printError, " Name: %p (%s)", parse->parserName, parse->parserName);
134-
sempPrintf(parse->printError, " parsers: %p", parse->parsers);
135-
sempPrintf(parse->printError, " parserNames: %p", parse->parserNames);
136-
sempPrintf(parse->printError, " parserCount: %d", parse->parserCount);
137-
sempPrintf(parse->printError, " printError: %p", parse->printError);
138-
sempPrintf(parse->printError, " printDebug: %p", parse->printDebug);
139-
sempPrintf(parse->printError, " Scratch Pad: %p (%d bytes)",
126+
sempPrintln(print, "SparkFun Extensible Message Parser");
127+
sempPrintf(print, " Name: %p (%s)", parse->parserName, parse->parserName);
128+
sempPrintf(print, " parsers: %p", parse->parsers);
129+
sempPrintf(print, " parserNames: %p", parse->parserNames);
130+
sempPrintf(print, " parserCount: %d", parse->parserCount);
131+
sempPrintf(print, " printError: %p", parse->printError);
132+
sempPrintf(print, " printDebug: %p", parse->printDebug);
133+
sempPrintf(print, " Scratch Pad: %p (%d bytes)",
140134
(void *)parse->scratchPad, parse->buffer - (uint8_t *)parse->scratchPad);
141-
sempPrintf(parse->printError, " computeCrc: %p", (void *)parse->computeCrc);
142-
sempPrintf(parse->printError, " crc: 0x%08x", parse->crc);
143-
sempPrintf(parse->printError, " State: %p%s", (void *)parse->state,
135+
sempPrintf(print, " computeCrc: %p", (void *)parse->computeCrc);
136+
sempPrintf(print, " crc: 0x%08x", parse->crc);
137+
sempPrintf(print, " State: %p%s", (void *)parse->state,
144138
(parse->state == sempFirstByte) ? " (sempFirstByte)" : "");
145-
sempPrintf(parse->printError, " EomCallback: %p", (void *)parse->eomCallback);
146-
sempPrintf(parse->printError, " Buffer: %p (%d bytes)",
139+
sempPrintf(print, " EomCallback: %p", (void *)parse->eomCallback);
140+
sempPrintf(print, " Buffer: %p (%d bytes)",
147141
(void *)parse->buffer, parse->bufferLength);
148-
sempPrintf(parse->printError, " length: %d message bytes", parse->length);
149-
sempPrintf(parse->printError, " type: %d (%s)", parse->type, sempGetTypeName(parse, parse->type));
142+
sempPrintf(print, " length: %d message bytes", parse->length);
143+
sempPrintf(print, " type: %d (%s)", parse->type, sempGetTypeName(parse, parse->type));
150144
}
151145
}
152146

src/SparkFun_Extensible_Message_Parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void sempParseNextByte(SEMP_PARSE_STATE *parse, uint8_t data);
224224
void sempStopParser(SEMP_PARSE_STATE **parse);
225225

226226
// Print the contents of the parser data structure
227-
void sempPrintParserConfiguration(SEMP_PARSE_STATE *parse);
227+
void sempPrintParserConfiguration(SEMP_PARSE_STATE *parse, Print *print);
228228

229229
// Format and print a line of text
230230
void sempPrintf(Print *print, const char *format, ...);

0 commit comments

Comments
 (0)