From af8794779b9f850bf876db6db6f43587f9f26bc9 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Sun, 19 Jan 2025 11:43:00 +0100 Subject: [PATCH 1/8] Revert to actual DJI font, now that DJI fixed G2 and newer --- src/main/io/dji_osd_symbols.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/io/dji_osd_symbols.h b/src/main/io/dji_osd_symbols.h index 83ccad7c82d..747b3ba9020 100644 --- a/src/main/io/dji_osd_symbols.h +++ b/src/main/io/dji_osd_symbols.h @@ -32,27 +32,30 @@ #define DJI_SYM_ROLL 0x14 #define DJI_SYM_PITCH 0x15 #define DJI_SYM_TEMPERATURE 0x7A -#define DJI_SYM_MAX 0x24 // GPS and navigation #define DJI_SYM_LAT 0x89 #define DJI_SYM_LON 0x98 #define DJI_SYM_ALTITUDE 0x7F +#define DJI_SYM_TOTAL_DISTANCE 0x71 #define DJI_SYM_OVER_HOME 0x05 // RSSI #define DJI_SYM_RSSI 0x01 +#define DJI_SYM_LINK_QUALITY 0x7B // Throttle Position (%) #define DJI_SYM_THR 0x04 // Unit Icons (Metric) #define DJI_SYM_M 0x0C +#define DJI_SYM_KM 0x7D #define DJI_SYM_C 0x0E // Unit Icons (Imperial) -#define DJI_SYM_F 0x0D #define DJI_SYM_FT 0x0F +#define DJI_SYM_MILES 0x7E +#define DJI_SYM_F 0x0D // Heading Graphics #define DJI_SYM_HEADING_N 0x18 @@ -63,13 +66,12 @@ #define DJI_SYM_HEADING_LINE 0x1D // AH Center screen Graphics -#define DJI_SYM_CROSSHAIR_LEFT 0x72 -#define DJI_SYM_CROSSHAIR_CENTRE 0x73 -#define DJI_SYM_CROSSHAIR_RIGHT 0x74 +#define DJI_SYM_AH_CENTER_LINE 0x72 +#define DJI_SYM_AH_CENTER 0x73 +#define DJI_SYM_AH_CENTER_LINE_RIGHT 0x74 #define DJI_SYM_AH_RIGHT 0x02 #define DJI_SYM_AH_LEFT 0x03 #define DJI_SYM_AH_DECORATION 0x13 -#define DJI_SYM_SMALL_CROSSHAIR 0x7E // Satellite Graphics #define DJI_SYM_SAT_L 0x1E @@ -95,8 +97,6 @@ #define DJI_SYM_ARROW_SMALL_UP 0x75 #define DJI_SYM_ARROW_SMALL_DOWN 0x76 -#define DJI_SYM_ARROW_SMALL_RIGHT 0x77 -#define DJI_SYM_ARROW_SMALL_LEFT 0x78 // AH Bars #define DJI_SYM_AH_BAR9_0 0x80 @@ -136,17 +136,19 @@ #define DJI_SYM_WATT 0x57 // 0x57 is 'W' // Time -#define DJI_SYM_ON_H 0x70 -#define DJI_SYM_FLY_H 0x71 #define DJI_SYM_ON_M 0x9B #define DJI_SYM_FLY_M 0x9C // Speed +#define DJI_SYM_SPEED 0x70 #define DJI_SYM_KPH 0x9E #define DJI_SYM_MPH 0x9D #define DJI_SYM_MPS 0x9F #define DJI_SYM_FTPS 0x99 +// Menu cursor +#define DJI_SYM_CURSOR DJI_SYM_AH_LEFT + // Stick overlays #define DJI_SYM_STICK_OVERLAY_SPRITE_HIGH 0x08 #define DJI_SYM_STICK_OVERLAY_SPRITE_MID 0x09 From 3dedae18c369f93c9e8c1900c2d322978835d3da Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Sun, 19 Jan 2025 12:14:09 +0100 Subject: [PATCH 2/8] symbols now match bf font again. osd maps have been updated where it makes sense --- src/main/io/displayport_msp_dji_compat.c | 24 ++++++++++++++---------- src/main/io/dji_osd_symbols.h | 3 +++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/main/io/displayport_msp_dji_compat.c b/src/main/io/displayport_msp_dji_compat.c index 74805fa0598..469980d78b1 100644 --- a/src/main/io/displayport_msp_dji_compat.c +++ b/src/main/io/displayport_msp_dji_compat.c @@ -225,8 +225,9 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) return DJI_SYM_M; case SYM_TOTAL: - return DJI_SYM_FLY_H; -/* + return DJI_SYM_TOTAL_DISTANCE; + + /* case SYM_ALT_KM: return DJI_SYM_ALT_KM; @@ -249,6 +250,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_DIST_NM: return DJI_SYM_DIST_NM; */ + case SYM_M: return DJI_SYM_M; @@ -319,11 +321,13 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_BLANK: return DJI_SYM_BLANK; +/* case SYM_ON_H: return DJI_SYM_ON_H; case SYM_FLY_H: return DJI_SYM_FLY_H; +*/ case SYM_ON_M: return DJI_SYM_ON_M; @@ -480,13 +484,13 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) */ case SYM_AH_CH_LEFT: case SYM_AH_CH_AIRCRAFT1: - return DJI_SYM_CROSSHAIR_LEFT; + return DJI_SYM_AH_CENTER_LINE; case SYM_AH_CH_CENTER: case SYM_AH_CH_AIRCRAFT2: - return DJI_SYM_CROSSHAIR_CENTRE; + return DJI_SYM_AH_CENTER; case SYM_AH_CH_RIGHT: case SYM_AH_CH_AIRCRAFT3: - return DJI_SYM_CROSSHAIR_RIGHT; + return DJI_SYM_AH_CENTER_LINE_RIGHT; case SYM_AH_CH_AIRCRAFT0: case SYM_AH_CH_AIRCRAFT4: @@ -495,21 +499,21 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_AH_CH_TYPE3: return DJI_SYM_NONE; case (SYM_AH_CH_TYPE3+1): - return DJI_SYM_SMALL_CROSSHAIR; + return DJI_SYM_AH_CENTER; case (SYM_AH_CH_TYPE3+2): return DJI_SYM_NONE; case SYM_AH_CH_TYPE4: return DJI_SYM_HYPHEN; case (SYM_AH_CH_TYPE4+1): - return DJI_SYM_SMALL_CROSSHAIR; + return DJI_SYM_AH_CENTER; case (SYM_AH_CH_TYPE4+2): return DJI_SYM_HYPHEN; case SYM_AH_CH_TYPE5: return DJI_SYM_STICK_OVERLAY_HORIZONTAL; case (SYM_AH_CH_TYPE5+1): - return DJI_SYM_SMALL_CROSSHAIR; + return DJI_SYM_AH_CENTER; case (SYM_AH_CH_TYPE5+2): return DJI_SYM_STICK_OVERLAY_HORIZONTAL; @@ -523,14 +527,14 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_AH_CH_TYPE7: return DJI_SYM_ARROW_SMALL_LEFT; case (SYM_AH_CH_TYPE7+1): - return DJI_SYM_SMALL_CROSSHAIR; + return DJI_SYM_AH_CENTER; case (SYM_AH_CH_TYPE7+2): return DJI_SYM_ARROW_SMALL_RIGHT; case SYM_AH_CH_TYPE8: return DJI_SYM_AH_LEFT; case (SYM_AH_CH_TYPE8+1): - return DJI_SYM_SMALL_CROSSHAIR; + return DJI_SYM_AH_CENTER; case (SYM_AH_CH_TYPE8+2): return DJI_SYM_AH_RIGHT; diff --git a/src/main/io/dji_osd_symbols.h b/src/main/io/dji_osd_symbols.h index 747b3ba9020..7c63eedb645 100644 --- a/src/main/io/dji_osd_symbols.h +++ b/src/main/io/dji_osd_symbols.h @@ -32,6 +32,7 @@ #define DJI_SYM_ROLL 0x14 #define DJI_SYM_PITCH 0x15 #define DJI_SYM_TEMPERATURE 0x7A +#define DJI_SYM_MAX 0x24 // GPS and navigation #define DJI_SYM_LAT 0x89 @@ -97,6 +98,8 @@ #define DJI_SYM_ARROW_SMALL_UP 0x75 #define DJI_SYM_ARROW_SMALL_DOWN 0x76 +#define DJI_SYM_ARROW_SMALL_RIGHT 0x77 +#define DJI_SYM_ARROW_SMALL_LEFT 0x78 // AH Bars #define DJI_SYM_AH_BAR9_0 0x80 From 2820e39698f5150c8faada2d9ecc470faaf5e7bb Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Sun, 19 Jan 2025 14:03:53 +0100 Subject: [PATCH 3/8] Update logo message --- src/main/io/displayport_msp_dji_compat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/io/displayport_msp_dji_compat.c b/src/main/io/displayport_msp_dji_compat.c index 469980d78b1..41cd8f0be05 100644 --- a/src/main/io/displayport_msp_dji_compat.c +++ b/src/main/io/displayport_msp_dji_compat.c @@ -27,10 +27,10 @@ #include // 0123456789 -static char *dji_logo = " DJI, FIX " - " THE OSD " - " FOR O3 " - " AND O4 "; +static char *dji_logo = " DJI, " + " PLEASE " + " FIX YOUR " + " OSD FONT "; uint8_t getDJICharacter(uint8_t ch, uint8_t page) { From ae6da62a80eae49ab4f098c1dd9029b00ab40bb8 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Sun, 19 Jan 2025 21:52:50 +0100 Subject: [PATCH 4/8] Add LQ and symbols that are used in more than one place. --- src/main/io/displayport_msp_dji_compat.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/io/displayport_msp_dji_compat.c b/src/main/io/displayport_msp_dji_compat.c index 41cd8f0be05..87d5493bd65 100644 --- a/src/main/io/displayport_msp_dji_compat.c +++ b/src/main/io/displayport_msp_dji_compat.c @@ -57,7 +57,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) return DJI_SYM_RSSI; case SYM_LQ: - return 'Q'; + return SJI_SYM_LINK_QUALITY; case SYM_LAT: return DJI_SYM_LAT; @@ -142,12 +142,13 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_MAH: return DJI_SYM_MAH; - +/* case SYM_AH_KM: return 'K'; case SYM_AH_MI: return 'M'; + */ /* case SYM_VTX_POWER: return DJI_SYM_VTX_POWER; @@ -262,9 +263,9 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) /* case SYM_NM: return DJI_SYM_NM; -*/ case SYM_WIND_HORIZONTAL: return 'W'; // W for wind +*/ /* case SYM_WIND_VERTICAL: @@ -273,8 +274,10 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_3D_KT: return DJI_SYM_3D_KT; */ +/* case SYM_AIR: return 'A'; // A for airspeed + */ case SYM_3D_KMH: return DJI_SYM_KPH; From 34979872d38e750d64687fa4b9b01eb68a238283 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Sun, 19 Jan 2025 21:56:56 +0100 Subject: [PATCH 5/8] Fix typo --- src/main/io/displayport_msp_dji_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/io/displayport_msp_dji_compat.c b/src/main/io/displayport_msp_dji_compat.c index 87d5493bd65..aefff48685e 100644 --- a/src/main/io/displayport_msp_dji_compat.c +++ b/src/main/io/displayport_msp_dji_compat.c @@ -57,7 +57,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) return DJI_SYM_RSSI; case SYM_LQ: - return SJI_SYM_LINK_QUALITY; + return DJI_SYM_LINK_QUALITY; case SYM_LAT: return DJI_SYM_LAT; From 1d708c14638e411cdc5d476564c9e57a61eece63 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Mon, 20 Jan 2025 00:10:35 +0100 Subject: [PATCH 6/8] remove more ambiguity. --- src/main/io/displayport_msp_dji_compat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/io/displayport_msp_dji_compat.c b/src/main/io/displayport_msp_dji_compat.c index aefff48685e..fdd4b4d51d0 100644 --- a/src/main/io/displayport_msp_dji_compat.c +++ b/src/main/io/displayport_msp_dji_compat.c @@ -256,10 +256,11 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) return DJI_SYM_M; case SYM_KM: - return 'K'; + return DJI_SYM_KM; case SYM_MI: - return 'M'; + return DJI_SYM_MILES; + /* case SYM_NM: return DJI_SYM_NM; @@ -277,14 +278,13 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) /* case SYM_AIR: return 'A'; // A for airspeed - */ case SYM_3D_KMH: return DJI_SYM_KPH; case SYM_3D_MPH: return DJI_SYM_MPH; - + */ case SYM_RPM: return DJI_SYM_RPM; @@ -352,10 +352,10 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_ZERO_HALF_LEADING_DOT: return DJI_SYM_ZERO_HALF_LEADING_DOT; -*/ case SYM_AUTO_THR0: return 'A'; +*/ case SYM_AUTO_THR1: return DJI_SYM_THR; From 507097aef4a93713786bdca180683876aafd3e61 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:53:12 +0100 Subject: [PATCH 7/8] tabs vs spaces --- src/main/io/displayport_msp_dji_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/io/displayport_msp_dji_compat.c b/src/main/io/displayport_msp_dji_compat.c index fdd4b4d51d0..1982d174fc5 100644 --- a/src/main/io/displayport_msp_dji_compat.c +++ b/src/main/io/displayport_msp_dji_compat.c @@ -29,7 +29,7 @@ // 0123456789 static char *dji_logo = " DJI, " " PLEASE " - " FIX YOUR " + " FIX YOUR " " OSD FONT "; uint8_t getDJICharacter(uint8_t ch, uint8_t page) From b511de778696c9f71989356aae9a24808a36fd3a Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Mon, 20 Jan 2025 12:00:37 +0100 Subject: [PATCH 8/8] re-add thr0 --- src/main/io/displayport_msp_dji_compat.c | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/io/displayport_msp_dji_compat.c b/src/main/io/displayport_msp_dji_compat.c index 1982d174fc5..8daffbb4d15 100644 --- a/src/main/io/displayport_msp_dji_compat.c +++ b/src/main/io/displayport_msp_dji_compat.c @@ -143,13 +143,12 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_MAH: return DJI_SYM_MAH; /* - case SYM_AH_KM: - return 'K'; + case SYM_AH_KM: // AH / KM + return '?'; + + case SYM_AH_MI: // AH / MI + return '?'; - case SYM_AH_MI: - return 'M'; - */ -/* case SYM_VTX_POWER: return DJI_SYM_VTX_POWER; @@ -266,7 +265,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) return DJI_SYM_NM; case SYM_WIND_HORIZONTAL: return 'W'; // W for wind -*/ + */ /* case SYM_WIND_VERTICAL: @@ -274,7 +273,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_3D_KT: return DJI_SYM_3D_KT; -*/ + */ /* case SYM_AIR: return 'A'; // A for airspeed @@ -293,7 +292,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) /* case SYM_100FTM: return DJI_SYM_100FTM; -*/ + */ case SYM_MS: return DJI_SYM_MPS; @@ -311,7 +310,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_MAH_MI_1: return DJI_SYM_MAH_MI_1; -*/ + */ case SYM_THR: return DJI_SYM_THR; @@ -330,7 +329,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_FLY_H: return DJI_SYM_FLY_H; -*/ + */ case SYM_ON_M: return DJI_SYM_ON_M; @@ -352,10 +351,10 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_ZERO_HALF_LEADING_DOT: return DJI_SYM_ZERO_HALF_LEADING_DOT; + */ case SYM_AUTO_THR0: return 'A'; -*/ case SYM_AUTO_THR1: return DJI_SYM_THR; @@ -387,7 +386,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_GFORCE_Z: return DJI_SYM_GFORCE_Z; -*/ + */ case SYM_BARO_TEMP: return DJI_SYM_TEMPERATURE; @@ -408,7 +407,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case TEMP_SENSOR_SYM_COUNT: return DJI_TEMP_SENSOR_SYM_COUNT; -*/ + */ case SYM_HEADING_N: return DJI_SYM_HEADING_N; @@ -432,7 +431,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) /* case SYM_PROFILE: return DJI_SYM_PROFILE; -*/ + */ case SYM_SWITCH_INDICATOR_LOW: return DJI_SYM_STICK_OVERLAY_SPRITE_LOW; @@ -474,7 +473,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_CROSS_TRACK_ERROR: return DJI_SYM_CROSS_TRACK_ERROR; -*/ + */ case SYM_AH_LEFT: return DJI_SYM_AH_LEFT; @@ -484,7 +483,8 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) /* case SYM_AH_DECORATION_COUNT: return DJI_SYM_AH_DECORATION_COUNT; -*/ + */ + case SYM_AH_CH_LEFT: case SYM_AH_CH_AIRCRAFT1: return DJI_SYM_AH_CENTER_LINE; @@ -697,7 +697,7 @@ uint8_t getDJICharacter(uint8_t ch, uint8_t page) case SYM_FLIGHT_DIST_REMAINING: return DJI_SYM_FLIGHT_DIST_REMAINING; -*/ + */ case SYM_HUD_ARROWS_L1: return DJI_SYM_ARROW_SMALL_LEFT;