Skip to content

Commit edc6f9d

Browse files
committed
Merge pull request #6477 from avsaase/avs-hide-location-arming
Option to remove home position from arming screen
1 parent 01e8216 commit edc6f9d

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

docs/Settings.md

+1
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@
367367
| osd_gforce_alarm | 5 | Value above which the OSD g force indicator will blink (g) |
368368
| osd_gforce_axis_alarm_max | 5 | Value above which the OSD axis g force indicators will blink (g) |
369369
| osd_gforce_axis_alarm_min | -5 | Value under which the OSD axis g force indicators will blink (g) |
370+
| osd_home_position_arm_screen | ON | Should home position coordinates be displayed on the arming screen. |
370371
| osd_horizon_offset | 0 | To vertically adjust the whole OSD and AHI and scrolling bars |
371372
| osd_hud_homepoint | 0 | To 3D-display the home point location in the hud |
372373
| osd_hud_homing | 0 | To display little arrows around the crossair showing where the home point is in the hud |

src/main/fc/settings.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -2969,6 +2969,10 @@ groups:
29692969
default_value: 0
29702970
description: Same as left_sidebar_scroll_step, but for the right sidebar
29712971

2972+
- name: osd_home_position_arm_screen
2973+
type: bool
2974+
default_value: "ON"
2975+
description: Should home position coordinates be displayed on the arming screen.
29722976

29732977
- name: PG_SYSTEM_CONFIG
29742978
type: systemConfig_t

src/main/io/osd.c

+11-8
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static bool osdDisplayHasCanvas;
185185

186186
#define AH_MAX_PITCH_DEFAULT 20 // Specify default maximum AHI pitch value displayed (degrees)
187187

188-
PG_REGISTER_WITH_RESET_TEMPLATE(osdConfig_t, osdConfig, PG_OSD_CONFIG, 13);
188+
PG_REGISTER_WITH_RESET_TEMPLATE(osdConfig_t, osdConfig, PG_OSD_CONFIG, 14);
189189
PG_REGISTER_WITH_RESET_FN(osdLayoutsConfig_t, osdLayoutsConfig, PG_OSD_LAYOUTS_CONFIG, 0);
190190

191191
static int digitCount(int32_t value)
@@ -2581,6 +2581,7 @@ PG_RESET_TEMPLATE(osdConfig_t, osdConfig,
25812581
.left_sidebar_scroll = OSD_SIDEBAR_SCROLL_NONE,
25822582
.right_sidebar_scroll = OSD_SIDEBAR_SCROLL_NONE,
25832583
.sidebar_scroll_arrows = 0,
2584+
.osd_home_position_arm_screen = true,
25842585

25852586
.units = OSD_UNIT_METRIC,
25862587
.main_voltage_decimals = 1,
@@ -3048,13 +3049,15 @@ static void osdShowArmed(void)
30483049
#if defined(USE_GPS)
30493050
if (feature(FEATURE_GPS)) {
30503051
if (STATE(GPS_FIX_HOME)) {
3051-
osdFormatCoordinate(buf, SYM_LAT, GPS_home.lat);
3052-
displayWrite(osdDisplayPort, (osdDisplayPort->cols - strlen(buf)) / 2, y, buf);
3053-
osdFormatCoordinate(buf, SYM_LON, GPS_home.lon);
3054-
displayWrite(osdDisplayPort, (osdDisplayPort->cols - strlen(buf)) / 2, y + 1, buf);
3055-
int digits = osdConfig()->plus_code_digits;
3056-
olc_encode(GPS_home.lat, GPS_home.lon, digits, buf, sizeof(buf));
3057-
displayWrite(osdDisplayPort, (osdDisplayPort->cols - strlen(buf)) / 2, y + 2, buf);
3052+
if (osdConfig()->osd_home_position_arm_screen){
3053+
osdFormatCoordinate(buf, SYM_LAT, GPS_home.lat);
3054+
displayWrite(osdDisplayPort, (osdDisplayPort->cols - strlen(buf)) / 2, y, buf);
3055+
osdFormatCoordinate(buf, SYM_LON, GPS_home.lon);
3056+
displayWrite(osdDisplayPort, (osdDisplayPort->cols - strlen(buf)) / 2, y + 1, buf);
3057+
int digits = osdConfig()->plus_code_digits;
3058+
olc_encode(GPS_home.lat, GPS_home.lon, digits, buf, sizeof(buf));
3059+
displayWrite(osdDisplayPort, (osdDisplayPort->cols - strlen(buf)) / 2, y + 2, buf);
3060+
}
30583061
y += 4;
30593062
#if defined (USE_SAFE_HOME)
30603063
if (isSafeHomeInUse()) {

src/main/io/osd.h

+1
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ typedef struct osdConfig_s {
345345
int8_t sidebar_horizontal_offset; // Horizontal offset from default position. Units are grid slots for grid OSDs, pixels for pixel based OSDs. Positive values move sidebars closer to the edges.
346346
uint8_t left_sidebar_scroll_step; // How many units each sidebar step represents. 0 means the default value for the scroll type.
347347
uint8_t right_sidebar_scroll_step; // Same as left_sidebar_scroll_step, but for the right sidebar.
348+
bool osd_home_position_arm_screen;
348349

349350
uint8_t crsf_lq_format;
350351

0 commit comments

Comments
 (0)