Removed on-the-fly model conversions

This makes no sense for YAML model files, only for BIN models (when YAML is not the format of choice).
This commit is contained in:
Raphael Coeffic
2021-11-10 11:07:03 +01:00
parent 88a9b1c6d9
commit 4a5a0be38c
6 changed files with 57 additions and 34 deletions
+22 -2
View File
@@ -133,14 +133,34 @@ const char *loadFileBin(const char *fullpath, uint8_t *data,
return nullptr;
}
const char * readModelBin(const char * filename, uint8_t * buffer, uint32_t size, uint8_t * version)
#if defined(SDCARD_RAW)
const char* readModel(const char* filename, uint8_t* buffer, uint32_t size)
{
uint8_t version = 0;
// Conversions from EEPROM are done in batch when converting the radio file.
// It is not supported on a model by model base when loaded.
const char *error = readModelBin(filename, buffer, size, &version);
if (error) return error;
#if defined(STORAGE_CONVERSIONS)
if (version < EEPROM_VER) {
convertBinModelData(filename, version);
error = readModelBin(filename, buffer, size, &version);
}
#endif
return error;
}
#endif
const char *readModelBin(const char *filename, uint8_t *buffer, uint32_t size,
uint8_t *version)
{
char path[256];
getModelPath(path, filename);
return loadFileBin(path, buffer, size, version);
}
const char * loadRadioSettingsBin(const char * path)
{
uint8_t version;