From f8be256b9f56b5c0037c4625d827fbdf000d10a8 Mon Sep 17 00:00:00 2001 From: Michel Pastor Date: Sat, 19 May 2018 04:57:26 +0200 Subject: [PATCH] Improve attitude angle OSD display Display the level icon for pitch and roll when the displayed value is 0 --- src/main/io/osd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 6933a76262d..dde3949e235 100755 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -1270,13 +1270,13 @@ static bool osdDrawSingleElement(uint8_t item) case OSD_ATTITUDE_ROLL: buff[0] = SYM_ROLL_LEVEL; - if (attitude.values.roll) + if (ABS(attitude.values.roll) >= (osdConfig()->attitude_angle_decimals ? 1 : 10)) buff[0] += (attitude.values.roll < 0 ? -1 : 1); osdFormatCentiNumber(buff + 1, ABS(attitude.values.roll) * 10, 0, osdConfig()->attitude_angle_decimals, 0, 2 + osdConfig()->attitude_angle_decimals); break; case OSD_ATTITUDE_PITCH: - if (attitude.values.pitch == 0) + if (ABS(attitude.values.pitch) < (osdConfig()->attitude_angle_decimals ? 1 : 10)) buff[0] = 'P'; else if (attitude.values.pitch > 0) buff[0] = SYM_PITCH_DOWN;