diff --git a/radio/src/bitmaps/480x272/mask_usb_symbol.png b/radio/src/bitmaps/480x272/mask_usb_symbol.png new file mode 100644 index 000000000..54fc5e2af Binary files /dev/null and b/radio/src/bitmaps/480x272/mask_usb_symbol.png differ diff --git a/radio/src/gui/colorlcd/theme.cpp b/radio/src/gui/colorlcd/theme.cpp index e0fcd422a..ba8bb6f30 100644 --- a/radio/src/gui/colorlcd/theme.cpp +++ b/radio/src/gui/colorlcd/theme.cpp @@ -37,6 +37,13 @@ const uint8_t LBM_DROPDOWN[] = { #include "mask_dropdown.lbm" }; +constexpr coord_t LBM_USB_PLUGGED_W = 211; +constexpr coord_t LBM_USB_PLUGGED_H = 110; + +const uint8_t LBM_USB_PLUGGED[] = { +#include "mask_usb_symbol.lbm" +}; + std::list & getRegisteredThemes() { static std::list themes; @@ -204,6 +211,16 @@ void OpenTxTheme::drawSlider(BitmapBuffer * dc, int vmin, int vmax, int value, c } } +void OpenTxTheme::drawUsbPluggedScreen(BitmapBuffer * dc) const +{ + // draw USB icon + dc->clear(DEFAULT_BGCOLOR); + dc->drawBitmapPattern((LCD_W - LBM_USB_PLUGGED_W) / 2, + (LCD_H - LBM_USB_PLUGGED_H) / 2, + LBM_USB_PLUGGED, DEFAULT_COLOR); +} + + OpenTxTheme * getTheme(const char * name) { std::list::const_iterator it = getRegisteredThemes().cbegin(); diff --git a/radio/src/gui/colorlcd/theme.h b/radio/src/gui/colorlcd/theme.h index 133f7856c..be31fbc52 100644 --- a/radio/src/gui/colorlcd/theme.h +++ b/radio/src/gui/colorlcd/theme.h @@ -100,6 +100,9 @@ class OpenTxTheme: public Theme virtual void drawTopLeftBitmap(BitmapBuffer * dc) const = 0; + virtual void drawUsbPluggedScreen(BitmapBuffer * dc) const; + + protected: const char * name; const ZoneOption * options; diff --git a/radio/src/main.cpp b/radio/src/main.cpp index b7c72514c..dfc742c5a 100644 --- a/radio/src/main.cpp +++ b/radio/src/main.cpp @@ -474,7 +474,11 @@ void perMain() #if defined(STM32) if (usbPlugged() && getSelectedUsbMode() == USB_MASS_STORAGE_MODE) { #if defined(LIBOPENUI) - #warning "TODO USB plugged view" + // draw some image showing USB + lcdNextLayer(); + lcd->reset(); + OpenTxTheme::instance()->drawUsbPluggedScreen(lcd); + lcdRefresh(); #else // disable access to menus lcdClear();