From 032e8348496a810a5f8756ea989c09b0327ea637 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Mon, 4 Jul 2016 11:14:26 +0900 Subject: [PATCH] Dataflash: log rally points --- libraries/DataFlash/DataFlash.h | 2 ++ libraries/DataFlash/LogFile.cpp | 20 ++++++++++++++++++++ libraries/DataFlash/LogStructure.h | 15 ++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/libraries/DataFlash/DataFlash.h b/libraries/DataFlash/DataFlash.h index bc689396c9..b279d7fc20 100644 --- a/libraries/DataFlash/DataFlash.h +++ b/libraries/DataFlash/DataFlash.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 @@ -149,6 +150,7 @@ public: const AP_Motors &motors, const AC_AttitudeControl &attitude_control, const AC_PosControl &pos_control); + void Log_Write_Rally(const AP_Rally &rally); void Log_Write(const char *name, const char *labels, const char *fmt, ...); diff --git a/libraries/DataFlash/LogFile.cpp b/libraries/DataFlash/LogFile.cpp index 9db1b786a0..78786d5916 100644 --- a/libraries/DataFlash/LogFile.cpp +++ b/libraries/DataFlash/LogFile.cpp @@ -1877,3 +1877,23 @@ void DataFlash_Class::Log_Write_Rate(const AP_AHRS &ahrs, }; WriteBlock(&pkt_rate, sizeof(pkt_rate)); } + +// Write rally points +void DataFlash_Class::Log_Write_Rally(const AP_Rally &rally) +{ + RallyLocation rally_point; + for (uint8_t i=0; i