diff --git a/libraries/AP_HAL_Linux/Storage.cpp b/libraries/AP_HAL_Linux/Storage.cpp index 9d779051cd..4f9fc133a2 100644 --- a/libraries/AP_HAL_Linux/Storage.cpp +++ b/libraries/AP_HAL_Linux/Storage.cpp @@ -266,3 +266,16 @@ void Storage::_timer_tick(void) } } } + +/* + get storage size and ptr + */ +bool Storage::get_storage_ptr(void *&ptr, size_t &size) +{ + if (!_initialised) { + return false; + } + ptr = _buffer; + size = sizeof(_buffer); + return true; +} diff --git a/libraries/AP_HAL_Linux/Storage.h b/libraries/AP_HAL_Linux/Storage.h index a397e8def8..fb41515254 100644 --- a/libraries/AP_HAL_Linux/Storage.h +++ b/libraries/AP_HAL_Linux/Storage.h @@ -32,6 +32,8 @@ public: void write_dword(uint16_t loc, uint32_t value); void write_block(uint16_t dst, const void* src, size_t n) override; + bool get_storage_ptr(void *&ptr, size_t &size) override; + virtual void _timer_tick(void) override; protected: