Switch to CMake
This commit is contained in:
@@ -41,23 +41,23 @@
|
||||
*/
|
||||
|
||||
const uint8_t LBM_TOPMENU_POLYGON[] = {
|
||||
#include "../../bitmaps/horus/mask_topmenu_polygon.lbm"
|
||||
#include "mask_topmenu_polygon.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_DOT[] = {
|
||||
#include "../../bitmaps/horus/mask_dot.lbm"
|
||||
#include "mask_dot.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURRENT_BG[] = {
|
||||
#include "../../bitmaps/horus/mask_current_bg.lbm"
|
||||
#include "mask_current_bg.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURRENT_SHADOW[] = {
|
||||
#include "../../bitmaps/horus/mask_current_shadow.lbm"
|
||||
#include "mask_current_shadow.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURRENT_DOT[] = {
|
||||
#include "../../bitmaps/horus/mask_current_dot.lbm"
|
||||
#include "mask_current_dot.lbm"
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -65,35 +65,35 @@ const uint8_t LBM_CURRENT_DOT[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_MAINVIEW_BACKGROUND[] = {
|
||||
#include "../../bitmaps/horus/background.lbm"
|
||||
#include "background.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_OPENTX[] = {
|
||||
#include "../../bitmaps/horus/mask_topmenu_opentx.lbm"
|
||||
#include "mask_topmenu_opentx.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_USB[] = {
|
||||
#include "../../bitmaps/horus/mask_topmenu_usb.lbm"
|
||||
#include "mask_topmenu_usb.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_HTRIM_FRAME[] = {
|
||||
#include "../../bitmaps/horus/mask_htrim_frame.lbm"
|
||||
#include "mask_htrim_frame.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_VTRIM_FRAME[] = {
|
||||
#include "../../bitmaps/horus/mask_vtrim_frame.lbm"
|
||||
#include "mask_vtrim_frame.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TRIM_SHADOW[] = {
|
||||
#include "../../bitmaps/horus/mask_trim_shadow.lbm"
|
||||
#include "mask_trim_shadow.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TIMER_BACKGROUND[] = {
|
||||
#include "../../bitmaps/horus/mask_timer_bg.lbm"
|
||||
#include "mask_timer_bg.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_RSCALE[] = {
|
||||
#include "../../bitmaps/horus/mask_rscale.lbm"
|
||||
#include "mask_rscale.lbm"
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -101,31 +101,31 @@ const uint8_t LBM_RSCALE[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_RADIO_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_menu_radio.lbm"
|
||||
#include "mask_menu_radio.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_RADIO_SETUP_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_radio_setup.lbm"
|
||||
#include "mask_radio_setup.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SD_BROWSER_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_sd_browser.lbm"
|
||||
#include "mask_sd_browser.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_GLOBAL_FUNCTIONS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_global_functions.lbm"
|
||||
#include "mask_global_functions.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TRAINER_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_trainer.lbm"
|
||||
#include "mask_trainer.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CALIBRATION_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_calibration.lbm"
|
||||
#include "mask_calibration.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_VERSION_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_version.lbm"
|
||||
#include "mask_version.lbm"
|
||||
};
|
||||
|
||||
const uint8_t * const LBM_RADIO_ICONS[] = {
|
||||
@@ -143,55 +143,55 @@ const uint8_t * const LBM_RADIO_ICONS[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_MODEL_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_menu_model.lbm"
|
||||
#include "mask_menu_model.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MODEL_SETUP_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_model_setup.lbm"
|
||||
#include "mask_model_setup.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_HELI_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_heli.lbm"
|
||||
#include "mask_heli.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_FLIGHT_MODES_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_flight_modes.lbm"
|
||||
#include "mask_flight_modes.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_INPUTS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_inputs.lbm"
|
||||
#include "mask_inputs.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MIXER_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_mixer.lbm"
|
||||
#include "mask_mixer.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_OUTPUTS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_outputs.lbm"
|
||||
#include "mask_outputs.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURVES_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_curves.lbm"
|
||||
#include "mask_curves.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_GVARS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_gvars.lbm"
|
||||
#include "mask_gvars.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LOGICAL_SWITCHES_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_logical_switches.lbm"
|
||||
#include "mask_logical_switches.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SPECIAL_FUNCTIONS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_special_functions.lbm"
|
||||
#include "mask_special_functions.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LUA_SCRIPTS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_lua_scripts.lbm"
|
||||
#include "mask_lua_scripts.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TELEMETRY_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_telemetry.lbm"
|
||||
#include "mask_telemetry.lbm"
|
||||
};
|
||||
|
||||
const uint8_t * const LBM_MODEL_ICONS[] = {
|
||||
@@ -217,31 +217,31 @@ const uint8_t * const LBM_MODEL_ICONS[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_LIBRARY_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_library.lbm"
|
||||
#include "mask_library.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LIBRARY_SLOT[] = {
|
||||
#include "../../bitmaps/horus/mask_library_slot.lbm"
|
||||
#include "mask_library_slot.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LIBRARY_CURSOR[] = {
|
||||
#include "../../bitmaps/horus/mask_library_category_index.lbm"
|
||||
#include "mask_library_category_index.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SCORE0[] = {
|
||||
#include "../../bitmaps/horus/mask_library_score_0.lbm"
|
||||
#include "mask_library_score_0.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SCORE1[] = {
|
||||
#include "../../bitmaps/horus/mask_library_score_1.lbm"
|
||||
#include "mask_library_score_1.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_STAR0[] = {
|
||||
#include "../../bitmaps/horus/mask_library_star_0.lbm"
|
||||
#include "mask_library_star_0.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_STAR1[] = {
|
||||
#include "../../bitmaps/horus/mask_library_star_1.lbm"
|
||||
#include "mask_library_star_1.lbm"
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -249,21 +249,21 @@ const uint8_t LBM_STAR1[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_ASTERISK[] = {
|
||||
#include "../../bitmaps/horus/asterisk.lbm"
|
||||
#include "asterisk.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_POINT[] = {
|
||||
#include "../../bitmaps/horus/mask_point.lbm"
|
||||
#include "mask_point.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURVE_POINT[] = {
|
||||
#include "../../bitmaps/horus/mask_cvpoint.lbm"
|
||||
#include "mask_cvpoint.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURVE_POINT_CENTER[] = {
|
||||
#include "../../bitmaps/horus/mask_cvpoint_center.lbm"
|
||||
#include "mask_cvpoint_center.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURVE_COORD_SHADOW[] = {
|
||||
#include "../../bitmaps/horus/mask_coord_shadow.lbm"
|
||||
#include "mask_coord_shadow.lbm"
|
||||
};
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
coord_t getCurveYCoord(FnFuncP fn, coord_t x)
|
||||
{
|
||||
return limit(0, CURVE_CENTER_Y - divRoundClosest(fn(divRoundClosest(x * RESX, CURVE_SIDE_WIDTH)) * CURVE_SIDE_WIDTH, RESX), LCD_H-1);
|
||||
|
||||
@@ -37,51 +37,51 @@
|
||||
#include "../../opentx.h"
|
||||
|
||||
const uint16_t font_tinsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_tinsize.specs"
|
||||
#include "font_tinsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_tinsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_tinsize.lbm"
|
||||
#include "font_tinsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_smlsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_smlsize.specs"
|
||||
#include "font_smlsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_smlsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_smlsize.lbm"
|
||||
#include "font_smlsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_stdsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_stdsize.specs"
|
||||
#include "font_stdsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_stdsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_stdsize.lbm"
|
||||
#include "font_stdsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_midsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_midsize.specs"
|
||||
#include "font_midsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_midsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_midsize.lbm"
|
||||
#include "font_midsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_dblsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_dblsize.specs"
|
||||
#include "font_dblsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_dblsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_dblsize.lbm"
|
||||
#include "font_dblsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_xxlsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_xxlsize.specs"
|
||||
#include "font_xxlsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_xxlsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_xxlsize.lbm"
|
||||
#include "font_xxlsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t *fontspecsTable[16] = { font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs };
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../horus/lcd.h"
|
||||
#include "../horus/menus.h"
|
||||
#include "lcd.h"
|
||||
#include "menus.h"
|
||||
|
||||
#define MENU_HEADER_HEIGHT 45
|
||||
#define MENU_TITLE_TOP 48
|
||||
@@ -84,11 +84,15 @@ void displayScreenIndex(uint8_t index, uint8_t count);
|
||||
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void drawHorizontalScrollbar(coord_t x, coord_t y, coord_t w, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void drawHeader(int index);
|
||||
void drawColumnHeader(const char * const * headers, uint8_t index);
|
||||
void drawFooter();
|
||||
#define drawStatusLine(...)
|
||||
void drawProgressBar(const char *label);
|
||||
void updateProgressBar(int num, int den);
|
||||
void drawTopmenuDatetime();
|
||||
void drawSubmenuTemplate(const char * name, uint16_t scrollbar_X);
|
||||
void drawStick(coord_t centrex, int16_t xval, int16_t yval);
|
||||
void drawSticks();
|
||||
|
||||
// Curve functions
|
||||
coord_t getCurveYCoord(FnFuncP fn, coord_t x);
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
#if defined(SIMU)
|
||||
@@ -608,7 +610,6 @@ void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx==0) {
|
||||
@@ -618,7 +619,6 @@ void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
putsStrIdx(x, y, STR_FP, abs(idx)-1, att);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void putsCurveRef(coord_t x, coord_t y, CurveRef &curve, LcdFlags att)
|
||||
{
|
||||
|
||||
@@ -36,59 +36,6 @@
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
extern LP_CONST LanguagePack czLanguagePack;
|
||||
extern LP_CONST LanguagePack enLanguagePack;
|
||||
extern LP_CONST LanguagePack esLanguagePack;
|
||||
extern LP_CONST LanguagePack frLanguagePack;
|
||||
extern LP_CONST LanguagePack deLanguagePack;
|
||||
extern LP_CONST LanguagePack itLanguagePack;
|
||||
extern LP_CONST LanguagePack plLanguagePack;
|
||||
extern LP_CONST LanguagePack ptLanguagePack;
|
||||
extern LP_CONST LanguagePack skLanguagePack;
|
||||
extern LP_CONST LanguagePack seLanguagePack;
|
||||
extern LP_CONST LanguagePack huLanguagePack;
|
||||
|
||||
const LanguagePack * LP_CONST languagePacks[] = {
|
||||
// alphabetical order
|
||||
&czLanguagePack,
|
||||
&deLanguagePack,
|
||||
&enLanguagePack,
|
||||
&esLanguagePack,
|
||||
&frLanguagePack,
|
||||
&huLanguagePack,
|
||||
&itLanguagePack,
|
||||
&plLanguagePack,
|
||||
&ptLanguagePack,
|
||||
&seLanguagePack,
|
||||
&skLanguagePack,
|
||||
NULL
|
||||
};
|
||||
|
||||
bool menuGeneralSetup(evt_t event);
|
||||
bool menuGeneralSdManager(evt_t event);
|
||||
bool menuGeneralCustomFunctions(evt_t event);
|
||||
bool menuGeneralTrainer(evt_t event);
|
||||
bool menuGeneralVersion(evt_t event);
|
||||
bool menuGeneralCalib(evt_t event);
|
||||
|
||||
enum EnumTabDiag {
|
||||
e_Setup,
|
||||
e_Sd,
|
||||
e_GeneralCustomFunctions,
|
||||
e_Trainer,
|
||||
e_Calib,
|
||||
e_Vers,
|
||||
};
|
||||
|
||||
const MenuHandlerFunc menuTabGeneral[] PROGMEM = {
|
||||
menuGeneralSetup,
|
||||
menuGeneralSdManager,
|
||||
menuGeneralCustomFunctions,
|
||||
menuGeneralTrainer,
|
||||
menuGeneralCalib,
|
||||
menuGeneralVersion,
|
||||
};
|
||||
|
||||
bool menuGeneralCustomFunctions(evt_t event)
|
||||
{
|
||||
MENU(STR_MENUGLOBALFUNCS, menuTabGeneral, e_GeneralCustomFunctions, NUM_CFN, DEFAULT_SCROLLBAR_X, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
#define REFRESH_FILES() do { reusableBuffer.sdmanager.offset = 65535; lastBitmap = -1; } while (0)
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
#endif
|
||||
|
||||
enum menuGeneralSetupItems {
|
||||
CASE_RTCLOCK(ITEM_SETUP_DATE)
|
||||
CASE_RTCLOCK(ITEM_SETUP_TIME)
|
||||
ITEM_SETUP_DATE,
|
||||
ITEM_SETUP_TIME,
|
||||
// ITEM_SETUP_BATT_RANGE,
|
||||
ITEM_SETUP_SOUND_LABEL,
|
||||
ITEM_SETUP_BEEP_MODE,
|
||||
|
||||
@@ -35,48 +35,10 @@
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
enum EnumTabModel {
|
||||
// e_ModelSelect,
|
||||
e_ModelSetup,
|
||||
CASE_HELI(e_Heli)
|
||||
CASE_FLIGHT_MODES(e_FlightModesAll)
|
||||
e_InputsAll,
|
||||
e_MixAll,
|
||||
e_Limits,
|
||||
CASE_CURVES(e_CurvesAll)
|
||||
CASE_GVARS(e_GVars)
|
||||
e_LogicalSwitches,
|
||||
e_CustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
e_CustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(e_Telemetry)
|
||||
};
|
||||
|
||||
bool menuModelSelect(evt_t event);
|
||||
bool menuModelSetup(evt_t event);
|
||||
bool menuModelHeli(evt_t event);
|
||||
bool menuModelFlightModesAll(evt_t event);
|
||||
bool menuModelExposAll(evt_t event);
|
||||
bool menuModelMixAll(evt_t event);
|
||||
bool menuModelLimits(evt_t event);
|
||||
bool menuModelCurvesAll(evt_t event);
|
||||
bool menuModelCurveOne(evt_t event);
|
||||
bool menuModelGVars(evt_t event);
|
||||
bool menuModelLogicalSwitches(evt_t event);
|
||||
bool menuModelCustomFunctions(evt_t event);
|
||||
bool menuModelCustomScripts(evt_t event);
|
||||
bool menuModelTelemetry(evt_t event);
|
||||
bool menuModelExpoOne(evt_t event);
|
||||
|
||||
extern uint8_t s_curveChan;
|
||||
|
||||
#define FlightModesType uint16_t
|
||||
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t attr);
|
||||
|
||||
#define MIXES_2ND_COLUMN 100
|
||||
|
||||
uint8_t editDelay(const coord_t x, const coord_t y, const evt_t event, const uint8_t attr, uint8_t delay)
|
||||
{
|
||||
lcdDrawNumber(x+MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
|
||||
@@ -84,35 +46,11 @@ uint8_t editDelay(const coord_t x, const coord_t y, const evt_t event, const uin
|
||||
return delay;
|
||||
}
|
||||
|
||||
const MenuHandlerFunc menuTabModel[] = {
|
||||
// menuModelSelect,
|
||||
menuModelSetup,
|
||||
CASE_HELI(menuModelHeli)
|
||||
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
||||
menuModelExposAll,
|
||||
menuModelMixAll,
|
||||
menuModelLimits,
|
||||
CASE_CURVES(menuModelCurvesAll)
|
||||
#if defined(GVARS) && defined(FLIGHT_MODES)
|
||||
CASE_GVARS(menuModelGVars)
|
||||
#endif
|
||||
menuModelLogicalSwitches,
|
||||
menuModelCustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
menuModelCustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(menuModelTelemetry)
|
||||
CASE_MAVLINK(menuTelemetryMavlinkSetup)
|
||||
CASE_TEMPLATES(menuModelTemplates)
|
||||
};
|
||||
uint8_t s_copyMode = 0;
|
||||
int8_t s_copySrcRow;
|
||||
int8_t s_copyTgtOfs;
|
||||
|
||||
#define COPY_MODE 1
|
||||
#define MOVE_MODE 2
|
||||
static uint8_t s_copyMode = 0;
|
||||
static int8_t s_copySrcRow;
|
||||
static int8_t s_copyTgtOfs;
|
||||
|
||||
static uint8_t editNameCursorPos = 0;
|
||||
uint8_t editNameCursorPos = 0;
|
||||
|
||||
void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint8_t active, LcdFlags flags)
|
||||
{
|
||||
@@ -216,4 +154,12 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t s_currIdx;
|
||||
uint8_t s_currIdx;
|
||||
|
||||
void copySelection(char * dst, const char * src, uint8_t size)
|
||||
{
|
||||
if (memcmp(src, "---", 3) == 0)
|
||||
memset(dst, 0, size);
|
||||
else
|
||||
memcpy(dst, src, size);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
uint8_t s_curveChan;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
enum FlightModesItems {
|
||||
@@ -73,7 +74,7 @@ bool menuModelFlightModesAll(evt_t event)
|
||||
}
|
||||
|
||||
if (sub<MAX_FLIGHT_MODES && posHorz>=0) {
|
||||
displayColumnHeader(STR_PHASES_HEADERS, posHorz);
|
||||
drawColumnHeader(STR_PHASES_HEADERS, posHorz);
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
#define EXPO_ONE_2ND_COLUMN 110
|
||||
|
||||
@@ -137,7 +137,7 @@ bool menuModelLimits(evt_t event)
|
||||
}
|
||||
|
||||
if (sub<NUM_CHNOUT && menuHorizontalPosition>=0) {
|
||||
displayColumnHeader(STR_LIMITS_HEADERS, menuHorizontalPosition);
|
||||
drawColumnHeader(STR_LIMITS_HEADERS, menuHorizontalPosition);
|
||||
}
|
||||
|
||||
if (warningResult) {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
enum LogicalSwitchFields {
|
||||
@@ -54,11 +55,6 @@ enum LogicalSwitchFields {
|
||||
#define CSW_5TH_COLUMN 245
|
||||
#define CSW_6TH_COLUMN 300
|
||||
|
||||
#define INCDEC_DECLARE_VARS(f) uint8_t incdecFlag = (f); IsValueAvailable isValueAvailable = NULL
|
||||
#define INCDEC_SET_FLAG(f) incdecFlag = (f)
|
||||
#define INCDEC_ENABLE_CHECK(fn) isValueAvailable = fn
|
||||
#define CHECK_INCDEC_PARAM(event, var, min, max) checkIncDec(event, var, min, max, incdecFlag, isValueAvailable)
|
||||
|
||||
void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData *cs, uint8_t lattr, uint8_t rattr)
|
||||
{
|
||||
char s[32];
|
||||
@@ -106,7 +102,7 @@ bool menuModelLogicalSwitches(evt_t event)
|
||||
horzpos_t horz = menuHorizontalPosition;
|
||||
|
||||
if (sub>= 0 && horz>=0) {
|
||||
displayColumnHeader(STR_CSW_HEADERS, horz);
|
||||
drawColumnHeader(STR_CSW_HEADERS, horz);
|
||||
}
|
||||
|
||||
if (horz<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
|
||||
@@ -94,14 +94,6 @@ enum menuModelSetupItems {
|
||||
#define MODEL_SETUP_RANGE_OFS 40
|
||||
#define MODEL_SETUP_SET_FAILSAFE_OFS 60
|
||||
|
||||
void copySelection(char *dst, const char *src, uint8_t size)
|
||||
{
|
||||
if (memcmp(src, "---", 3) == 0)
|
||||
memset(dst, 0, size);
|
||||
else
|
||||
memcpy(dst, src, size);
|
||||
}
|
||||
|
||||
void onModelSetupBitmapMenu(const char *result)
|
||||
{
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
|
||||
+111
-13
@@ -47,6 +47,8 @@
|
||||
#endif
|
||||
|
||||
#define MENU_COLUMN2_X 280
|
||||
#define MIXES_2ND_COLUMN 100
|
||||
#define COLUMN_HEADER_X 150
|
||||
|
||||
typedef int16_t vertpos_t;
|
||||
|
||||
@@ -69,8 +71,6 @@ extern uint8_t noHighlightCounter;
|
||||
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
||||
|
||||
typedef bool (*MenuHandlerFunc)(evt_t event);
|
||||
extern const MenuHandlerFunc menuTabModel[];
|
||||
extern const MenuHandlerFunc menuTabGeneral[];
|
||||
|
||||
extern MenuHandlerFunc menuHandlers[5];
|
||||
extern uint8_t menuVerticalPositions[4];
|
||||
@@ -84,16 +84,90 @@ void pushMenu(MenuHandlerFunc newMenu);
|
||||
/// return to last menu in menustack
|
||||
void popMenu();
|
||||
|
||||
bool menuFirstCalib(evt_t event);
|
||||
enum EnumTabModel {
|
||||
// e_ModelSelect,
|
||||
e_ModelSetup,
|
||||
CASE_HELI(e_Heli)
|
||||
CASE_FLIGHT_MODES(e_FlightModesAll)
|
||||
e_InputsAll,
|
||||
e_MixAll,
|
||||
e_Limits,
|
||||
CASE_CURVES(e_CurvesAll)
|
||||
CASE_GVARS(e_GVars)
|
||||
e_LogicalSwitches,
|
||||
e_CustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
e_CustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(e_Telemetry)
|
||||
};
|
||||
|
||||
bool menuModelSetup(evt_t event);
|
||||
bool menuModelHeli(evt_t event);
|
||||
bool menuModelFlightModesAll(evt_t event);
|
||||
bool menuModelExposAll(evt_t event);
|
||||
bool menuModelMixAll(evt_t event);
|
||||
bool menuModelLimits(evt_t event);
|
||||
bool menuModelCurvesAll(evt_t event);
|
||||
bool menuModelCurveOne(evt_t event);
|
||||
bool menuModelGVars(evt_t event);
|
||||
bool menuModelLogicalSwitches(evt_t event);
|
||||
bool menuModelCustomFunctions(evt_t event);
|
||||
bool menuModelCustomScripts(evt_t event);
|
||||
bool menuModelTelemetry(evt_t event);
|
||||
bool menuModelExpoOne(evt_t event);
|
||||
|
||||
const MenuHandlerFunc menuTabModel[] = {
|
||||
// menuModelSelect,
|
||||
menuModelSetup,
|
||||
CASE_HELI(menuModelHeli)
|
||||
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
||||
menuModelExposAll,
|
||||
menuModelMixAll,
|
||||
menuModelLimits,
|
||||
CASE_CURVES(menuModelCurvesAll)
|
||||
#if defined(GVARS) && defined(FLIGHT_MODES)
|
||||
CASE_GVARS(menuModelGVars)
|
||||
#endif
|
||||
menuModelLogicalSwitches,
|
||||
menuModelCustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
menuModelCustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(menuModelTelemetry)
|
||||
CASE_MAVLINK(menuTelemetryMavlinkSetup)
|
||||
CASE_TEMPLATES(menuModelTemplates)
|
||||
};
|
||||
|
||||
enum EnumTabDiag {
|
||||
e_Setup,
|
||||
e_Sd,
|
||||
e_GeneralCustomFunctions,
|
||||
e_Trainer,
|
||||
e_Calib,
|
||||
e_Vers,
|
||||
};
|
||||
|
||||
bool menuMainView(evt_t event);
|
||||
bool menuGeneralDiagAna(evt_t event);
|
||||
bool menuGeneralSetup(evt_t event);
|
||||
bool menuGeneralSdManager(evt_t event);
|
||||
bool menuGeneralCustomFunctions(evt_t event);
|
||||
bool menuGeneralTrainer(evt_t event);
|
||||
bool menuGeneralVersion(evt_t event);
|
||||
bool menuGeneralCalib(evt_t event);
|
||||
|
||||
static const MenuHandlerFunc menuTabGeneral[] PROGMEM = {
|
||||
menuGeneralSetup,
|
||||
menuGeneralSdManager,
|
||||
menuGeneralCustomFunctions,
|
||||
menuGeneralTrainer,
|
||||
menuGeneralCalib,
|
||||
menuGeneralVersion,
|
||||
};
|
||||
|
||||
bool menuFirstCalib(evt_t event);
|
||||
bool menuMainView(evt_t event);
|
||||
bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunctionsContext & functionsContext);
|
||||
bool menuModelSelect(evt_t event);
|
||||
bool menuModelSetup(evt_t event);
|
||||
bool menuModelCustomFunctions(evt_t event);
|
||||
bool menuStatisticsView(evt_t event);
|
||||
bool menuStatisticsDebug(evt_t event);
|
||||
bool menuAboutView(evt_t event);
|
||||
@@ -106,6 +180,8 @@ bool menuTextView(evt_t event);
|
||||
void menuTraceBuffer(evt_t event);
|
||||
#endif
|
||||
|
||||
typedef uint16_t FlightModesType;
|
||||
|
||||
extern int8_t checkIncDec_Ret; // global helper vars
|
||||
|
||||
#define EDIT_SELECT_MENU -1
|
||||
@@ -190,10 +266,15 @@ int8_t checkIncDecMovedSwitch(int8_t val);
|
||||
#define CHECK_INCDEC_GENVAR(event, var, min, max) \
|
||||
var = checkIncDecGen(event, var, min, max)
|
||||
|
||||
#define NAVIGATION_LINE_BY_LINE 0x40
|
||||
#define CURSOR_ON_LINE() (menuHorizontalPosition<0)
|
||||
#define NAVIGATION_LINE_BY_LINE 0x40
|
||||
#define CURSOR_ON_LINE() (menuHorizontalPosition<0)
|
||||
|
||||
#define INCDEC_DECLARE_VARS(f) uint8_t incdecFlag = (f); IsValueAvailable isValueAvailable = NULL
|
||||
#define INCDEC_SET_FLAG(f) incdecFlag = (f)
|
||||
#define INCDEC_ENABLE_CHECK(fn) isValueAvailable = fn
|
||||
#define CHECK_INCDEC_PARAM(event, var, min, max) \
|
||||
checkIncDec(event, var, min, max, incdecFlag, isValueAvailable)
|
||||
|
||||
#define CHECK_FLAG_NO_SCREEN_INDEX 1
|
||||
bool navigate(evt_t event, int count, int rows, int columns=1);
|
||||
bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint8_t flags=0);
|
||||
bool check_simple(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, vertpos_t maxrow);
|
||||
@@ -249,8 +330,14 @@ int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, evt_t e
|
||||
#define displayGVar(x, y, v, min, max) lcdDrawNumber(x, y, v)
|
||||
#endif
|
||||
|
||||
extern uint8_t editNameCursorPos;
|
||||
void editName(coord_t x, coord_t y, char *name, uint8_t size, evt_t event, uint8_t active, LcdFlags flags=ZCHAR);
|
||||
|
||||
uint8_t editDelay(const coord_t x, const coord_t y, const evt_t event, const uint8_t attr, uint8_t delay);
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t attr);
|
||||
|
||||
extern uint8_t s_curveChan;
|
||||
|
||||
#define WARNING_TYPE_ASTERISK 0
|
||||
#define WARNING_TYPE_CONFIRM 1
|
||||
#define WARNING_TYPE_INPUT 2
|
||||
@@ -261,6 +348,14 @@ extern uint8_t warningInfoLength;
|
||||
extern uint8_t warningResult;
|
||||
extern uint8_t warningType;
|
||||
|
||||
#define COPY_MODE 1
|
||||
#define MOVE_MODE 2
|
||||
extern uint8_t s_copyMode;
|
||||
|
||||
extern int8_t s_copySrcRow;
|
||||
extern int8_t s_copyTgtOfs;
|
||||
extern uint8_t s_currIdx;
|
||||
|
||||
#define MENU_X 80
|
||||
#define MENU_W LCD_W-(2*MENU_X)
|
||||
#define POPUP_X 130
|
||||
@@ -272,11 +367,12 @@ extern uint8_t warningType;
|
||||
#define WARNING_LINE_Y (POPUP_Y+9)
|
||||
#define WARNING_INFOLINE_Y (WARNING_LINE_Y+68)
|
||||
|
||||
void displayBox();
|
||||
void displayPopup(const char *title);
|
||||
void copySelection(char * dst, const char * src, uint8_t size);
|
||||
|
||||
void displayPopup(const char * title);
|
||||
void displayWarning(evt_t event);
|
||||
|
||||
extern void (*popupFunc)(evt_t event);
|
||||
extern void (* popupFunc)(evt_t event);
|
||||
extern int16_t warningInputValue;
|
||||
extern int16_t warningInputValueMin;
|
||||
extern int16_t warningInputValueMax;
|
||||
@@ -322,4 +418,6 @@ void pushModelNotes();
|
||||
typedef int (*FnFuncP) (int x);
|
||||
void drawFunction(FnFuncP fn, int offset=0);
|
||||
|
||||
uint8_t switchToMix(uint8_t source);
|
||||
|
||||
#endif // _MENUS_H_
|
||||
|
||||
@@ -37,14 +37,12 @@
|
||||
#include "../../opentx.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define COLUMN_HEADER_X 150
|
||||
|
||||
void displayHeader(const char *header)
|
||||
void drawHeader(const char * header)
|
||||
{
|
||||
// TODO ? lcdDrawText(COLUMN_HEADER_X, MENU_FOOTER_TOP, header, HEADER_COLOR);
|
||||
}
|
||||
|
||||
void displayColumnHeader(const char * const *headers, uint8_t index)
|
||||
void drawColumnHeader(const char * const * headers, uint8_t index)
|
||||
{
|
||||
// TODO ? displayHeader(headers[index]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user