Skip to content

Commit 65551c3

Browse files
BUGFIX: string terminator missing in some NMEA sentence formatters.
+ HCHDT sentence removed.
1 parent a56a6f6 commit 65551c3

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

Output_Formatter/NMEA_format.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -266,23 +266,8 @@ void format_GGA( const coordinates_t &coordinates, char * &p)
266266
*p++ = 'M';
267267
*p++ = ','; // no DGPS
268268
*p++ = ',';
269-
p = NMEA_append_tail ( line_start);
270-
}
271-
272-
ROM char HCHDT[]="$HCHDT,";
269+
*p=0;
273270

274-
//! create HCHDM sentence to report true heading
275-
void format_HCHDT( float true_heading, char * &p) // report magnetic heading
276-
{
277-
char * line_start = p;
278-
int32_t heading = (int32_t) round(true_heading * 573.0f); // -> 1/10 degree
279-
if( heading < 0)
280-
heading += 3600;
281-
282-
p = append_string( p, HCHDT);
283-
p = to_ascii_1_decimal( heading, p);
284-
*p++ = ',';
285-
*p++ = 'T';
286271
p = NMEA_append_tail ( line_start);
287272
}
288273

@@ -297,6 +282,8 @@ void format_PLARD ( float density, char type, char * &p)
297282
p = to_ascii_2_decimals( round( density * 1e5f), p); // units = g / m^3, * 100 to get 2 decimals
298283
*p++ = ',';
299284
*p++ = type;
285+
*p=0;
286+
300287
p = NMEA_append_tail ( line_start);
301288
}
302289

@@ -441,8 +428,6 @@ void format_NMEA_string_slow( const output_data_t &output_data, string_buffer_t
441428
// NMEA-format position report, sat number and GEO separation
442429
format_GGA ( output_data.c, next);
443430

444-
format_HCHDT( output_data.euler.y, next);
445-
446431
// battery_voltage
447432
format_PLARB( output_data.m.supply_voltage, next);
448433

0 commit comments

Comments
 (0)