AP_HAL_ChibiOS: add get_storage_ptr method

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

View File

@ -468,4 +468,18 @@ bool Storage::erase(void)
#endif
}
/*
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;
}
#endif // HAL_USE_EMPTY_STORAGE

View File

@ -46,6 +46,7 @@ public:
void _timer_tick(void) override;
bool healthy(void) override;
bool get_storage_ptr(void *&ptr, size_t &size) override;
private:
enum class StorageBackend: uint8_t {