AP_OSD: remove OSDn_BTEMP_* params when BARO_MAX_INSTANCES=1

This commit is contained in:
Tatsuya Yamaguchi 2021-09-28 16:50:14 +09:00 committed by Peter Barker
parent f249fe7eb2
commit 0b06d4072e
2 changed files with 11 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#include <GCS_MAVLink/GCS.h>
#include <AP_OLC/AP_OLC.h>
#include <AP_MSP/msp.h>
#include <AP_Baro/AP_Baro.h>
#ifndef OSD_ENABLED
#define OSD_ENABLED !HAL_MINIMIZE_FEATURES
@ -176,7 +177,9 @@ private:
AP_OSD_Setting roll_angle{false, 0, 0};
AP_OSD_Setting pitch_angle{false, 0, 0};
AP_OSD_Setting temp{false, 0, 0};
#if BARO_MAX_INSTANCES > 1
AP_OSD_Setting btemp{false, 0, 0};
#endif
AP_OSD_Setting hdop{false, 0, 0};
AP_OSD_Setting waypoint{false, 0, 0};
AP_OSD_Setting xtrack_error{false, 0, 0};
@ -252,7 +255,9 @@ private:
void draw_roll_angle(uint8_t x, uint8_t y);
void draw_pitch_angle(uint8_t x, uint8_t y);
void draw_temp(uint8_t x, uint8_t y);
#if BARO_MAX_INSTANCES > 1
void draw_btemp(uint8_t x, uint8_t y);
#endif
void draw_hdop(uint8_t x, uint8_t y);
void draw_waypoint(uint8_t x, uint8_t y);
void draw_xtrack_error(uint8_t x, uint8_t y);

View File

@ -33,7 +33,6 @@
#include <AP_Common/Location.h>
#include <AP_BattMonitor/AP_BattMonitor.h>
#include <AP_GPS/AP_GPS.h>
#include <AP_Baro/AP_Baro.h>
#include <AP_RTC/AP_RTC.h>
#include <AP_MSP/msp.h>
#include <AP_OLC/AP_OLC.h>
@ -603,6 +602,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
// @Range: 0 15
AP_SUBGROUPINFO(eff, "EFF", 36, AP_OSD_Screen, AP_OSD_Setting),
#if BARO_MAX_INSTANCES > 1
// @Param: BTEMP_EN
// @DisplayName: BTEMP_EN
// @Description: Displays temperature reported by secondary barometer
@ -618,6 +618,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
// @Description: Vertical position on screen
// @Range: 0 15
AP_SUBGROUPINFO(btemp, "BTEMP", 37, AP_OSD_Screen, AP_OSD_Setting),
#endif
// @Param: ATEMP_EN
// @DisplayName: ATEMP_EN
@ -1961,12 +1962,14 @@ void AP_OSD_Screen::draw_climbeff(uint8_t x, uint8_t y)
}
}
#if BARO_MAX_INSTANCES > 1
void AP_OSD_Screen::draw_btemp(uint8_t x, uint8_t y)
{
AP_Baro &barometer = AP::baro();
float btmp = barometer.get_temperature(1);
backend->write(x, y, false, "%3d%c", (int)u_scale(TEMPERATURE, btmp), u_icon(TEMPERATURE));
}
#endif
void AP_OSD_Screen::draw_atemp(uint8_t x, uint8_t y)
{
@ -2193,7 +2196,9 @@ void AP_OSD_Screen::draw(void)
DRAW_SETTING(roll_angle);
DRAW_SETTING(pitch_angle);
DRAW_SETTING(temp);
#if BARO_MAX_INSTANCES > 1
DRAW_SETTING(btemp);
#endif
DRAW_SETTING(atemp);
DRAW_SETTING(hdop);
DRAW_SETTING(flightime);