Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Compass: avoid loaded-value checks in case of HAL_USE_EMPTY_STORAGE #19488

Merged
merged 1 commit into from Dec 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions libraries/AP_Compass/AP_Compass.cpp
Expand Up @@ -1842,6 +1842,14 @@ bool Compass::configured(uint8_t i)
return false;
}

#ifdef HAL_USE_EMPTY_STORAGE
// the load() call below returns zeroes on empty storage, so the
// check-stored-value check here will always fail. Since nobody
// really cares about the empty-storage case, shortcut out here
// for simplicity.
return true;
#endif

// back up cached value of dev_id
int32_t dev_id_cache_value = _state[id].dev_id;

Expand Down