chore(bw): remove unused READ_ONLY and READ_ONLY_UNLOCKED macros (#5156)
This commit is contained in:
@@ -72,7 +72,7 @@ void menuModelCustomScriptOne(event_t event)
|
||||
lcdDrawSizedText(SCRIPT_ONE_2ND_COLUMN_POS, y, sd.file, sizeof(sd.file), attr);
|
||||
else
|
||||
lcdDrawTextAtIndex(SCRIPT_ONE_2ND_COLUMN_POS, y, STR_VCSWFUNC, 0, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER) && !READ_ONLY()) {
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
if (sdListFiles(SCRIPTS_MIXES_PATH, SCRIPTS_EXT, sizeof(sd.file), sd.file, LIST_NONE_SD_FILE)) {
|
||||
POPUP_MENU_START(onModelCustomScriptMenu);
|
||||
|
||||
@@ -165,7 +165,7 @@ void menuModelDisplay(event_t event)
|
||||
else
|
||||
lcdDrawTextAtIndex(DISPLAY_COL2+7*FW, y, STR_VCSWFUNC, 0, (menuHorizontalPosition==1 ? attr : 0));
|
||||
|
||||
if (menuHorizontalPosition==1 && attr && event==EVT_KEY_BREAK(KEY_ENTER) && READ_ONLY_UNLOCKED()) {
|
||||
if (menuHorizontalPosition==1 && attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
if (sdListFiles(SCRIPTS_TELEM_PATH, SCRIPTS_EXT, sizeof(g_model.screens[screenIndex].script.file), g_model.screens[screenIndex].script.file)) {
|
||||
POPUP_MENU_START(onTelemetryScriptFileSelectionMenu);
|
||||
|
||||
@@ -87,7 +87,7 @@ void menuModelLogicalSwitches(event_t event)
|
||||
horzpos_t horz = menuHorizontalPosition;
|
||||
bool showHeader = true;
|
||||
|
||||
if (horz<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
if (horz<0 && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
LogicalSwitchData * cs = lswAddress(sub);
|
||||
if (cs->func)
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY);
|
||||
|
||||
@@ -145,7 +145,7 @@ void menuModelLimits(event_t event)
|
||||
int limit = (g_model.extendedLimits ? LIMIT_EXT_MAX : 1000);
|
||||
|
||||
putsChn(0, y, k+1, (sub==k && menuHorizontalPosition < 0) ? INVERS : 0);
|
||||
if (sub==k && menuHorizontalPosition < 0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
if (sub==k && menuHorizontalPosition < 0 && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
POPUP_MENU_START(onLimitsMenu, 4, STR_RESET, STR_COPY_TRIMS_TO_OFS, STR_COPY_STICKS_TO_OFS, STR_COPY_MIN_MAX_TO_OUTPUTS);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,12 +163,7 @@ void menuModelSelect(event_t event)
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
s_editMode = 0;
|
||||
if (READ_ONLY()) {
|
||||
if (g_eeGeneral.currModel != sub && modelExists(sub)) {
|
||||
selectModel(sub);
|
||||
}
|
||||
}
|
||||
else if (s_copyMode && (s_copyTgtOfs || s_copySrcRow>=0)) {
|
||||
if (s_copyMode && (s_copyTgtOfs || s_copySrcRow>=0)) {
|
||||
showMessageBox(s_copyMode==COPY_MODE ? STR_COPYINGMODEL : STR_MOVINGMODEL);
|
||||
storageCheck(true); // force writing of current model data before this is changed
|
||||
|
||||
|
||||
@@ -644,7 +644,7 @@ void menuModelSetup(event_t event)
|
||||
lcdDrawSizedText(MODEL_SETUP_2ND_COLUMN, y, g_model.header.bitmap, LEN_BITMAP_NAME, attr);
|
||||
else
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VCSWFUNC, 0, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER) && READ_ONLY_UNLOCKED()) {
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
if (sdListFiles(BITMAPS_PATH, BITMAPS_EXT, LEN_BITMAP_NAME, g_model.header.bitmap, LIST_NONE_SD_FILE)) {
|
||||
POPUP_MENU_START(onModelSetupBitmapMenu);
|
||||
@@ -876,28 +876,26 @@ void menuModelSetup(event_t event)
|
||||
|
||||
if (attr) {
|
||||
s_editMode = 0;
|
||||
if (!READ_ONLY()) {
|
||||
switch (event) {
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
break;
|
||||
switch (event) {
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
if (menuHorizontalPosition < 0) {
|
||||
START_NO_HIGHLIGHT();
|
||||
getMovedSwitch();
|
||||
// Mask switches enabled for warnings
|
||||
swarnstate_t sw_mask = 0;
|
||||
for(uint8_t i = 0; i < switchGetMaxSwitches(); i++) {
|
||||
if (SWITCH_WARNING_ALLOWED(i))
|
||||
if (g_model.switchWarning & (0x07 << (3 * i)))
|
||||
sw_mask |= (0x07 << (3 * i));
|
||||
}
|
||||
g_model.switchWarning = switches_states & sw_mask;
|
||||
AUDIO_WARNING1();
|
||||
storageDirty(EE_MODEL);
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
if (menuHorizontalPosition < 0) {
|
||||
START_NO_HIGHLIGHT();
|
||||
getMovedSwitch();
|
||||
// Mask switches enabled for warnings
|
||||
swarnstate_t sw_mask = 0;
|
||||
for(uint8_t i = 0; i < switchGetMaxSwitches(); i++) {
|
||||
if (SWITCH_WARNING_ALLOWED(i))
|
||||
if (g_model.switchWarning & (0x07 << (3 * i)))
|
||||
sw_mask |= (0x07 << (3 * i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
g_model.switchWarning = switches_states & sw_mask;
|
||||
AUDIO_WARNING1();
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -907,7 +905,7 @@ void menuModelSetup(event_t event)
|
||||
for (int i = 0; i < switchGetMaxSwitches(); i++) {
|
||||
if (SWITCH_WARNING_ALLOWED(i)) {
|
||||
div_t qr = div(current, 8);
|
||||
if (!READ_ONLY() && event == EVT_KEY_BREAK(KEY_ENTER) && line &&
|
||||
if (event == EVT_KEY_BREAK(KEY_ENTER) && line &&
|
||||
l_posHorz == current) {
|
||||
uint8_t curr_state = (states & 0x07);
|
||||
// remove old setting
|
||||
@@ -957,7 +955,7 @@ void menuModelSetup(event_t event)
|
||||
|
||||
if (attr) {
|
||||
if (menuHorizontalPosition > 0) s_editMode = 0;
|
||||
if (!READ_ONLY() && menuHorizontalPosition > 0) {
|
||||
if (menuHorizontalPosition > 0) {
|
||||
switch (event) {
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
if (g_model.potsWarnMode == POTS_WARN_MANUAL) {
|
||||
@@ -1033,11 +1031,9 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
if (attr && CURSOR_ON_CELL) {
|
||||
if (event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
if (READ_ONLY_UNLOCKED()) {
|
||||
s_editMode = 0;
|
||||
g_model.beepANACenter ^= ((BeepANACenter)1<<menuHorizontalPosition);
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
s_editMode = 0;
|
||||
g_model.beepANACenter ^= ((BeepANACenter)1<<menuHorizontalPosition);
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2024,7 +2020,7 @@ void menuModelSetup(event_t event)
|
||||
|
||||
case ITEM_MODEL_SETUP_USBJOYSTICK_APPLY:
|
||||
lcdDrawText(INDENT_WIDTH, y, BUTTON(TR_USBJOYSTICK_APPLY_CHANGES), attr);
|
||||
if (attr && !READ_ONLY() && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
onUSBJoystickModelChanged();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -154,7 +154,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
{
|
||||
int sub = menuVerticalPosition;
|
||||
uint8_t eeFlags = (functions == g_model.customFn) ? EE_MODEL : EE_GENERAL;
|
||||
if (menuHorizontalPosition<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
if (menuHorizontalPosition<0 && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
CustomFunctionData *cfn = &functions[sub];
|
||||
if (!CFN_EMPTY(cfn))
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY);
|
||||
|
||||
@@ -51,7 +51,7 @@ void menuRadioCalibration(event_t event)
|
||||
{
|
||||
check_submenu_simple(event, 0);
|
||||
title(STR_MENUCALIBRATION);
|
||||
menuCommonCalib(READ_ONLY() ? 0 : event);
|
||||
menuCommonCalib(event);
|
||||
drawPotsBars();
|
||||
if (menuEvent) {
|
||||
menuCalibrationState = CALIB_START;
|
||||
|
||||
Reference in New Issue
Block a user