Fix color lcd conversions
This commit is contained in:
@@ -82,11 +82,13 @@ void convertBinRadioData(const char * path, int version)
|
||||
#if STORAGE_CONVERSIONS < 220
|
||||
if (version == 219) {
|
||||
convertRadioData_219_to_220(path);
|
||||
version = 220;
|
||||
}
|
||||
#endif
|
||||
#if STORAGE_CONVERSIONS < 220
|
||||
if (version == 220) {
|
||||
convertRadioData_220_to_221(path);
|
||||
version = 221;
|
||||
}
|
||||
#endif
|
||||
converted++;
|
||||
@@ -137,17 +139,22 @@ void convertBinRadioData(const char * path, int version)
|
||||
const char* convertBinModelData(const char* filename, int version)
|
||||
{
|
||||
TRACE("convertModelData(%s,%d)", filename);
|
||||
|
||||
char path[FF_MAX_LFN + 1];
|
||||
memcpy(path, MODELS_PATH, sizeof(MODELS_PATH)-1);
|
||||
path[sizeof(MODELS_PATH)-1] = '/';
|
||||
strcat(&path[sizeof(MODELS_PATH)], filename);
|
||||
|
||||
#if STORAGE_CONVERSIONS < 220
|
||||
if (version == 219) {
|
||||
const char* error = convertModelData_219_to_220(filename);
|
||||
const char* error = convertModelData_219_to_220(path);
|
||||
if (error) return error;
|
||||
version = 220;
|
||||
}
|
||||
#endif
|
||||
#if STORAGE_CONVERSIONS < 221
|
||||
if (version == 220) {
|
||||
const char* error = convertModelData_220_to_221(filename);
|
||||
const char* error = convertModelData_220_to_221(path);
|
||||
if (error) return error;
|
||||
version = 221;
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ void convertRadioData_219_to_220(void* data)
|
||||
// Clear CustomScreenData + TopBarPersistentData
|
||||
// as they cannot be converted (missing option types)
|
||||
strcpy(settings.themeName, defaultTheme->getName());
|
||||
defaultTheme->init(); // TODO: just dump the data into the settings
|
||||
memset(&settings.themeData, 0, sizeof(settings.themeData));
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < NUM_SWITCHES_219; ++i) {
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
#define STORAGE_NUM_SLIDERS 0
|
||||
#define STORAGE_NUM_MOUSE_ANALOGS 0
|
||||
|
||||
#define NUM_POTS 2
|
||||
#define NUM_XPOTS 0
|
||||
|
||||
#elif defined(PCBHORUS)
|
||||
|
||||
#define STORAGE_NUM_SWITCHES 10
|
||||
@@ -40,6 +43,13 @@
|
||||
#define STORAGE_NUM_SLIDERS 4
|
||||
#define STORAGE_NUM_MOUSE_ANALOGS 2
|
||||
|
||||
#if defined(PCBX10)
|
||||
#define NUM_POTS 5
|
||||
#else
|
||||
#define NUM_POTS 3
|
||||
#endif
|
||||
#define NUM_XPOTS NUM_POTS
|
||||
|
||||
#elif defined(PCBTARANIS)
|
||||
|
||||
#if defined(PCBX9LITE)
|
||||
|
||||
@@ -94,6 +94,8 @@ static uint8_t select_zov(uint8_t* data, uint32_t bitoffs)
|
||||
data += bitoffs >> 3UL;
|
||||
data -= sizeof(ZoneOptionValueEnum);
|
||||
ZoneOptionValueEnum* p_zovt = (ZoneOptionValueEnum*)data;
|
||||
if (*p_zovt > ZOV_String)
|
||||
return 0;
|
||||
return *p_zovt;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -132,6 +132,8 @@ static uint8_t select_zov(uint8_t* data, uint32_t bitoffs)
|
||||
data += bitoffs >> 3UL;
|
||||
data -= sizeof(ZoneOptionValueEnum);
|
||||
ZoneOptionValueEnum* p_zovt = (ZoneOptionValueEnum*)data;
|
||||
if (*p_zovt > ZOV_String)
|
||||
return 0;
|
||||
return *p_zovt;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user