Display anti-gravity activity in OSD.
Signed-off-by: Mark Hale <mark.hale@physics.org>
This commit is contained in:
parent
02efd46833
commit
b2e43abf2d
|
@ -168,6 +168,11 @@ void pidSetItermAccelerator(float newItermAccelerator)
|
||||||
itermAccelerator = newItermAccelerator;
|
itermAccelerator = newItermAccelerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float pidItermAccelerator(void)
|
||||||
|
{
|
||||||
|
return itermAccelerator;
|
||||||
|
}
|
||||||
|
|
||||||
void pidStabilisationState(pidStabilisationState_e pidControllerState)
|
void pidStabilisationState(pidStabilisationState_e pidControllerState)
|
||||||
{
|
{
|
||||||
pidStabilisationEnabled = (pidControllerState == PID_STABILISATION_ON) ? true : false;
|
pidStabilisationEnabled = (pidControllerState == PID_STABILISATION_ON) ? true : false;
|
||||||
|
|
|
@ -151,6 +151,7 @@ extern pt1Filter_t throttleLpf;
|
||||||
void pidResetITerm(void);
|
void pidResetITerm(void);
|
||||||
void pidStabilisationState(pidStabilisationState_e pidControllerState);
|
void pidStabilisationState(pidStabilisationState_e pidControllerState);
|
||||||
void pidSetItermAccelerator(float newItermAccelerator);
|
void pidSetItermAccelerator(float newItermAccelerator);
|
||||||
|
float pidItermAccelerator(void);
|
||||||
void pidInitFilters(const pidProfile_t *pidProfile);
|
void pidInitFilters(const pidProfile_t *pidProfile);
|
||||||
void pidInitConfig(const pidProfile_t *pidProfile);
|
void pidInitConfig(const pidProfile_t *pidProfile);
|
||||||
void pidInit(const pidProfile_t *pidProfile);
|
void pidInit(const pidProfile_t *pidProfile);
|
||||||
|
|
|
@ -839,6 +839,7 @@ const clivalue_t valueTable[] = {
|
||||||
{ "osd_tim_2_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_ITEM_TIMER_2]) },
|
{ "osd_tim_2_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_ITEM_TIMER_2]) },
|
||||||
{ "osd_remaining_time_estimate_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_REMAINING_TIME_ESTIMATE]) },
|
{ "osd_remaining_time_estimate_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_REMAINING_TIME_ESTIMATE]) },
|
||||||
{ "osd_flymode_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_FLYMODE]) },
|
{ "osd_flymode_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_FLYMODE]) },
|
||||||
|
{ "osd_anti_gravity_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_ANTI_GRAVITY]) },
|
||||||
{ "osd_throttle_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_THROTTLE_POS]) },
|
{ "osd_throttle_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_THROTTLE_POS]) },
|
||||||
{ "osd_vtx_channel_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_VTX_CHANNEL]) },
|
{ "osd_vtx_channel_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_VTX_CHANNEL]) },
|
||||||
{ "osd_crosshairs_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_CROSSHAIRS]) },
|
{ "osd_crosshairs_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_CROSSHAIRS]) },
|
||||||
|
|
|
@ -520,6 +520,15 @@ static bool osdDrawSingleElement(uint8_t item)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case OSD_ANTI_GRAVITY:
|
||||||
|
{
|
||||||
|
if (pidItermAccelerator() > 1.0f) {
|
||||||
|
strcpy(buff, "AG");
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case OSD_CRAFT_NAME:
|
case OSD_CRAFT_NAME:
|
||||||
// This does not strictly support iterative updating if the craft name changes at run time. But since the craft name is not supposed to be changing this should not matter, and blanking the entire length of the craft name string on update will make it impossible to configure elements to be displayed on the right hand side of the craft name.
|
// This does not strictly support iterative updating if the craft name changes at run time. But since the craft name is not supposed to be changing this should not matter, and blanking the entire length of the craft name string on update will make it impossible to configure elements to be displayed on the right hand side of the craft name.
|
||||||
//TODO: When iterative updating is implemented, change this so the craft name is only printed once whenever the OSD 'flight' screen is entered.
|
//TODO: When iterative updating is implemented, change this so the craft name is only printed once whenever the OSD 'flight' screen is entered.
|
||||||
|
@ -887,6 +896,7 @@ static void osdDrawElements(void)
|
||||||
osdDrawSingleElement(OSD_NUMERICAL_HEADING);
|
osdDrawSingleElement(OSD_NUMERICAL_HEADING);
|
||||||
osdDrawSingleElement(OSD_NUMERICAL_VARIO);
|
osdDrawSingleElement(OSD_NUMERICAL_VARIO);
|
||||||
osdDrawSingleElement(OSD_COMPASS_BAR);
|
osdDrawSingleElement(OSD_COMPASS_BAR);
|
||||||
|
osdDrawSingleElement(OSD_ANTI_GRAVITY);
|
||||||
|
|
||||||
#ifdef USE_GPS
|
#ifdef USE_GPS
|
||||||
if (sensors(SENSOR_GPS)) {
|
if (sensors(SENSOR_GPS)) {
|
||||||
|
|
|
@ -47,6 +47,8 @@ extern const char * const osdTimerSourceNames[OSD_NUM_TIMER_TYPES];
|
||||||
#define OSD_TIMER_PRECISION(timer) ((timer >> 4) & 0x0F)
|
#define OSD_TIMER_PRECISION(timer) ((timer >> 4) & 0x0F)
|
||||||
#define OSD_TIMER_ALARM(timer) ((timer >> 8) & 0xFF)
|
#define OSD_TIMER_ALARM(timer) ((timer >> 8) & 0xFF)
|
||||||
|
|
||||||
|
// NB: to ensure backwards compatibility, new enum values must be appended at the end but before the OSD_XXXX_COUNT entry.
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OSD_RSSI_VALUE,
|
OSD_RSSI_VALUE,
|
||||||
OSD_MAIN_BATT_VOLTAGE,
|
OSD_MAIN_BATT_VOLTAGE,
|
||||||
|
@ -89,6 +91,7 @@ typedef enum {
|
||||||
OSD_RTC_DATETIME,
|
OSD_RTC_DATETIME,
|
||||||
OSD_ADJUSTMENT_RANGE,
|
OSD_ADJUSTMENT_RANGE,
|
||||||
OSD_CORE_TEMPERATURE,
|
OSD_CORE_TEMPERATURE,
|
||||||
|
OSD_ANTI_GRAVITY,
|
||||||
OSD_ITEM_COUNT // MUST BE LAST
|
OSD_ITEM_COUNT // MUST BE LAST
|
||||||
} osd_items_e;
|
} osd_items_e;
|
||||||
|
|
||||||
|
|
|
@ -1020,4 +1020,6 @@ extern "C" {
|
||||||
bool isFlipOverAfterCrashMode(void) {
|
bool isFlipOverAfterCrashMode(void) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float pidItermAccelerator(void) { return 1.0; }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue