Browse Source

AP_HAL_SITL: add get_storage_ptr method

gps-1.3.1
bugobliterator 3 years ago committed by Andrew Tridgell
parent
commit
09096cb355
  1. 13
      libraries/AP_HAL_SITL/Storage.cpp
  2. 1
      libraries/AP_HAL_SITL/Storage.h

13
libraries/AP_HAL_SITL/Storage.cpp

@ -388,4 +388,15 @@ bool Storage::healthy(void) @@ -388,4 +388,15 @@ bool Storage::healthy(void)
return AP_HAL::millis() - _last_empty_ms < 2000;
}
/*
get storage size and ptr
*/
bool Storage::get_storage_ptr(void *&ptr, size_t &size)
{
if (_initialisedType==StorageBackend::None) {
return false;
}
ptr = _buffer;
size = sizeof(_buffer);
return true;
}

1
libraries/AP_HAL_SITL/Storage.h

@ -28,6 +28,7 @@ public: @@ -28,6 +28,7 @@ public:
void init() override {}
void read_block(void *dst, uint16_t src, size_t n) override;
void write_block(uint16_t dst, const void* src, size_t n) override;
bool get_storage_ptr(void *&ptr, size_t &size) override;
void _timer_tick(void) override;
bool healthy(void) override;

Loading…
Cancel
Save