mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 18:38:28 -04:00
AP_Param: One more nexted group recursion disableable by macro
* c.f. e5515bb6ef82
This commit is contained in:
parent
9832ac879e
commit
8b3d013294
@ -492,13 +492,16 @@ AP_Param::find_group(const char *name, uint8_t vindex, const struct GroupInfo *g
|
|||||||
for (uint8_t i=0;
|
for (uint8_t i=0;
|
||||||
(type=PGM_UINT8(&group_info[i].type)) != AP_PARAM_NONE;
|
(type=PGM_UINT8(&group_info[i].type)) != AP_PARAM_NONE;
|
||||||
i++) {
|
i++) {
|
||||||
|
#ifdef AP_NESTED_GROUPS_ENABLED
|
||||||
if (type == AP_PARAM_GROUP) {
|
if (type == AP_PARAM_GROUP) {
|
||||||
const struct GroupInfo *ginfo = (const struct GroupInfo *)PGM_POINTER(&group_info[i].group_info);
|
const struct GroupInfo *ginfo = (const struct GroupInfo *)PGM_POINTER(&group_info[i].group_info);
|
||||||
AP_Param *ap = find_group(name, vindex, ginfo, ptype);
|
AP_Param *ap = find_group(name, vindex, ginfo, ptype);
|
||||||
if (ap != NULL) {
|
if (ap != NULL) {
|
||||||
return ap;
|
return ap;
|
||||||
}
|
}
|
||||||
} else if (strcasecmp_P(name, group_info[i].name) == 0) {
|
} else
|
||||||
|
#endif // AP_NESTED_GROUPS_ENABLED
|
||||||
|
if (strcasecmp_P(name, group_info[i].name) == 0) {
|
||||||
uintptr_t p = PGM_POINTER(&_var_info[vindex].ptr);
|
uintptr_t p = PGM_POINTER(&_var_info[vindex].ptr);
|
||||||
*ptype = (enum ap_var_type)type;
|
*ptype = (enum ap_var_type)type;
|
||||||
return (AP_Param *)(p + PGM_POINTER(&group_info[i].offset));
|
return (AP_Param *)(p + PGM_POINTER(&group_info[i].offset));
|
||||||
|
Loading…
Reference in New Issue
Block a user