From 12dc2eb3fb63cfd84bd3043c7cb8fd13a7d098a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Daleck=C3=BD?= Date: Thu, 23 Dec 2021 00:15:37 +0100 Subject: [PATCH] Get rid of double math on <512kB targets --- src/main/osd/osd_elements.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/osd/osd_elements.c b/src/main/osd/osd_elements.c index 1787369da..4561cd6f3 100644 --- a/src/main/osd/osd_elements.c +++ b/src/main/osd/osd_elements.c @@ -727,8 +727,8 @@ static void osdElementUpDownReference(osdElementParms_t *element) psiB = earthUpinBodyFrame[1]; // calculate the yaw w/re to zenith (use small angle approx for sine) direction = UP; } - int posX = element->elemPosX + round(scaleRangef(psiB, -M_PIf / 4, M_PIf / 4, -14, 14)); - int posY = element->elemPosY + round(scaleRangef(thetaB, -M_PIf / 4, M_PIf / 4, -8, 8)); + int posX = element->elemPosX + lrintf(scaleRangef(psiB, -M_PIf / 4, M_PIf / 4, -14, 14)); + int posY = element->elemPosY + lrintf(scaleRangef(thetaB, -M_PIf / 4, M_PIf / 4, -8, 8)); osdDisplayWrite(element, posX, posY, DISPLAYPORT_ATTR_NONE, symbol[direction]); }