Fixed defines

This commit is contained in:
Raphael Coeffic
2021-06-10 14:47:38 +02:00
parent 685acfecf4
commit e5a34a583f
+1 -13
View File
@@ -21,11 +21,10 @@
#include "opentx.h" #include "opentx.h"
#include "conversions.h" #include "conversions.h"
#if defined(SDCARD) #if defined(COLORLCD)
#include "storage/modelslist.h" #include "storage/modelslist.h"
#include "storage/sdcard_common.h" #include "storage/sdcard_common.h"
#if defined(COLORLCD)
static void drawProgressScreen(const char* filename, int progress, int total) static void drawProgressScreen(const char* filename, int progress, int total)
{ {
OpenTxTheme* l_theme = static_cast<OpenTxTheme*>(theme); OpenTxTheme* l_theme = static_cast<OpenTxTheme*>(theme);
@@ -45,23 +44,17 @@ static void drawProgressScreen(const char* filename, int progress, int total)
WDG_RESET(); WDG_RESET();
lcdRefresh(); lcdRefresh();
} }
#endif
void convertRadioData(int version) void convertRadioData(int version)
{ {
TRACE("convertRadioData(%d)", version); TRACE("convertRadioData(%d)", version);
#if defined(COLORLCD)
// the theme has not been loaded before // the theme has not been loaded before
static_cast<OpenTxTheme*>(theme)->load(); static_cast<OpenTxTheme*>(theme)->load();
#endif
// Init backlight mode before entering alert screens // Init backlight mode before entering alert screens
requiredBacklightBright = BACKLIGHT_FORCED_ON; requiredBacklightBright = BACKLIGHT_FORCED_ON;
#if defined(PCBHORUS)
g_eeGeneral.blOffBright = 20; g_eeGeneral.blOffBright = 20;
#endif
RAISE_ALERT(STR_STORAGE_WARNING, STR_SDCARD_CONVERSION_REQUIRE, NULL, RAISE_ALERT(STR_STORAGE_WARNING, STR_SDCARD_CONVERSION_REQUIRE, NULL,
AU_NONE); AU_NONE);
@@ -69,10 +62,7 @@ void convertRadioData(int version)
unsigned converted = 0; unsigned converted = 0;
auto to_convert = modelslist.getModelsCount() + 1; auto to_convert = modelslist.getModelsCount() + 1;
#if defined(COLORLCD)
drawProgressScreen(RADIO_FILENAME, converted, to_convert); drawProgressScreen(RADIO_FILENAME, converted, to_convert);
#endif
TRACE("converting '%s' (%d/%d)", RADIO_FILENAME, converted, to_convert); TRACE("converting '%s' (%d/%d)", RADIO_FILENAME, converted, to_convert);
#if STORAGE_CONVERSIONS < 220 #if STORAGE_CONVERSIONS < 220
@@ -94,9 +84,7 @@ void convertRadioData(int version)
const char* filename = model_ptr->modelFilename; const char* filename = model_ptr->modelFilename;
TRACE("converting '%s' (%d/%d)", filename, converted, to_convert); TRACE("converting '%s' (%d/%d)", filename, converted, to_convert);
#if defined(COLORLCD)
drawProgressScreen(filename, converted, to_convert); drawProgressScreen(filename, converted, to_convert);
#endif
error = readModel(filename, (uint8_t *)&g_model, sizeof(g_model), &model_version); error = readModel(filename, (uint8_t *)&g_model, sizeof(g_model), &model_version);
if (!error) { if (!error) {