AP_HAL_Linux: add get_storage_ptr method

This commit is contained in:
bugobliterator 2021-11-08 19:50:47 +05:30 committed by Andrew Tridgell
parent 7a1044309c
commit f57f106c7f
2 changed files with 15 additions and 0 deletions

View File

@ -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;
}

View File

@ -32,6 +32,8 @@ public:
void write_dword(uint16_t loc, uint32_t value); void write_dword(uint16_t loc, uint32_t value);
void write_block(uint16_t dst, const void* 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;
virtual void _timer_tick(void) override; virtual void _timer_tick(void) override;
protected: protected: