Skip to content

Commit

Permalink
CMS copy profiles was hardcoded for 3 profiles only, fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersHoglund committed Jun 28, 2024
1 parent fea3988 commit 6f4327a
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/main/cms/cms_menu_imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,15 +886,31 @@ static CMS_Menu cmsx_menuFilterPerProfile = {
static uint8_t cmsx_dstPidProfile;
static uint8_t cmsx_dstControlRateProfile;

static const char * const cmsx_ProfileNames[] = {
#if PID_PROFILE_COUNT >= CONTROL_RATE_PROFILE_COUNT
#define PROFILE_COUNT PID_PROFILE_COUNT
#else
#define PROFILE_COUNT CONTROL_RATE_PROFILE_COUNT
#endif

static const char * const cmsx_ProfileNames[PROFILE_COUNT+1] = {
"-",
"1",
"2",
"3"
#if PROFILE_COUNT >= 4
,"4"
#endif
#if PROFILE_COUNT >= 5
,"5"
#endif
#if PROFILE_COUNT >= 6
,"6"
#endif

};

static OSD_TAB_t cmsx_PidProfileTable = { &cmsx_dstPidProfile, 3, cmsx_ProfileNames };
static OSD_TAB_t cmsx_ControlRateProfileTable = { &cmsx_dstControlRateProfile, 3, cmsx_ProfileNames };
static OSD_TAB_t cmsx_PidProfileTable = { &cmsx_dstPidProfile, PID_PROFILE_COUNT, cmsx_ProfileNames };
static OSD_TAB_t cmsx_ControlRateProfileTable = { &cmsx_dstControlRateProfile, CONTROL_RATE_PROFILE_COUNT, cmsx_ProfileNames };

static const void *cmsx_menuCopyProfile_onEnter(displayPort_t *pDisp)
{
Expand Down

0 comments on commit 6f4327a

Please sign in to comment.