add a gps icon if internal gps (and mavtelem)

This commit is contained in:
olliw42
2021-05-16 23:33:58 +02:00
parent e66189308e
commit 926065e3a1
4 changed files with 17 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

+4
View File
@@ -32,6 +32,10 @@ const uint8_t LBM_DOT[] = {
* Main view bitmaps
*/
const uint8_t LBM_TOPMENU_GPS[] = {
#include "mask_topmenu_gps_18.lbm"
};
const uint8_t LBM_TOPMENU_USB[] = {
#include "mask_topmenu_usb.lbm"
};
+1
View File
@@ -25,6 +25,7 @@
extern const uint8_t LBM_DOT[];
// Main view icons
extern const uint8_t LBM_TOPMENU_GPS[];
extern const uint8_t LBM_TOPMENU_USB[];
extern const uint8_t LBM_TOPMENU_ANTENNA[];
extern const uint8_t LBM_TOPMENU_VOLUME_0[];
@@ -32,6 +32,9 @@ TopbarImpl::TopbarImpl(Window * parent) :
unsigned int TopbarImpl::getZonesCount() const
{
#if defined(TELEMETRY_MAVLINK) && defined(INTERNAL_GPS)
return MAX_TOPBAR_ZONES-1;
#endif
return MAX_TOPBAR_ZONES;
}
@@ -88,6 +91,15 @@ void TopbarImpl::paint(BitmapBuffer * dc)
getTimerString(str, getValue(MIXSRC_TX_TIME));
dc->drawText(DATETIME_MIDDLE, DATETIME_LINE2, str, FONT(XS) | CENTERED | MENU_COLOR);
#if defined(TELEMETRY_MAVLINK) && defined(INTERNAL_GPS)
if (gpsData.fix) {
char s[10];
sprintf(s, "%d", gpsData.numSat);
dc->drawText(LCD_W-148, 4, s, FONT(XS) | CENTERED | MENU_COLOR);
}
dc->drawBitmapPattern(LCD_W-158, 22, LBM_TOPMENU_GPS, (gpsData.fix) ? MENU_COLOR : MENU_TITLE_DISABLE_COLOR);
#endif
// USB icon
if (usbPlugged()) {
dc->drawBitmapPattern(LCD_W - 98, 8, LBM_TOPMENU_USB, MENU_COLOR);