X7D renamed to X7
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
#define MENUS_SCROLLBAR_WIDTH 0
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define HEADER_LINE 0
|
||||
#define HEADER_LINE_COLUMNS
|
||||
#else
|
||||
@@ -232,7 +232,7 @@ void title(const pm_char * s);
|
||||
#define MENU_TAB(...) static const pm_uint8_t mstate_tab[] PROGMEM = __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define MENU_CHECK(tab, menu, lines_count) \
|
||||
check(event, menu, tab, DIM(tab), mstate_tab, DIM(mstate_tab)-1, lines_count)
|
||||
#else
|
||||
@@ -245,7 +245,7 @@ void title(const pm_char * s);
|
||||
MENU_CHECK(tab, menu, lines_count); \
|
||||
TITLE(title)
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define SIMPLE_MENU_NOTITLE(tab, menu, lines_count) \
|
||||
check_simple(event, menu, tab, DIM(tab), lines_count);
|
||||
#define SUBMENU_NOTITLE(lines_count, ...) { \
|
||||
@@ -408,7 +408,7 @@ void drawStatusLine();
|
||||
#endif
|
||||
|
||||
// TODO enum
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define EDIT_MODE_INIT 0
|
||||
#else
|
||||
#define EDIT_MODE_INIT -1
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#if defined(CPUARM)
|
||||
void menuRadioSpecialFunctions(event_t event)
|
||||
{
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
const CustomFunctionData * cfn = &g_eeGeneral.customFn[menuVerticalPosition];
|
||||
if (!CFN_SWITCH(cfn) && menuHorizontalPosition < 0 && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
menuHorizontalPosition = 0;
|
||||
@@ -32,7 +32,7 @@ void menuRadioSpecialFunctions(event_t event)
|
||||
|
||||
MENU(STR_MENUSPECIALFUNCS, menuTabGeneral, MENU_RADIO_SPECIAL_FUNCTIONS, HEADER_LINE+MAX_SPECIAL_FUNCTIONS, { HEADER_LINE_COLUMNS NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
if (!CFN_SWITCH(cfn) && menuHorizontalPosition < 0) {
|
||||
menuHorizontalPosition = 0;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ void menuRadioSpecialFunctions(event_t event)
|
||||
|
||||
menuSpecialFunctions(event, g_eeGeneral.customFn, &globalFunctionsContext);
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
if (!CFN_SWITCH(cfn) && menuHorizontalPosition == 0 && s_editMode <= 0) {
|
||||
menuHorizontalPosition = -1;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "keys.h"
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
typedef int8_t horzpos_t;
|
||||
#define NAVIGATION_LINE_BY_LINE 0x40
|
||||
#define IS_LINE_SELECTED(sub, k) ((sub)==(k) && menuHorizontalPosition < 0)
|
||||
|
||||
@@ -260,7 +260,7 @@ void menuModelFlightModesAll(event_t event)
|
||||
trimsCheckTimer = 200; // 2 seconds
|
||||
}
|
||||
// no break
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
#endif
|
||||
if (sub >= 0 && sub < MAX_FLIGHT_MODES) {
|
||||
|
||||
@@ -233,7 +233,7 @@ void menuModelLogicalSwitches(event_t event)
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
case EVT_ROTARY_BREAK:
|
||||
#endif
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
|
||||
@@ -260,7 +260,7 @@ void menuModelSelect(event_t event)
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
chainMenu(menuTabModel[DIM(menuTabModel)-1]);
|
||||
killEvents(event);
|
||||
@@ -292,7 +292,7 @@ void menuModelSelect(event_t event)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
case EVT_ROTARY_LEFT:
|
||||
case EVT_ROTARY_RIGHT:
|
||||
#endif
|
||||
@@ -333,7 +333,7 @@ void menuModelSelect(event_t event)
|
||||
lcdDrawNumber(17*FW, 0, reusableBuffer.modelsel.eepromfree, RIGHT);
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), 0);
|
||||
#elif defined(ROTARY_ENCODER_NAVIGATION)
|
||||
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_ROTARY_ENCODER_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
|
||||
|
||||
@@ -55,7 +55,7 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SWITCHES_WARNING,
|
||||
ITEM_MODEL_BEEP_CENTER,
|
||||
CASE_CPUARM(ITEM_MODEL_USE_GLOBAL_FUNCTIONS)
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
ITEM_MODEL_INTERNAL_MODULE_LABEL,
|
||||
ITEM_MODEL_INTERNAL_MODULE_MODE,
|
||||
ITEM_MODEL_INTERNAL_MODULE_CHANNELS,
|
||||
@@ -87,7 +87,7 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_PPM1_PROTOCOL,
|
||||
ITEM_MODEL_PPM1_PARAMS,
|
||||
#endif
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
ITEM_MODEL_TRAINER_LABEL,
|
||||
ITEM_MODEL_TRAINER_MODE,
|
||||
ITEM_MODEL_TRAINER_CHANNELS,
|
||||
@@ -107,7 +107,7 @@ enum MenuModelSetupItems {
|
||||
#define MODEL_SETUP_RANGE_OFS 4*FW+3
|
||||
#define MODEL_SETUP_SET_FAILSAFE_OFS 7*FW-2
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_TRAINER_LABEL ? TRAINER_MODULE : (k>=ITEM_MODEL_EXTERNAL_MODULE_LABEL ? EXTERNAL_MODULE : INTERNAL_MODULE))
|
||||
#elif defined(PCBSKY9X) && !defined(REVA)
|
||||
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_EXTRA_MODULE_LABEL ? EXTRA_MODULE : EXTERNAL_MODULE)
|
||||
@@ -152,7 +152,7 @@ enum MenuModelSetupItems {
|
||||
#define EXTRA_MODULE_ROWS
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define TRAINER_CHANNELS_ROWS() IF_TRAINER_ON(1)
|
||||
#define TRAINER_MODULE_ROWS LABEL(Trainer), 0, TRAINER_CHANNELS_ROWS(), IF_TRAINER_ON(2)
|
||||
#else
|
||||
@@ -169,7 +169,7 @@ enum MenuModelSetupItems {
|
||||
|
||||
void menuModelSetup(event_t event)
|
||||
{
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
MENU_TAB({ HEADER_LINE_COLUMNS 0, TIMER_ROWS, TIMER_ROWS, TIMER_ROWS, 0, 1, 0, 0, 0, 0, 0, CASE_CPUARM(LABEL(PreflightCheck)) CASE_CPUARM(0) 0, NUM_SWITCHES-1, NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_ROTARY_ENCODERS-1, 0,
|
||||
LABEL(InternalModule),
|
||||
INTERNAL_MODULE_MODE_ROWS,
|
||||
@@ -550,7 +550,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, TR_INTERNALRF);
|
||||
break;
|
||||
@@ -739,7 +739,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
case ITEM_MODEL_TRAINER_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_TRAINER);
|
||||
break;
|
||||
@@ -751,7 +751,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_CHANNELS:
|
||||
case ITEM_MODEL_TRAINER_CHANNELS:
|
||||
#endif
|
||||
@@ -787,7 +787,7 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
case ITEM_MODEL_TRAINER_SETTINGS:
|
||||
case ITEM_MODEL_INTERNAL_MODULE_BIND:
|
||||
#endif
|
||||
@@ -877,7 +877,7 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_FAILSAFE:
|
||||
#endif
|
||||
#if defined(CPUARM)
|
||||
|
||||
@@ -371,7 +371,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
if (sub==k && menuHorizontalPosition<0 && CFN_SWITCH(cfn)) {
|
||||
lcdInvertLine(i+1);
|
||||
}
|
||||
@@ -381,7 +381,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
|
||||
void menuModelSpecialFunctions(event_t event)
|
||||
{
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
const CustomFunctionData * cfn = &g_model.customFn[menuVerticalPosition];
|
||||
if (!CFN_SWITCH(cfn) && menuHorizontalPosition < 0 && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
menuHorizontalPosition = 0;
|
||||
@@ -389,14 +389,14 @@ void menuModelSpecialFunctions(event_t event)
|
||||
#endif
|
||||
MENU(STR_MENUCUSTOMFUNC, menuTabModel, MENU_MODEL_SPECIAL_FUNCTIONS, HEADER_LINE+MAX_SPECIAL_FUNCTIONS, { HEADER_LINE_COLUMNS NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
if (!CFN_SWITCH(cfn) && menuHorizontalPosition < 0) {
|
||||
menuHorizontalPosition = 0;
|
||||
}
|
||||
#endif
|
||||
menuSpecialFunctions(event, g_model.customFn, &modelFunctionsContext);
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
if (!CFN_SWITCH(cfn) && menuHorizontalPosition == 0 && s_editMode <= 0) {
|
||||
menuHorizontalPosition = -1;
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
switch (event) {
|
||||
case EVT_KEY_BREAK(KEY_DOWN):
|
||||
case EVT_KEY_BREAK(KEY_UP):
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
case EVT_KEY_BREAK(KEY_LEFT):
|
||||
case EVT_KEY_BREAK(KEY_RIGHT):
|
||||
#endif
|
||||
|
||||
@@ -53,7 +53,7 @@ int8_t checkIncDecMovedSwitch(int8_t val)
|
||||
|
||||
int8_t checkIncDec_Ret;
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define DBLKEYS_PRESSED_RGT_LFT(in) (false)
|
||||
#define DBLKEYS_PRESSED_UP_DWN(in) (false)
|
||||
#define DBLKEYS_PRESSED_RGT_UP(in) (false)
|
||||
@@ -70,7 +70,7 @@ INIT_STOPS(stops100, 3, -100, 0, 100)
|
||||
INIT_STOPS(stops1000, 3, -1000, 0, 1000)
|
||||
INIT_STOPS(stopsSwitch, 15, SWSRC_FIRST, CATEGORY_END(-SWSRC_FIRST_LOGICAL_SWITCH), CATEGORY_END(-SWSRC_FIRST_TRIM), CATEGORY_END(-SWSRC_LAST_SWITCH+1), 0, CATEGORY_END(SWSRC_LAST_SWITCH), CATEGORY_END(SWSRC_FIRST_TRIM-1), CATEGORY_END(SWSRC_FIRST_LOGICAL_SWITCH-1), SWSRC_LAST)
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_flags, IsValueAvailable isValueAvailable, const CheckIncDecStops &stops)
|
||||
{
|
||||
int newval = val;
|
||||
@@ -510,7 +510,7 @@ int8_t checkIncDecGen(event_t event, int8_t i_val, int8_t i_min, int8_t i_max)
|
||||
tmr10ms_t menuEntryTime;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define MAXCOL_RAW(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
|
||||
#define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE)))
|
||||
#define COLATTR(row) (MAXCOL_RAW(row) == (uint8_t)-1 ? (const uint8_t)0 : (const uint8_t)(MAXCOL_RAW(row) & NAVIGATION_LINE_BY_LINE))
|
||||
@@ -975,7 +975,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
if (!IS_ROTARY_RIGHT(event) && l_posVert==maxrow) break;
|
||||
// no break
|
||||
@@ -1020,7 +1020,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if !defined(PCBX7D)
|
||||
#if !defined(PCBX7)
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
if (!IS_ROTARY_LEFT(event) && l_posVert==0) break;
|
||||
// no break
|
||||
|
||||
@@ -62,7 +62,7 @@ void menuRadioDiagAnalogs(event_t event)
|
||||
lcdDrawNumber(64+5+6*FW-3, 1+4*FH, BandGap, RIGHT);
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT + 1 + (NUM_STICKS+NUM_POTS+NUM_SLIDERS+1)/2 * FH + 2, STR_BATT_CALIB);
|
||||
putsVolts(LEN_CALIB_FIELDS*FW+FW, MENU_HEADER_HEIGHT + 1 + (NUM_STICKS+NUM_POTS+NUM_SLIDERS+1)/2 * FH + 2, getBatteryVoltage(), (menuVerticalPosition==HEADER_LINE ? INVERS | (s_editMode > 0 ? BLINK : 0) : 0) | PREC2 | LEFT);
|
||||
#elif defined(PCBSKY9X)
|
||||
|
||||
@@ -35,7 +35,7 @@ enum MenuRadioHardwareItems {
|
||||
#define GENERAL_HW_PARAM_OFS (2+(15*FW))
|
||||
void menuRadioHardware(event_t event)
|
||||
{
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#else
|
||||
MENU(STR_HARDWARE, menuTabGeneral, MENU_RADIO_HARDWARE, ITEM_RADIO_HARDWARE_MAX+1, {0, 0, (uint8_t)-1, 0, 0, 0, IF_ROTARY_ENCODERS(0) CASE_BLUETOOTH(0)});
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ enum AboutScreens {
|
||||
#define ABOUT_X 2
|
||||
#define ABOUT_INDENT 4
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_LONG(KEY_PAGE)
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGE)
|
||||
#else
|
||||
|
||||
@@ -211,7 +211,7 @@ void displayVoltageOrAlarm()
|
||||
#define displayVoltageOrAlarm() displayBattVoltage()
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define EVT_KEY_CONTEXT_MENU EVT_KEY_LONG(KEY_ENTER)
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGE)
|
||||
#define EVT_KEY_NEXT_PAGE EVT_ROTARY_RIGHT
|
||||
@@ -508,7 +508,7 @@ void menuMainView(event_t event)
|
||||
doMainScreenGraphics();
|
||||
|
||||
// Switches
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
uint8_t x = 2*FW-2, y = 4*FH+i*FH+1;
|
||||
|
||||
@@ -488,7 +488,7 @@ void incrTelemetryScreen()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7D)
|
||||
#if defined(PCBX7)
|
||||
#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_LONG(KEY_PAGE)
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGE)
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user