From eabdee2b3ce6485103dea14991d84d393e1574d0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 22 Sep 2015 09:24:55 +1000 Subject: [PATCH] DataFlash: only log two rangefinders this prevents a array index build error on PX4 --- libraries/DataFlash/DataFlash.h | 4 +--- libraries/DataFlash/LogFile.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/libraries/DataFlash/DataFlash.h b/libraries/DataFlash/DataFlash.h index 900aec97c9..6b0b48c2ca 100644 --- a/libraries/DataFlash/DataFlash.h +++ b/libraries/DataFlash/DataFlash.h @@ -533,8 +533,6 @@ struct PACKED log_RFND { uint64_t time_us; uint16_t dist1; uint16_t dist2; - uint16_t dist3; - uint16_t dist4; }; /* @@ -761,7 +759,7 @@ Format characters in the format string for binary log messages { LOG_MODE_MSG, sizeof(log_Mode), \ "MODE", "QMB", "TimeUS,Mode,ModeNum" }, \ { LOG_RFND_MSG, sizeof(log_RFND), \ - "RFND", "QCCCC", "TimeUS,Dist1,Dist2,Dist3,Dist4" } + "RFND", "QCC", "TimeUS,Dist1,Dist2" } // messages for more advanced boards #define LOG_EXTRA_STRUCTURES \ diff --git a/libraries/DataFlash/LogFile.cpp b/libraries/DataFlash/LogFile.cpp index da111d1d47..65d65f49ad 100644 --- a/libraries/DataFlash/LogFile.cpp +++ b/libraries/DataFlash/LogFile.cpp @@ -755,9 +755,7 @@ void DataFlash_Class::Log_Write_RFND(const RangeFinder &rangefinder) LOG_PACKET_HEADER_INIT((uint8_t)(LOG_RFND_MSG)), time_us : hal.scheduler->micros64(), dist1 : rangefinder.distance_cm(0), - dist2 : rangefinder.distance_cm(1), - dist3 : rangefinder.distance_cm(2), - dist4 : rangefinder.distance_cm(3) + dist2 : rangefinder.distance_cm(1) }; WriteBlock(&pkt, sizeof(pkt)); }