mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Param: fix convert_class when index is 0
This commit is contained in:
parent
8fb28ac906
commit
78819a1c97
@ -1908,7 +1908,14 @@ void AP_Param::convert_class(uint16_t param_key, void *object_pointer,
|
||||
info.old_key = param_key;
|
||||
info.type = (ap_var_type)group_info[i].type;
|
||||
info.new_name = nullptr;
|
||||
info.old_group_element = (uint16_t(group_info[i].idx)<<group_shift) + old_index;
|
||||
|
||||
uint16_t idx = group_info[i].idx;
|
||||
if (group_shift != 0 && idx == 0) {
|
||||
// Note: Index 0 is treated as 63 for group bit shifting purposes. See group_id()
|
||||
idx = 63;
|
||||
}
|
||||
|
||||
info.old_group_element = (idx << group_shift) + old_index;
|
||||
|
||||
uint8_t old_value[type_size(info.type)];
|
||||
AP_Param *ap = (AP_Param *)&old_value[0];
|
||||
|
Loading…
Reference in New Issue
Block a user