diff --git a/radio/src/Makefile b/radio/src/Makefile index cca3b777e..ebeb7224a 100644 --- a/radio/src/Makefile +++ b/radio/src/Makefile @@ -1225,7 +1225,7 @@ ifeq ($(PCB), HORUS) PULSESSRC = pulses/pulses_arm.cpp pulses/ppm_arm.cpp pulses/pxx_arm.cpp CPPSRC += tasks_arm.cpp audio_arm.cpp sbus.cpp telemetry/telemetry.cpp CPPSRC += targets/Horus/pulses_driver.cpp targets/Horus/keys_driver.cpp targets/Horus/adc_driver.cpp targets/Horus/trainer_driver.cpp targets/Horus/audio_driver.cpp targets/Horus/serial2_driver.cpp targets/Horus/telemetry_driver.cpp - CPPSRC += gui/$(GUIDIRECTORY)/view_channels.cpp gui/$(GUIDIRECTORY)/view_about.cpp gui/$(GUIDIRECTORY)/view_text.cpp debug.cpp + CPPSRC += gui/$(GUIDIRECTORY)/bitmaps.cpp gui/$(GUIDIRECTORY)/view_channels.cpp gui/$(GUIDIRECTORY)/view_about.cpp gui/$(GUIDIRECTORY)/view_text.cpp debug.cpp SRC += targets/Horus/system_stm32f4xx.c SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/misc.c SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c @@ -1298,18 +1298,6 @@ ifeq ($(PCB), HORUS) CPPSRC += haptic.cpp CPPSRC += targets/Horus/haptic_driver.cpp EXTRABOARDSRC += - - ifeq ($(TW8823_TRACES), YES) - CPPDEFS += -DTW8823_TRACES - endif - - ifeq ($(TW8823_BITMAPS), YES) - CPPDEFS += -DTW8823_BITMAPS - endif - - ifeq ($(TW8823_SERIAL), YES) - CPPDEFS += -DTW8823_SERIAL - endif endif CC = $(TRGT)gcc diff --git a/radio/src/bitmaps/Horus/mask_index_shadow.png b/radio/src/bitmaps/Horus/mask_current_shadow.png similarity index 100% rename from radio/src/bitmaps/Horus/mask_index_shadow.png rename to radio/src/bitmaps/Horus/mask_current_shadow.png diff --git a/radio/src/gui/Horus/bitmaps.cpp b/radio/src/gui/Horus/bitmaps.cpp new file mode 100644 index 000000000..f01425ea8 --- /dev/null +++ b/radio/src/gui/Horus/bitmaps.cpp @@ -0,0 +1,136 @@ +/* + * Authors (alphabetical order) + * - Andre Bernet + * - Andreas Weitl + * - Bertrand Songis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer + * + * opentx is based on code named + * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, + * er9x by Erez Raviv: http://code.google.com/p/er9x/, + * and the original (and ongoing) project by + * Thomas Husterer, th9x: http://code.google.com/p/th9x/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "../../opentx.h" + +/* + * Header bitmaps + */ + +const uint8_t LBM_TOP_POLYGON[] = { +#include "../../bitmaps/Horus/mask_top_polygon.lbm" +}; + +const uint8_t LBM_DOT[] = { +#include "../../bitmaps/Horus/mask_dot.lbm" +}; + +const uint8_t LBM_CURRENT_BG[] = { +#include "../../bitmaps/Horus/mask_current_bg.lbm" +}; + +const uint8_t LBM_CURRENT_SHADOW[] = { +#include "../../bitmaps/Horus/mask_current_shadow.lbm" +}; + +const uint8_t LBM_CURRENT_DOT[] = { +#include "../../bitmaps/Horus/mask_current_dot.lbm" +}; + +/* + * Model menu bitmaps + */ + +const uint8_t LBM_MENU_MODEL[] = { +#include "../../bitmaps/Horus/mask_menu_model.lbm" +}; + +const uint8_t LBM_MODEL_SETUP_ICON[] = { +#include "../../bitmaps/Horus/mask_model_setup.lbm" +}; + +const uint8_t LBM_HELI_ICON[] = { +#include "../../bitmaps/Horus/mask_heli.lbm" +}; + +const uint8_t LBM_FLIGHT_MODES_ICON[] = { +#include "../../bitmaps/Horus/mask_flight_modes.lbm" +}; + +const uint8_t LBM_INPUTS_ICON[] = { +#include "../../bitmaps/Horus/mask_inputs.lbm" +}; + +const uint8_t LBM_MIXER_ICON[] = { +#include "../../bitmaps/Horus/mask_mixer.lbm" +}; + +const uint8_t LBM_OUTPUTS_ICON[] = { +#include "../../bitmaps/Horus/mask_outputs.lbm" +}; + +const uint8_t LBM_CURVES_ICON[] = { +#include "../../bitmaps/Horus/mask_curves.lbm" +}; + +const uint8_t LBM_GVARS_ICON[] = { +#include "../../bitmaps/Horus/mask_gvars.lbm" +}; + +const uint8_t LBM_LOGICAL_SWITCHES_ICON[] = { +#include "../../bitmaps/Horus/mask_logical_switches.lbm" +}; + +const uint8_t LBM_SPECIAL_FUNCTIONS_ICON[] = { +#include "../../bitmaps/Horus/mask_special_functions.lbm" +}; + +const uint8_t LBM_LUA_SCRIPTS_ICON[] = { +#include "../../bitmaps/Horus/mask_lua_scripts.lbm" +}; + +const uint8_t LBM_TELEMETRY_ICON[] = { +#include "../../bitmaps/Horus/mask_telemetry.lbm" +}; + +const uint8_t * const LBM_MODEL_ICONS[] = { + LBM_MENU_MODEL, + LBM_MODEL_SETUP_ICON, + CASE_HELI(LBM_HELI_ICON) + CASE_FLIGHT_MODES(LBM_FLIGHT_MODES_ICON) + LBM_INPUTS_ICON, + LBM_MIXER_ICON, + LBM_OUTPUTS_ICON, + CASE_CURVES(LBM_CURVES_ICON) + CASE_GVARS(LBM_GVARS_ICON) + LBM_LOGICAL_SWITCHES_ICON, + LBM_SPECIAL_FUNCTIONS_ICON, +#if defined(LUA_MODEL_SCRIPTS) + LBM_LUA_SCRIPTS_ICON, +#endif + LBM_TELEMETRY_ICON +}; + diff --git a/radio/src/gui/Horus/gui.h b/radio/src/gui/Horus/gui.h index 3e94f521a..6d72bad81 100644 --- a/radio/src/gui/Horus/gui.h +++ b/radio/src/gui/Horus/gui.h @@ -68,3 +68,14 @@ void drawFooter(); void displayProgressBar(const char *label); void updateProgressBar(int num, int den); +// Header bitmaps +extern const uint8_t LBM_TOP_POLYGON[]; +extern const uint8_t LBM_DOT[]; +extern const uint8_t LBM_CURRENT_BG[]; +extern const uint8_t LBM_CURRENT_SHADOW[]; +extern const uint8_t LBM_CURRENT_DOT[]; + +// Menu icons +extern const uint8_t * const LBM_RADIO_ICONS[]; +extern const uint8_t * const LBM_MODEL_ICONS[]; + diff --git a/radio/src/gui/Horus/widgets.cpp b/radio/src/gui/Horus/widgets.cpp index f1e58f7ee..587699a48 100644 --- a/radio/src/gui/Horus/widgets.cpp +++ b/radio/src/gui/Horus/widgets.cpp @@ -116,95 +116,6 @@ void title(const pm_char * s) lcd_putsAtt(MENU_TITLE_LEFT, MENU_TITLE_TOP+2, s, MENU_TITLE_COLOR); } -const uint8_t LBM_MODEL_SETUP_ICON[] = { -#include "../../bitmaps/Horus/mask_model_setup.lbm" -}; - -const uint8_t LBM_HELI_ICON[] = { -#include "../../bitmaps/Horus/mask_heli.lbm" -}; - -const uint8_t LBM_FLIGHT_MODES_ICON[] = { -#include "../../bitmaps/Horus/mask_flight_modes.lbm" -}; - -const uint8_t LBM_INPUTS_ICON[] = { -#include "../../bitmaps/Horus/mask_inputs.lbm" -}; - -const uint8_t LBM_MIXER_ICON[] = { -#include "../../bitmaps/Horus/mask_mixer.lbm" -}; - -const uint8_t LBM_OUTPUTS_ICON[] = { -#include "../../bitmaps/Horus/mask_outputs.lbm" -}; - -const uint8_t LBM_CURVES_ICON[] = { -#include "../../bitmaps/Horus/mask_curves.lbm" -}; - -const uint8_t LBM_GVARS_ICON[] = { -#include "../../bitmaps/Horus/mask_gvars.lbm" -}; - -const uint8_t LBM_LOGICAL_SWITCHES_ICON[] = { -#include "../../bitmaps/Horus/mask_logical_switches.lbm" -}; - -const uint8_t LBM_SPECIAL_FUNCTIONS_ICON[] = { -#include "../../bitmaps/Horus/mask_special_functions.lbm" -}; - -const uint8_t LBM_LUA_SCRIPTS_ICON[] = { -#include "../../bitmaps/Horus/mask_lua_scripts.lbm" -}; - -const uint8_t LBM_TELEMETRY_ICON[] = { -#include "../../bitmaps/Horus/mask_telemetry.lbm" -}; - -const uint8_t * const LBM_MODEL_ICONS[] = { - LBM_MODEL_SETUP_ICON, - CASE_HELI(LBM_HELI_ICON) - CASE_FLIGHT_MODES(LBM_FLIGHT_MODES_ICON) - LBM_INPUTS_ICON, - LBM_MIXER_ICON, - LBM_OUTPUTS_ICON, - CASE_CURVES(LBM_CURVES_ICON) - CASE_GVARS(LBM_GVARS_ICON) - LBM_LOGICAL_SWITCHES_ICON, - LBM_SPECIAL_FUNCTIONS_ICON, -#if defined(LUA_MODEL_SCRIPTS) - LBM_LUA_SCRIPTS_ICON, -#endif - LBM_TELEMETRY_ICON -}; - -const uint8_t LBM_TOP_POLYGON[] = { -#include "../../bitmaps/Horus/mask_top_polygon.lbm" -}; - -const uint8_t LBM_DOT[] = { -#include "../../bitmaps/Horus/mask_dot.lbm" -}; - -const uint8_t LBM_CURRENT_BG[] = { -#include "../../bitmaps/Horus/mask_current_bg.lbm" -}; - -const uint8_t LBM_CURRENT_SHADOW[] = { -#include "../../bitmaps/Horus/mask_index_shadow.lbm" -}; - -const uint8_t LBM_CURRENT_DOT[] = { -#include "../../bitmaps/Horus/mask_current_dot.lbm" -}; - -const uint8_t LBM_MENU_MODEL[] = { -#include "../../bitmaps/Horus/mask_menu_model.lbm" -}; - #define MENU_ICONS_SPACING 34 void drawMenuTemplate(const char *name, evt_t event, int pageIndex, int pageCount) @@ -218,8 +129,6 @@ void drawMenuTemplate(const char *name, evt_t event, int pageIndex, int pageCoun lcdDrawBitmapPattern(0, 0, LBM_TOP_POLYGON, TITLE_BGCOLOR); - lcdDrawBitmapPattern(5, 7, LBM_MENU_MODEL, MENU_TITLE_COLOR); - if (m_posVert < 0) { lcdDrawBitmapPattern(58+pageIndex*MENU_ICONS_SPACING-12, 0, LBM_CURRENT_BG, TITLE_BGCOLOR); lcdDrawBitmapPattern(58+pageIndex*MENU_ICONS_SPACING-12, 0, LBM_CURRENT_SHADOW, TEXT_COLOR); @@ -230,8 +139,10 @@ void drawMenuTemplate(const char *name, evt_t event, int pageIndex, int pageCoun lcdDrawBitmapPattern(58+pageIndex*MENU_ICONS_SPACING, MENU_TITLE_TOP-9, LBM_DOT, MENU_TITLE_COLOR); } + lcdDrawBitmapPattern(5, 7, LBM_MODEL_ICONS[0], MENU_TITLE_COLOR); + for (int i=0; i