diff --git a/libraries/DataFlash/DataFlash_Backend.h b/libraries/DataFlash/DataFlash_Backend.h index e1f6ceb864..dcf5bb52a1 100644 --- a/libraries/DataFlash/DataFlash_Backend.h +++ b/libraries/DataFlash/DataFlash_Backend.h @@ -18,7 +18,7 @@ public: void internal_error(); - virtual bool CardInserted(void) = 0; + virtual bool CardInserted(void) const = 0; // erase handling virtual void EraseAll() = 0; diff --git a/libraries/DataFlash/DataFlash_File.cpp b/libraries/DataFlash/DataFlash_File.cpp index dcc4c6cb9a..360783f678 100644 --- a/libraries/DataFlash/DataFlash_File.cpp +++ b/libraries/DataFlash/DataFlash_File.cpp @@ -214,7 +214,7 @@ uint32_t DataFlash_File::bufferspace_available() } // return true for CardInserted() if we successfully initialized -bool DataFlash_File::CardInserted(void) +bool DataFlash_File::CardInserted(void) const { return _initialised && !_open_error; } diff --git a/libraries/DataFlash/DataFlash_File.h b/libraries/DataFlash/DataFlash_File.h index 13a3879564..0e46b3b13e 100644 --- a/libraries/DataFlash/DataFlash_File.h +++ b/libraries/DataFlash/DataFlash_File.h @@ -33,7 +33,7 @@ public: // initialisation void Init() override; - bool CardInserted(void) override; + bool CardInserted(void) const override; // erase handling void EraseAll() override; diff --git a/libraries/DataFlash/DataFlash_MAVLink.h b/libraries/DataFlash/DataFlash_MAVLink.h index b030870495..472d03f3a3 100644 --- a/libraries/DataFlash/DataFlash_MAVLink.h +++ b/libraries/DataFlash/DataFlash_MAVLink.h @@ -40,7 +40,7 @@ public: bool is_critical) override; // initialisation - bool CardInserted(void) override { return true; } + bool CardInserted(void) const override { return true; } // erase handling void EraseAll() override {}