AP_OSD: allow to fine tune osd position
This commit is contained in:
parent
dc454881df
commit
7873aff0b8
@ -84,6 +84,20 @@ const AP_Param::GroupInfo AP_OSD::var_info[] = {
|
||||
// @RebootRequired: True
|
||||
AP_GROUPINFO("_FONT", 9, AP_OSD, font_num, 0),
|
||||
|
||||
// @Param: _V_OFFSET
|
||||
// @DisplayName: OSD vertical offset
|
||||
// @Description: Sets vertical offset of the osd inside image
|
||||
// @Range: 0 31
|
||||
// @User: Standard
|
||||
AP_GROUPINFO("_V_OFFSET", 10, AP_OSD, v_offset, 16),
|
||||
|
||||
// @Param: _H_OFFSET
|
||||
// @DisplayName: OSD horizontal offset
|
||||
// @Description: Sets horizontal offset of the osd inside image
|
||||
// @Range: 0 63
|
||||
// @User: Standard
|
||||
AP_GROUPINFO("_H_OFFSET", 11, AP_OSD, h_offset, 32),
|
||||
|
||||
AP_GROUPEND
|
||||
};
|
||||
|
||||
|
@ -92,13 +92,13 @@ private:
|
||||
AP_OSD_Setting wind{false, 2, 12};
|
||||
AP_OSD_Setting aspeed{false, 2, 13};
|
||||
AP_OSD_Setting vspeed{true, 24, 9};
|
||||
|
||||
|
||||
#ifdef HAVE_AP_BLHELI_SUPPORT
|
||||
AP_OSD_Setting blh_temp{false, 24, 13};
|
||||
AP_OSD_Setting blh_temp {false, 24, 13};
|
||||
AP_OSD_Setting blh_rpm{false, 22, 12};
|
||||
AP_OSD_Setting blh_amps{false, 24, 14};
|
||||
#endif
|
||||
|
||||
|
||||
AP_OSD_Setting gps_latitude{true, 9, 13};
|
||||
AP_OSD_Setting gps_longitude{true, 9, 14};
|
||||
|
||||
@ -127,7 +127,7 @@ private:
|
||||
void draw_blh_rpm(uint8_t x, uint8_t y);
|
||||
void draw_blh_amps(uint8_t x, uint8_t y);
|
||||
#endif
|
||||
|
||||
|
||||
void draw_gps_latitude(uint8_t x, uint8_t y);
|
||||
void draw_gps_longitude(uint8_t x, uint8_t y);
|
||||
};
|
||||
@ -163,10 +163,13 @@ public:
|
||||
AP_Int8 sw_method;
|
||||
AP_Int8 font_num;
|
||||
|
||||
AP_Int8 v_offset;
|
||||
AP_Int8 h_offset;
|
||||
|
||||
enum {
|
||||
OPTION_DECIMAL_PACK = 1U<<0,
|
||||
};
|
||||
|
||||
|
||||
AP_Int32 options;
|
||||
|
||||
AP_OSD_Screen screen[AP_OSD_NUM_SCREENS];
|
||||
|
@ -337,6 +337,12 @@ void AP_OSD_MAX7456::reinit()
|
||||
_dev->write_register(MAX7456ADD_VM1, BLINK_DUTY_CYCLE_50_50 | BLINK_TIME_3 | BACKGROUND_BRIGHTNESS_28);
|
||||
_dev->write_register(MAX7456ADD_DMM, DMM_CLEAR_DISPLAY);
|
||||
|
||||
//write osd position
|
||||
int8_t hos = constrain_int16(_osd.h_offset, 0, 63);
|
||||
int8_t vos = constrain_int16(_osd.v_offset, 0, 31);
|
||||
_dev->write_register(MAX7456ADD_HOS, hos);
|
||||
_dev->write_register(MAX7456ADD_VOS, vos);
|
||||
|
||||
// force redrawing all screen
|
||||
memset(shadow_frame, 0xFF, sizeof(shadow_frame));
|
||||
memset(shadow_attr, 0xFF, sizeof(shadow_attr));
|
||||
|
Loading…
Reference in New Issue
Block a user