From 7308c9aa7bdd8c7818b2086855d6c0e75722022d Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 22 Feb 2018 20:38:58 +1100 Subject: [PATCH] DataFlash: tighten types up to save flash space Saves about 1,500 bytes! --- libraries/DataFlash/DataFlash.h | 2 +- libraries/DataFlash/LogStructure.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/DataFlash/DataFlash.h b/libraries/DataFlash/DataFlash.h index 9f5af2541c..3af283683d 100644 --- a/libraries/DataFlash/DataFlash.h +++ b/libraries/DataFlash/DataFlash.h @@ -339,7 +339,7 @@ private: // possibly expensive calls to start log system: void Prep(); - bool _writes_enabled; + bool _writes_enabled:1; /* support for retrieving logs via mavlink: */ uint8_t _log_listing:1; // sending log list diff --git a/libraries/DataFlash/LogStructure.h b/libraries/DataFlash/LogStructure.h index 36ba135726..719fb47a47 100644 --- a/libraries/DataFlash/LogStructure.h +++ b/libraries/DataFlash/LogStructure.h @@ -60,7 +60,7 @@ struct PACKED log_Format_Units { struct UnitStructure { const char ID; - const char unit[64]; + const char *unit; }; struct MultiplierStructure { @@ -113,9 +113,9 @@ const struct UnitStructure log_Units[] = { // tl;dr a GCS shouldn't/mustn't infer any scaling from the unit name const struct MultiplierStructure log_Multipliers[] = { -// { '-', 0 }, // no multiplier e.g. a string { '?', 1 }, // multipliers which haven't been worked out yet.... +// { '2', 1e2 }, { '1', 1e1 }, { '0', 1e0 },