Skip to content

Commit

Permalink
AC_Fence: better parameter conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per committed Jan 13, 2024
1 parent 76020df commit 64e56a7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libraries/AC_Fence/AC_Fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,11 @@ AC_Fence::AC_Fence()
AP_Param::setup_object_defaults(this, var_info);

// convert old enable parameter
uint8_t enable_type = 0;
if (AP_Param::get_param_by_index(this, 0, AP_PARAM_INT8, &enable_type) && enable_type) {
_enabled_fences = _present_fences;
_enabled_fences.save(true);
if (!_enabled_fences.configured()) {
uint8_t enable_type = 0;
if (AP_Param::get_param_by_index(this, 0, AP_PARAM_INT8, &enable_type) && enable_type) {
_enabled_fences.set_and_save(_present_fences.get());
}
}
}

Expand Down

0 comments on commit 64e56a7

Please sign in to comment.