1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 12:25:20 +03:00

Optional string for OME_Label

OME_Label now has an optional string (data).
Profile number is now displayed PID menu using this facility.
This commit is contained in:
jflyper 2016-11-08 14:20:12 +09:00
parent b7342b98e2
commit 7861603c96
2 changed files with 23 additions and 4 deletions

View file

@ -52,12 +52,14 @@
//
static uint8_t tmpProfileIndex;
static uint8_t profileIndex;
static char profileIndexString[] = " PROF n";
static uint8_t tempPid[4][3];
static long cmsx_menuImu_onEnter(void)
{
profileIndex = masterConfig.current_profile_index;
tmpProfileIndex = profileIndex + 1;
profileIndexString[6] = '0' + tmpProfileIndex;
return 0;
}
@ -86,6 +88,15 @@ static long cmsx_PidRead(void)
return 0;
}
static long cmsx_PidOnEnter(void)
{
profileIndexString[6] = '0' + tmpProfileIndex;
cmsx_PidRead();
return 0;
}
static long cmsx_PidWriteback(OSD_Entry *self)
{
UNUSED(self);
@ -105,7 +116,7 @@ static long cmsx_PidWriteback(OSD_Entry *self)
static OSD_Entry cmsx_menuPidEntries[] =
{
{ "-- PID --", OME_Label, NULL, NULL, 0},
{ "-- PID --", OME_Label, NULL, profileIndexString, 0},
{ "ROLL P", OME_UINT8, NULL, &(OSD_UINT8_t){ &tempPid[PIDROLL][0], 0, 200, 1 }, 0 },
{ "ROLL I", OME_UINT8, NULL, &(OSD_UINT8_t){ &tempPid[PIDROLL][1], 0, 200, 1 }, 0 },
@ -126,7 +137,7 @@ static OSD_Entry cmsx_menuPidEntries[] =
static CMS_Menu cmsx_menuPid = {
"XPID",
OME_MENU,
cmsx_PidRead,
cmsx_PidOnEnter,
cmsx_PidWriteback,
NULL,
cmsx_menuPidEntries,