From 2bd04c14fd389caafdeca26683adbabd4af9d84b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Jul 2021 10:59:29 +1000 Subject: [PATCH] AP_OSD: move OSD_LINK_Q_* to a new param table this gives us room for up to 63 more entries --- libraries/AP_OSD/AP_OSD.cpp | 10 ++++++++++ libraries/AP_OSD/AP_OSD.h | 1 + libraries/AP_OSD/AP_OSD_Screen.cpp | 8 +++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libraries/AP_OSD/AP_OSD.cpp b/libraries/AP_OSD/AP_OSD.cpp index e33c18ddb1..1ccba942c1 100644 --- a/libraries/AP_OSD/AP_OSD.cpp +++ b/libraries/AP_OSD/AP_OSD.cpp @@ -35,6 +35,9 @@ #include #include +// macro for easy use of var_info2 +#define AP_SUBGROUPINFO2(element, name, idx, thisclazz, elclazz) { AP_PARAM_GROUP, idx, name, AP_VAROFFSET(thisclazz, element), { group_info : elclazz::var_info2 }, AP_PARAM_FLAG_NESTED_OFFSET } + const AP_Param::GroupInfo AP_OSD::var_info[] = { // @Param: _TYPE @@ -211,6 +214,13 @@ const AP_Param::GroupInfo AP_OSD::var_info[] = { // @Path: AP_OSD_ParamScreen.cpp AP_SUBGROUPINFO(param_screen[1], "6_", 22, AP_OSD, AP_OSD_ParamScreen), #endif + + // additional tables to go beyond 63 limit + AP_SUBGROUPINFO2(screen[0], "1_", 27, AP_OSD, AP_OSD_Screen), + AP_SUBGROUPINFO2(screen[1], "2_", 28, AP_OSD, AP_OSD_Screen), + AP_SUBGROUPINFO2(screen[2], "3_", 29, AP_OSD, AP_OSD_Screen), + AP_SUBGROUPINFO2(screen[3], "4_", 30, AP_OSD, AP_OSD_Screen), + AP_GROUPEND }; diff --git a/libraries/AP_OSD/AP_OSD.h b/libraries/AP_OSD/AP_OSD.h index 1e4b00a91f..65feac4df3 100644 --- a/libraries/AP_OSD/AP_OSD.h +++ b/libraries/AP_OSD/AP_OSD.h @@ -121,6 +121,7 @@ public: // User settable parameters static const struct AP_Param::GroupInfo var_info[]; + static const struct AP_Param::GroupInfo var_info2[]; private: friend class AP_MSP; diff --git a/libraries/AP_OSD/AP_OSD_Screen.cpp b/libraries/AP_OSD/AP_OSD_Screen.cpp index 2e21d8a966..2282268cc6 100644 --- a/libraries/AP_OSD/AP_OSD_Screen.cpp +++ b/libraries/AP_OSD/AP_OSD_Screen.cpp @@ -995,6 +995,10 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = { // @Range: 0 15 AP_SUBGROUPINFO(rngf, "RNGF", 60, AP_OSD_Screen, AP_OSD_Setting), + AP_GROUPEND +}; + +const AP_Param::GroupInfo AP_OSD_Screen::var_info2[] = { // @Param: LINK_Q_EN // @DisplayName: LINK_Q_EN // @Description: Displays Receiver link quality @@ -1009,7 +1013,8 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = { // @DisplayName: LINK_Q_Y // @Description: Vertical position on screen // @Range: 0 15 - AP_SUBGROUPINFO(link_quality, "LINK_Q", 61, AP_OSD_Screen, AP_OSD_Setting), + AP_SUBGROUPINFO(link_quality, "LINK_Q", 1, AP_OSD_Screen, AP_OSD_Setting), + AP_GROUPEND }; @@ -1017,6 +1022,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = { AP_OSD_Screen::AP_OSD_Screen() { AP_Param::setup_object_defaults(this, var_info); + AP_Param::setup_object_defaults(this, var_info2); } //Symbols