mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-24 01:28:29 -04:00
AP_OSD: fix disable value for terrain alt warning
This commit is contained in:
parent
00b44ff6c8
commit
defc81443c
@ -173,8 +173,8 @@ const AP_Param::GroupInfo AP_OSD::var_info[] = {
|
|||||||
#if AP_TERRAIN_AVAILABLE
|
#if AP_TERRAIN_AVAILABLE
|
||||||
// @Param: _W_TERR
|
// @Param: _W_TERR
|
||||||
// @DisplayName: Terrain warn level
|
// @DisplayName: Terrain warn level
|
||||||
// @Description: Set level below which TER_HGT item will flash.
|
// @Description: Set level below which TER_HGT item will flash. -1 disables.
|
||||||
// @Range: 1 3000
|
// @Range: -1 3000
|
||||||
// @Units: m
|
// @Units: m
|
||||||
// @User: Standard
|
// @User: Standard
|
||||||
AP_GROUPINFO("_W_TERR", 23, AP_OSD, warn_terr, -1),
|
AP_GROUPINFO("_W_TERR", 23, AP_OSD, warn_terr, -1),
|
||||||
|
@ -1941,7 +1941,8 @@ void AP_OSD_Screen::draw_hgt_abvterr(uint8_t x, uint8_t y)
|
|||||||
|
|
||||||
float terrain_altitude;
|
float terrain_altitude;
|
||||||
if (terrain != nullptr && terrain->height_above_terrain(terrain_altitude,true)) {
|
if (terrain != nullptr && terrain->height_above_terrain(terrain_altitude,true)) {
|
||||||
backend->write(x, y, terrain_altitude < osd->warn_terr, "%4d%c%c", (int)u_scale(ALTITUDE, terrain_altitude), u_icon(ALTITUDE), SYM_TERALT);
|
bool blink = (osd->warn_terr != -1)? (terrain_altitude < osd->warn_terr) : false; //blink if warn_terr is not disabled and alt above terrain is below warning value
|
||||||
|
backend->write(x, y, blink, "%4d%c%c", (int)u_scale(ALTITUDE, terrain_altitude), u_icon(ALTITUDE), SYM_TERALT);
|
||||||
} else {
|
} else {
|
||||||
backend->write(x, y, false, " ---%c%c", u_icon(ALTITUDE),SYM_TERALT);
|
backend->write(x, y, false, " ---%c%c", u_icon(ALTITUDE),SYM_TERALT);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user