1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 01:35:35 +03:00

Merge pull request #1043 from martinbudden/inav_osd_pids

Added PIDs to OSD
This commit is contained in:
Martin Budden 2017-01-14 09:29:44 +00:00 committed by GitHub
commit 1e3f5ef06d
2 changed files with 41 additions and 0 deletions

View file

@ -347,6 +347,33 @@ static void osdDrawSingleElement(uint8_t item)
return;
}
case OSD_ROLL_PIDS:
{
const pidProfile_t *pidProfile = &currentProfile->pidProfile;
sprintf(buff, "ROL %3d %3d %3d", pidProfile->P8[PIDROLL], pidProfile->I8[PIDROLL], pidProfile->D8[PIDROLL]);
break;
}
case OSD_PITCH_PIDS:
{
const pidProfile_t *pidProfile = &currentProfile->pidProfile;
sprintf(buff, "PIT %3d %3d %3d", pidProfile->P8[PIDPITCH], pidProfile->I8[PIDPITCH], pidProfile->D8[PIDPITCH]);
break;
}
case OSD_YAW_PIDS:
{
const pidProfile_t *pidProfile = &currentProfile->pidProfile;
sprintf(buff, "YAW %3d %3d %3d", pidProfile->P8[PIDYAW], pidProfile->I8[PIDYAW], pidProfile->D8[PIDYAW]);
break;
}
case OSD_POWER:
{
sprintf(buff, "%dW", amperage * vbat / 1000);
break;
}
default:
return;
}
@ -386,6 +413,10 @@ void osdDrawElements(void)
osdDrawSingleElement(OSD_MAH_DRAWN);
osdDrawSingleElement(OSD_CRAFT_NAME);
osdDrawSingleElement(OSD_ALTITUDE);
osdDrawSingleElement(OSD_ROLL_PIDS);
osdDrawSingleElement(OSD_PITCH_PIDS);
osdDrawSingleElement(OSD_YAW_PIDS);
osdDrawSingleElement(OSD_POWER);
#ifdef GPS
#ifdef CMS
@ -417,6 +448,10 @@ void osdResetConfig(osd_profile_t *osdProfile)
osdProfile->item_pos[OSD_GPS_SPEED] = OSD_POS(2, 2);
osdProfile->item_pos[OSD_GPS_SATS] = OSD_POS(2, 12);
osdProfile->item_pos[OSD_ALTITUDE] = OSD_POS(1, 5);
osdProfile->item_pos[OSD_ROLL_PIDS] = OSD_POS(2, 10) | VISIBLE_FLAG;
osdProfile->item_pos[OSD_PITCH_PIDS] = OSD_POS(2, 11) | VISIBLE_FLAG;
osdProfile->item_pos[OSD_YAW_PIDS] = OSD_POS(2, 12) | VISIBLE_FLAG;
osdProfile->item_pos[OSD_POWER] = OSD_POS(15, 1);
osdProfile->rssi_alarm = 20;
osdProfile->cap_alarm = 2200;