1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-19 14:25:16 +03:00

changed variable type

This commit is contained in:
Alexander van Saase 2021-01-13 14:28:27 +01:00
parent 3305d536bc
commit 4eaa18b928
3 changed files with 4 additions and 4 deletions

View file

@ -3022,7 +3022,7 @@ groups:
max: 10
- name: osd_pan_servo_us2centideg
type: uint16_t
type: float
field: pan_servo_us2centideg
default_value: 9
min: -36

View file

@ -1134,7 +1134,7 @@ static int16_t osdPanServoHomeDirectionOffset(void)
int8_t servoIndex = osdConfig()->pan_servo_index;
int16_t servoPosition = servo[servoIndex];
int16_t servoMiddle = servoParams(servoIndex)->middle;
return (int16_t)((servoPosition - servoMiddle) * CENTIDEGREES_TO_DEGREES(osdConfig()->pan_servo_us2centideg));
return (int16_t)CENTIDEGREES_TO_DEGREES((servoPosition - servoMiddle) * osdConfig()->pan_servo_us2centideg);
}
#endif
@ -1347,7 +1347,7 @@ static bool osdDrawSingleElement(uint8_t item)
else
{
int16_t panHomeDirOffset = 0;
if (!osdConfig()->pan_servo_us2centideg){
if (!(osdConfig()->pan_servo_us2centideg == 0)){
panHomeDirOffset = osdPanServoHomeDirectionOffset();
}
int homeDirection = GPS_directionToHome - DECIDEGREES_TO_DEGREES(osdGetHeading()) + panHomeDirOffset;

View file

@ -349,7 +349,7 @@ typedef struct osdConfig_s {
uint8_t right_sidebar_scroll_step; // Same as left_sidebar_scroll_step, but for the right sidebar.
bool osd_home_position_arm_screen;
uint8_t pan_servo_index; // Index of the pan servo used for home direction offset
uint16_t pan_servo_us2centideg; // cenitdegrees per us pwm
float pan_servo_us2centideg; // cenitdegrees per us pwm
uint8_t crsf_lq_format;
} osdConfig_t;