From bd479fd8b31aedce716cd06a27838896b2bf3006 Mon Sep 17 00:00:00 2001 From: Anders Hoglund Date: Wed, 8 May 2024 17:37:37 +0200 Subject: [PATCH] CMS profiles. Keep external and local profile items in sync on index change. --- src/main/cms/cms_menu_imu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/cms/cms_menu_imu.c b/src/main/cms/cms_menu_imu.c index 3c80c951a7..b7d86310a0 100644 --- a/src/main/cms/cms_menu_imu.c +++ b/src/main/cms/cms_menu_imu.c @@ -151,6 +151,8 @@ static const void *cmsx_profileIndexOnChange(displayPort_t *displayPort, const v pidProfileIndex = tmpPidProfileIndex - 1; changePidProfile(pidProfileIndex); + pidProfile = pidProfilesMutable(pidProfileIndex); + setProfileIndexString(pidProfileIndexString, pidProfileIndex, pidProfile->profileName); return NULL; } @@ -162,6 +164,8 @@ static const void *cmsx_rateProfileIndexOnChange(displayPort_t *displayPort, con rateProfileIndex = tmpRateProfileIndex - 1; changeControlRateProfile(rateProfileIndex); + memcpy(&rateProfile, controlRateProfiles(rateProfileIndex), sizeof(controlRateConfig_t)); + setProfileIndexString(rateProfileIndexString, rateProfileIndex, controlRateProfilesMutable(rateProfileIndex)->profileName); return NULL; }