navdata had better be the same size as a packet.

This commit is contained in:
Ben Laurie
2013-09-08 06:16:06 +01:00
parent aa1bf02200
commit 0726043ac0
+2
View File
@@ -35,6 +35,7 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <errno.h> #include <errno.h>
#include <assert.h>
#include "navdata.h" #include "navdata.h"
#define NAVDATA_PACKET_SIZE 60 #define NAVDATA_PACKET_SIZE 60
@@ -271,6 +272,7 @@ void navdata_update()
if ( 1 ) // we dont know how to calculate the checksum if ( 1 ) // we dont know how to calculate the checksum
// if ( navdata_checksum() == 0 ) // if ( navdata_checksum() == 0 )
{ {
assert(sizeof navdata == NAVDATA_PACKET_SIZE);
memcpy(navdata, port.buffer, NAVDATA_PACKET_SIZE); memcpy(navdata, port.buffer, NAVDATA_PACKET_SIZE);
// Invert byte order so that TELEMETRY works better // Invert byte order so that TELEMETRY works better