Added EEPROM conversions to YAML

This commit is contained in:
Raphael Coeffic
2021-11-10 11:07:00 +01:00
parent 630e6918ea
commit 5e0d0131b4
13 changed files with 105 additions and 25 deletions
+12 -1
View File
@@ -23,6 +23,9 @@
#include <string.h>
#include "opentx.h"
#include "../timers.h"
#include "storage/eeprom_common.h"
#include "storage/eeprom_rlc.h"
#include "conversions/conversions.h"
uint8_t s_write_err = 0; // error reasons
@@ -154,6 +157,7 @@ void eepromCheck()
ENABLE_SYNC_WRITE(false);
}
#if !defined(SDCARD_RAW) && !defined(SDCARD_YAML)
void storageFormat()
{
ENABLE_SYNC_WRITE(true);
@@ -179,6 +183,7 @@ void storageFormat()
ENABLE_SYNC_WRITE(false);
}
#endif
bool eepromOpen()
{
@@ -444,7 +449,7 @@ bool RlcFile::copy(uint8_t i_fileDst, uint8_t i_fileSrc)
return true;
}
#if defined(SDCARD)
#if defined(SDCARD) && !defined(SDCARD_RAW) && !defined(SDCARD_YAML)
const char * eeBackupModel(uint8_t i_fileSrc)
{
char * buf = reusableBuffer.modelsel.mainname;
@@ -827,11 +832,16 @@ void eeLoadModelName(uint8_t id, char *name)
}
}
#if defined(SDCARD_RAW) || defined(SDCARD_YAML)
bool eeModelExistsRlc(uint8_t id)
#else
bool eeModelExists(uint8_t id)
#endif
{
return EFile::exists(FILE_MODEL(id));
}
#if !defined(SDCARD_RAW) && !defined(SDCARD_YAML)
void storageCheck(bool immediately)
{
if (immediately) {
@@ -851,6 +861,7 @@ void storageCheck(bool immediately)
theFile.writeRlc(FILE_MODEL(g_eeGeneral.currModel), FILE_TYP_MODEL, (uint8_t*)&g_model, sizeof(g_model), immediately);
}
}
#endif
void eeLoadModelHeader(uint8_t id, ModelHeader *header)
{