mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 13:55:40 +08:00
navdata had better be the same size as a packet.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user