Skip to content

Commit

Permalink
Added d_min for PID osd elements (betaflight#13227)
Browse files Browse the repository at this point in the history
* Added d_min for PID osd elements

* Update src/main/osd/osd_elements.c

Co-authored-by: Jan Post <[email protected]>

---------

Co-authored-by: Jan Post <[email protected]>
  • Loading branch information
Ivan Efimov and KarateBrot authored Dec 15, 2023
1 parent 3eb776e commit bc69a92
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/osd/osd_elements.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,14 @@ void osdFormatDistanceString(char *ptr, int distance, char leadingSymbol)
osdPrintFloat(ptr, leadingSymbol, displayDistance, "", decimalPlaces, false, displaySymbol);
}

static void osdFormatPID(char * buff, const char * label, const pidf_t * pid)
static void osdFormatPID(char * buff, const char * label, uint8_t axis)
{
tfp_sprintf(buff, "%s %3d %3d %3d %3d", label, pid->P, pid->I, pid->D, pid->F);
tfp_sprintf(buff, "%s %3d %3d %3d %3d %3d", label,
currentPidProfile->pid[axis].P,
currentPidProfile->pid[axis].I,
currentPidProfile->pid[axis].D,
currentPidProfile->d_min[axis],
currentPidProfile->pid[axis].F);
}

#ifdef USE_RTC_TIME
Expand Down Expand Up @@ -1419,17 +1424,17 @@ static void osdElementPidRateProfile(osdElementParms_t *element)

static void osdElementPidsPitch(osdElementParms_t *element)
{
osdFormatPID(element->buff, "PIT", &currentPidProfile->pid[PID_PITCH]);
osdFormatPID(element->buff, "PIT", PID_PITCH);
}

static void osdElementPidsRoll(osdElementParms_t *element)
{
osdFormatPID(element->buff, "ROL", &currentPidProfile->pid[PID_ROLL]);
osdFormatPID(element->buff, "ROL", PID_ROLL);
}

static void osdElementPidsYaw(osdElementParms_t *element)
{
osdFormatPID(element->buff, "YAW", &currentPidProfile->pid[PID_YAW]);
osdFormatPID(element->buff, "YAW", PID_YAW);
}

static void osdElementPower(osdElementParms_t *element)
Expand Down

0 comments on commit bc69a92

Please sign in to comment.