mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 09:45:33 +03:00
Merge pull request #1043 from martinbudden/inav_osd_pids
Added PIDs to OSD
This commit is contained in:
commit
1e3f5ef06d
2 changed files with 41 additions and 0 deletions
|
@ -347,6 +347,33 @@ static void osdDrawSingleElement(uint8_t item)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case OSD_ROLL_PIDS:
|
||||||
|
{
|
||||||
|
const pidProfile_t *pidProfile = ¤tProfile->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 = ¤tProfile->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 = ¤tProfile->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:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -386,6 +413,10 @@ void osdDrawElements(void)
|
||||||
osdDrawSingleElement(OSD_MAH_DRAWN);
|
osdDrawSingleElement(OSD_MAH_DRAWN);
|
||||||
osdDrawSingleElement(OSD_CRAFT_NAME);
|
osdDrawSingleElement(OSD_CRAFT_NAME);
|
||||||
osdDrawSingleElement(OSD_ALTITUDE);
|
osdDrawSingleElement(OSD_ALTITUDE);
|
||||||
|
osdDrawSingleElement(OSD_ROLL_PIDS);
|
||||||
|
osdDrawSingleElement(OSD_PITCH_PIDS);
|
||||||
|
osdDrawSingleElement(OSD_YAW_PIDS);
|
||||||
|
osdDrawSingleElement(OSD_POWER);
|
||||||
|
|
||||||
#ifdef GPS
|
#ifdef GPS
|
||||||
#ifdef CMS
|
#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_SPEED] = OSD_POS(2, 2);
|
||||||
osdProfile->item_pos[OSD_GPS_SATS] = OSD_POS(2, 12);
|
osdProfile->item_pos[OSD_GPS_SATS] = OSD_POS(2, 12);
|
||||||
osdProfile->item_pos[OSD_ALTITUDE] = OSD_POS(1, 5);
|
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->rssi_alarm = 20;
|
||||||
osdProfile->cap_alarm = 2200;
|
osdProfile->cap_alarm = 2200;
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "common/time.h"
|
||||||
|
|
||||||
#define VISIBLE_FLAG 0x0800
|
#define VISIBLE_FLAG 0x0800
|
||||||
#define BLINK_FLAG 0x0400
|
#define BLINK_FLAG 0x0400
|
||||||
#define VISIBLE(x) (x & VISIBLE_FLAG)
|
#define VISIBLE(x) (x & VISIBLE_FLAG)
|
||||||
|
@ -40,6 +42,10 @@ typedef enum {
|
||||||
OSD_GPS_SPEED,
|
OSD_GPS_SPEED,
|
||||||
OSD_GPS_SATS,
|
OSD_GPS_SATS,
|
||||||
OSD_ALTITUDE,
|
OSD_ALTITUDE,
|
||||||
|
OSD_ROLL_PIDS,
|
||||||
|
OSD_PITCH_PIDS,
|
||||||
|
OSD_YAW_PIDS,
|
||||||
|
OSD_POWER,
|
||||||
OSD_ITEM_COUNT // MUST BE LAST
|
OSD_ITEM_COUNT // MUST BE LAST
|
||||||
} osd_items_e;
|
} osd_items_e;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue