Skip to content
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
1 change: 0 additions & 1 deletion src/Parse_SBF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ bool sempSbfPreamble2(SEMP_PARSE_STATE *parse, uint8_t data)
sempPrintStringLn(output, ") bytes, invalid preamble2");
}

SEMP_SBF_VALUES *scratchPad = (SEMP_SBF_VALUES *)parse->scratchPad;
sempInvalidDataCallback(parse);
parse->state = sempFirstByte;
return false;
Expand Down
14 changes: 1 addition & 13 deletions src/SparkFun_Extensible_Message_Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ void sempErrorOutputEnable(SEMP_PARSE_STATE *parse, SEMP_OUTPUT output)
//----------------------------------------
bool sempFirstByte(SEMP_PARSE_STATE *parse, uint8_t data)
{
int index;
SEMP_PARSER_DESCRIPTION *parseDescripion;

if (parse)
Expand All @@ -388,7 +387,7 @@ bool sempFirstByte(SEMP_PARSE_STATE *parse, uint8_t data)
for (parse->type = 0; parse->type < parse->parserCount; parse->type++)
{
// Determine if this parser is able to parse this stream
parseDescripion = parse->parsers[index];
parseDescripion = parse->parsers[parse->type];
if (parseDescripion->preamble(parse, data))
// This parser claims to be able to parse this stream
return true;
Expand Down Expand Up @@ -509,7 +508,6 @@ float sempGetF4(const SEMP_PARSE_STATE *parse, size_t offset)
float sempGetF4NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
float value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
memcpy(&value, &parse->buffer[offset], sizeof(value));
return value;
}
Expand All @@ -531,7 +529,6 @@ double sempGetF8(const SEMP_PARSE_STATE *parse, size_t offset)
double sempGetF8NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
double value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
memcpy(&value, &parse->buffer[offset], sizeof(value));
return value;
}
Expand All @@ -553,7 +550,6 @@ int8_t sempGetI1(const SEMP_PARSE_STATE *parse, size_t offset)
int8_t sempGetI1NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
int8_t value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
value = *(int8_t *)&parse->buffer[offset];
return value;
}
Expand All @@ -575,7 +571,6 @@ int16_t sempGetI2(const SEMP_PARSE_STATE *parse, size_t offset)
int16_t sempGetI2NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
int16_t value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
memcpy(&value, &parse->buffer[offset], sizeof(value));
return value;
}
Expand Down Expand Up @@ -607,7 +602,6 @@ int32_t sempGetI4(const SEMP_PARSE_STATE *parse, size_t offset)
int32_t sempGetI4NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
int32_t value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
memcpy(&value, &parse->buffer[offset], sizeof(value));
return value;
}
Expand Down Expand Up @@ -639,7 +633,6 @@ int sempGetI8Digits(int64_t value)
int64_t sempGetI8NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
int64_t value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
memcpy(&value, &parse->buffer[offset], sizeof(value));
return value;
}
Expand Down Expand Up @@ -676,7 +669,6 @@ const char * sempGetString(const SEMP_PARSE_STATE *parse, size_t offset)
//----------------------------------------
const char * sempGetStringNoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
return (const char *)&parse->buffer[offset];
}

Expand Down Expand Up @@ -714,7 +706,6 @@ uint8_t sempGetU1(const SEMP_PARSE_STATE *parse, size_t offset)
uint8_t sempGetU1NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
uint8_t value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
value = *(uint8_t *)&parse->buffer[offset];
return value;
}
Expand All @@ -736,7 +727,6 @@ uint16_t sempGetU2(const SEMP_PARSE_STATE *parse, size_t offset)
uint16_t sempGetU2NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
uint16_t value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
memcpy(&value, &parse->buffer[offset], sizeof(value));
return value;
}
Expand Down Expand Up @@ -766,7 +756,6 @@ int sempGetU4Digits(uint32_t value)
uint32_t sempGetU4NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
uint32_t value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
memcpy(&value, &parse->buffer[offset], sizeof(value));
return value;
}
Expand Down Expand Up @@ -806,7 +795,6 @@ int sempGetU8Digits(uint64_t value)
uint64_t sempGetU8NoOffset(const SEMP_PARSE_STATE *parse, size_t offset)
{
uint64_t value;
SEMP_PARSER_DESCRIPTION *parserDescription = parse->parsers[parse->type];
memcpy(&value, &parse->buffer[offset], sizeof(value));
return value;
}
Expand Down