From 191e45723001d73ade339aa92cc81f369caa47bc Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 11 Oct 2017 10:36:04 +1100 Subject: [PATCH] DataFlash: include sample count in ISBH --- libraries/DataFlash/DataFlash.cpp | 2 ++ libraries/DataFlash/DataFlash.h | 1 + libraries/DataFlash/LogStructure.h | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/DataFlash/DataFlash.cpp b/libraries/DataFlash/DataFlash.cpp index d4614f25d1..03323a0965 100644 --- a/libraries/DataFlash/DataFlash.cpp +++ b/libraries/DataFlash/DataFlash.cpp @@ -711,6 +711,7 @@ bool DataFlash_Class::Log_Write_ISBH(const uint16_t seqno, const AP_InertialSensor::IMU_SENSOR_TYPE sensor_type, const uint8_t sensor_instance, const uint16_t multiplier, + const uint16_t sample_count, const uint64_t sample_us, const float sample_rate_hz) { @@ -724,6 +725,7 @@ bool DataFlash_Class::Log_Write_ISBH(const uint16_t seqno, sensor_type : (uint8_t)sensor_type, instance : sensor_instance, multiplier : multiplier, + sample_count : sample_count, sample_us : sample_us, sample_rate_hz : sample_rate_hz, }; diff --git a/libraries/DataFlash/DataFlash.h b/libraries/DataFlash/DataFlash.h index 9d6ebebda0..1b6cf217a7 100644 --- a/libraries/DataFlash/DataFlash.h +++ b/libraries/DataFlash/DataFlash.h @@ -112,6 +112,7 @@ public: AP_InertialSensor::IMU_SENSOR_TYPE sensor_type, uint8_t instance, uint16_t multiplier, + uint16_t sample_count, uint64_t sample_us, float sample_rate_hz); bool Log_Write_ISBD(uint16_t isb_seqno, diff --git a/libraries/DataFlash/LogStructure.h b/libraries/DataFlash/LogStructure.h index 5894765b67..d54940d274 100644 --- a/libraries/DataFlash/LogStructure.h +++ b/libraries/DataFlash/LogStructure.h @@ -114,6 +114,7 @@ struct PACKED log_ISBH { uint8_t sensor_type; // e.g. GYRO or ACCEL uint8_t instance; uint16_t multiplier; + uint16_t sample_count; uint64_t sample_us; float sample_rate_hz; }; @@ -965,8 +966,8 @@ struct PACKED log_DSTL { #define IMT_LABELS "TimeUS,DelT,DelvT,DelaT,DelAX,DelAY,DelAZ,DelVX,DelVY,DelVZ" #define IMT_FMT "Qfffffffff" -#define ISBH_LABELS "TimeUS,N,type,instance,mul,SampleUS,smp_rate" -#define ISBH_FMT "QHBBHQf" +#define ISBH_LABELS "TimeUS,N,type,instance,mul,smp_cnt,SampleUS,smp_rate" +#define ISBH_FMT "QHBBHHQf" #define ISBD_LABELS "TimeUS,N,seqno,x,y,z" #define ISBD_FMT "QHHaaa"