chore(radio): remove EEPROM macros and related code (#5461)
This commit is contained in:
@@ -139,14 +139,10 @@ extern uint8_t s_copySrcCh;
|
||||
extern int8_t s_currCh;
|
||||
extern uint8_t s_maxLines;
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define STATUS_LINE_LENGTH 32
|
||||
extern char statusLineMsg[STATUS_LINE_LENGTH];
|
||||
void showStatusLine();
|
||||
void drawStatusLine();
|
||||
#else
|
||||
#define drawStatusLine()
|
||||
#endif
|
||||
|
||||
void menuTextView(event_t event);
|
||||
void pushMenuTextView(const char *filename);
|
||||
|
||||
@@ -25,9 +25,7 @@ const MenuHandler menuTabGeneral[MENU_RADIO_PAGES_COUNT] = {
|
||||
#if defined(RADIO_TOOLS)
|
||||
{ menuRadioTools, nullptr },
|
||||
#endif
|
||||
#if defined(SDCARD)
|
||||
{ menuRadioSdManager, nullptr },
|
||||
#endif
|
||||
{ menuRadioSetup, nullptr },
|
||||
{ menuRadioSpecialFunctions, radioGFEnabled },
|
||||
{ menuRadioTrainer, radioTrainerEnabled },
|
||||
|
||||
@@ -54,7 +54,7 @@ enum MenuRadioIndexes
|
||||
#if defined(RADIO_TOOLS)
|
||||
MENU_RADIO_TOOLS,
|
||||
#endif
|
||||
CASE_SDCARD(MENU_RADIO_SD_MANAGER)
|
||||
MENU_RADIO_SD_MANAGER,
|
||||
MENU_RADIO_SETUP,
|
||||
MENU_RADIO_SPECIAL_FUNCTIONS,
|
||||
MENU_RADIO_TRAINER,
|
||||
|
||||
@@ -53,7 +53,6 @@ void onModelSelectMenu(const char * result)
|
||||
s_copyTgtOfs = 0;
|
||||
s_copySrcRow = -1;
|
||||
}
|
||||
#if defined(SDCARD)
|
||||
else if (result == STR_BACKUP_MODEL) {
|
||||
storageCheck(true); // force writing of current model data before this is changed
|
||||
POPUP_WARNING(backupModel(sub));
|
||||
@@ -61,24 +60,17 @@ void onModelSelectMenu(const char * result)
|
||||
else if (result == STR_RESTORE_MODEL || result == STR_UPDATE_LIST) {
|
||||
const char* ext = nullptr;
|
||||
const char* path = nullptr;
|
||||
#if defined(SDCARD_YAML)
|
||||
ext = STR_YAML_EXT;
|
||||
path = STR_BACKUP_PATH;
|
||||
#else
|
||||
ext = STR_MODELS_EXT;
|
||||
path = STR_MODELS_PATH;
|
||||
#endif
|
||||
if (sdListFiles(path, ext, MENU_LINE_LENGTH-1, nullptr))
|
||||
POPUP_MENU_START(onModelSelectMenu);
|
||||
else
|
||||
POPUP_WARNING(STR_NO_MODELS_ON_SD);
|
||||
}
|
||||
#endif
|
||||
else if (result == STR_DELETE_MODEL) {
|
||||
POPUP_CONFIRMATION(STR_DELETEMODEL, onDeleteModelConfirm);
|
||||
SET_WARNING_INFO(modelHeaders[sub].name, sizeof(g_model.header.name), 0);
|
||||
}
|
||||
#if defined(SDCARD)
|
||||
else if (result != STR_EXIT) {
|
||||
// The user choosed a file on SD to restore
|
||||
storageCheck(true);
|
||||
@@ -87,7 +79,6 @@ void onModelSelectMenu(const char * result)
|
||||
loadModel(sub);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void moveToFreeModelSlot(bool forward, int8_t& sub, int8_t oldSub)
|
||||
@@ -206,22 +197,18 @@ void menuModelSelect(event_t event)
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
if (modelExists(sub)) {
|
||||
POPUP_MENU_ADD_ITEM(STR_SELECT_MODEL);
|
||||
POPUP_MENU_ADD_SD_ITEM(STR_BACKUP_MODEL);
|
||||
POPUP_MENU_ADD_ITEM(STR_BACKUP_MODEL);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_MODEL);
|
||||
POPUP_MENU_ADD_ITEM(STR_MOVE_MODEL);
|
||||
POPUP_MENU_ADD_ITEM(STR_DELETE_MODEL);
|
||||
}
|
||||
else {
|
||||
#if defined(SDCARD)
|
||||
POPUP_MENU_ADD_ITEM(STR_CREATE_MODEL);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESTORE_MODEL);
|
||||
#else
|
||||
selectModel(sub);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
POPUP_MENU_ADD_SD_ITEM(STR_BACKUP_MODEL);
|
||||
POPUP_MENU_ADD_ITEM(STR_BACKUP_MODEL);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_MODEL);
|
||||
POPUP_MENU_ADD_ITEM(STR_MOVE_MODEL);
|
||||
}
|
||||
@@ -265,12 +252,6 @@ void menuModelSelect(event_t event)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(EEPROM)
|
||||
lcdDrawText(9*FW-(LEN_FREE-4)*FW-4, 0, STR_FREE);
|
||||
if (event) reusableBuffer.modelsel.eepromfree = EeFsGetFree();
|
||||
lcdDrawNumber(lcdLastRightPos+3, 0, reusableBuffer.modelsel.eepromfree, LEFT);
|
||||
#endif
|
||||
|
||||
extern uint8_t menuSize(const MenuHandler*, uint8_t);
|
||||
uint8_t sz = menuSize(menuTabModel, DIM(menuTabModel));
|
||||
#if defined(NAVIGATION_X7)
|
||||
|
||||
@@ -30,10 +30,8 @@
|
||||
#include "usb_joystick.h"
|
||||
#endif
|
||||
|
||||
#if !defined(EEPROM)
|
||||
#include "storage/sdcard_common.h"
|
||||
#include "storage/modelslist.h"
|
||||
#endif
|
||||
|
||||
#if defined(CROSSFIRE)
|
||||
#include "telemetry/crossfire.h"
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#define MODEL_SPECIAL_FUNC_4TH_COLUMN_ONOFF (19 * FW - 3)
|
||||
#define MODEL_SPECIAL_FUNC_5TH_COLUMN_ONOFF (20 * FW + 1)
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define SD_LOGS_PERIOD_MIN 1 // 0.1s fastest period
|
||||
#define SD_LOGS_PERIOD_MAX 255 // 25.5s slowest period
|
||||
#define SD_LOGS_PERIOD_DEFAULT 10 // 1s default period for newly created SF
|
||||
@@ -75,7 +74,6 @@ void onCustomFunctionsFileSelectionMenu(const char * result)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // SDCARD
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
void onAdjustGvarSourceLongEnterPress(const char * result)
|
||||
@@ -316,7 +314,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
|
||||
}
|
||||
#endif
|
||||
#if defined(SDCARD)
|
||||
else if (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT || func == FUNC_RGB_LED) {
|
||||
coord_t x = MODEL_SPECIAL_FUNC_3RD_COLUMN - 6;
|
||||
if (func == FUNC_PLAY_SCRIPT)
|
||||
@@ -359,7 +356,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
INCDEC_ENABLE_CHECK(functionsContext == &globalFunctionsContext ? isSourceAvailableInGlobalFunctions : isSourceAvailable);
|
||||
}
|
||||
}
|
||||
#endif // SDCARD
|
||||
else if (func == FUNC_VOLUME) {
|
||||
val_max = MIXSRC_LAST_CH;
|
||||
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
@@ -376,7 +372,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||
}
|
||||
}
|
||||
#if defined(SDCARD)
|
||||
else if (func == FUNC_LOGS) {
|
||||
val_min = SD_LOGS_PERIOD_MIN;
|
||||
val_max = SD_LOGS_PERIOD_MAX;
|
||||
@@ -388,7 +383,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
|
||||
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||
}
|
||||
#endif
|
||||
#if defined(GVARS)
|
||||
else if (func == FUNC_ADJUST_GVAR) {
|
||||
switch (CFN_GVAR_MODE(cfn)) {
|
||||
|
||||
@@ -243,7 +243,6 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
char statusLineMsg[STATUS_LINE_LENGTH];
|
||||
tmr10ms_t statusLineTime = 0;
|
||||
uint8_t statusLineHeight = 0;
|
||||
@@ -272,4 +271,3 @@ void drawStatusLine()
|
||||
lcdDrawFilledRect(0, LCD_H-statusLineHeight, LCD_W, FH, SOLID);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user