Use ETX instead of OTX (also as a file extension).

This commit is contained in:
rotorman
2021-12-31 10:53:08 +01:00
committed by Raphael Coeffic
parent 20961e460b
commit 89517d8bd8
29 changed files with 103 additions and 99 deletions
+2 -1
View File
@@ -60,8 +60,9 @@
#define DFU_FILES_FILTER "DFU " % CPN_STR_FILES % " (*.dfu);;"
#define EEPE_FILES_FILTER "EEPE " % CPN_STR_FILES % " (*.eepe);;"
#define OTX_FILES_FILTER "OpenTX " % CPN_STR_FILES % " (*.otx);;"
#define ETX_FILES_FILTER "EdgeTX " % CPN_STR_FILES % " (*.etx);;"
#define YML_FILES_FILTER "YAML " % CPN_STR_FILES % " (*.yml);;"
#define EEPROM_FILES_FILTER CPN_STR_RAD_MOD_SETTINGS % " " % CPN_STR_FILES % " (*.otx *.yml *.eepe *.bin *.hex);;" % OTX_FILES_FILTER % YML_FILES_FILTER % EEPE_FILES_FILTER % BIN_FILES_FILTER % HEX_FILES_FILTER
#define EEPROM_FILES_FILTER CPN_STR_RAD_MOD_SETTINGS % " " % CPN_STR_FILES % " (*.etx *.otx *.yml *.eepe *.bin *.hex);;" % ETX_FILES_FILTER % OTX_FILES_FILTER % YML_FILES_FILTER % EEPE_FILES_FILTER % BIN_FILES_FILTER % HEX_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH " % CPN_STR_FILES % " (*.bin *.hex *.dfu);;" % BIN_FILES_FILTER % HEX_FILES_FILTER % DFU_FILES_FILTER
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM " % CPN_STR_FILES % " (*.bin *.hex);;" % BIN_FILES_FILTER % HEX_FILES_FILTER
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
+2 -2
View File
@@ -157,7 +157,7 @@ MainWindow::MainWindow():
if (!str.isEmpty()) {
int fileType = getStorageType(str);
if (fileType==STORAGE_TYPE_EEPE || fileType==STORAGE_TYPE_EEPM || fileType==STORAGE_TYPE_BIN || fileType==STORAGE_TYPE_OTX) {
if (fileType==STORAGE_TYPE_EEPE || fileType==STORAGE_TYPE_EEPM || fileType==STORAGE_TYPE_BIN || fileType==STORAGE_TYPE_ETX) {
MdiChild * child = createMdiChild();
if (child->loadFile(str)) {
if (!(printing && model >= 0 && (getCurrentFirmware()->getCapability(Models) == 0 || model<getCurrentFirmware()->getCapability(Models)) && !printfilename.isEmpty())) {
@@ -908,7 +908,7 @@ void MainWindow::readEeprom()
Board::Type board = getCurrentBoard();
QString tempFile;
if (IS_FAMILY_HORUS_OR_T16(board))
tempFile = generateProcessUniqueTempFileName("temp.otx");
tempFile = generateProcessUniqueTempFileName("temp.etx");
else
tempFile = generateProcessUniqueTempFileName("temp.bin");
+3 -3
View File
@@ -1320,7 +1320,7 @@ void MdiChild::newFile(bool createDefaults)
{
static int sequenceNumber = 1;
isUntitled = true;
curFile = QString("document%1.otx").arg(sequenceNumber++);
curFile = QString("document%1.etx").arg(sequenceNumber++);
updateTitle();
if (createDefaults && firmware->getCapability(Capability::HasModelCategories)) {
@@ -1375,7 +1375,7 @@ bool MdiChild::saveAs(bool isNew)
#ifdef __APPLE__
QString filter;
#else
QString filter(OTX_FILES_FILTER % YML_FILES_FILTER);
QString filter(ETX_FILES_FILTER % YML_FILES_FILTER);
#endif
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" + fi.fileName(), filter);
@@ -1455,7 +1455,7 @@ void MdiChild::setCurrentFile(const QString & fileName)
void MdiChild::forceNewFilename(const QString & suffix, const QString & ext)
{
curFile.replace(QRegExp("\\.(eepe|bin|hex|otx)$"), suffix + "." + ext);
curFile.replace(QRegExp("\\.(eepe|bin|hex|etx)$"), suffix + "." + ext);
}
bool MdiChild::convertStorage(Board::Type from, Board::Type to, bool newFile)
+1 -1
View File
@@ -179,7 +179,7 @@ class MdiChild : public QWidget
bool maybeSave();
void setCurrentFile(const QString & fileName);
void forceNewFilename(const QString & suffix = "", const QString & ext = "otx");
void forceNewFilename(const QString & suffix = "", const QString & ext = "etx");
bool convertStorage(Board::Type from, Board::Type to, bool newFile = false);
void showWarning(const QString & msg);
int askQuestion(const QString & msg, QMessageBox::StandardButtons buttons = (QMessageBox::Yes | QMessageBox::No), QMessageBox::StandardButton defaultButton = QMessageBox::No);
@@ -120,7 +120,7 @@ QString SimulatorStartupDialog::radioEepromFileName(const QString & firmwareId,
if (pos > 0)
radioId = radioId.mid(pos+1);
if (usesCategorizedStorage(radioId))
ext = "otx";
ext = "etx";
eepromFileName = QString("eeprom-%1.%2").arg(radioId, ext);
eepromFileName = QDir(folder).filePath(eepromFileName.toLatin1());
+5 -5
View File
@@ -249,9 +249,9 @@ bool SimulatorWidget::setStartupData(const QByteArray & dataSource, bool fromFil
error = store.error();
}
else {
if (fileName.endsWith(".otx", Qt::CaseInsensitive)) {
// no radios can work with .otx files directly, so we load contents into either
// a temporary folder (Horus) or local data array (other radios) which we'll save back to .otx upon exit
if (fileName.endsWith(".etx", Qt::CaseInsensitive)) {
// no radios can work with .etx files directly, so we load contents into either
// a temporary folder (Horus) or local data array (other radios) which we'll save back to .etx upon exit
if ((ret = setRadioData(&simuData))) {
startupFromFile = false;
return true;
@@ -365,7 +365,7 @@ bool SimulatorWidget::useTempDataPath(bool deleteOnClose)
if (deleteTempRadioData)
deleteTempData();
QTemporaryDir tmpDir(QDir::tempPath() + "/otx-XXXXXX");
QTemporaryDir tmpDir(QDir::tempPath() + "/etx-XXXXXX");
if (tmpDir.isValid()) {
setDataPath(tmpDir.path());
tmpDir.setAutoRemove(false);
@@ -379,7 +379,7 @@ bool SimulatorWidget::useTempDataPath(bool deleteOnClose)
}
}
// This will save radio data from temporary folder structure back into an .otx file, eg. for Horus.
// This will save radio data from temporary folder structure back into an .etx file, eg. for Horus.
bool SimulatorWidget::saveTempData()
{
bool ret = false;
+1 -1
View File
@@ -127,7 +127,7 @@ CommandLineParseResult cliOptions(SimulatorOptions * simOptions, int * profileId
QApplication::translate("SimulatorMain", "type"));
cliOptions.addPositionalArgument(QApplication::translate("SimulatorMain", "data-source"),
QApplication::translate("SimulatorMain", "Radio data (.bin/.eeprom/.otx) image file to use OR data folder path (for Horus-style radios).\n"
QApplication::translate("SimulatorMain", "Radio data (.bin/.eeprom/.etx) image file to use OR data folder path (for Horus-style radios).\n"
"NOTE: any existing EEPROM data incompatible with the selected radio type may be overwritten!"),
QApplication::translate("SimulatorMain", "[data-source]"));
+1 -1
View File
@@ -12,7 +12,7 @@ set(storage_NAMES
hexeeprom
categorized
sdcard
otx
etx
yaml
)
@@ -18,13 +18,13 @@
* GNU General Public License for more details.
*/
#include "otx.h"
#include "etx.h"
#include "miniz.c"
#include <QFile>
#define MZ_ALLOCATION_SIZE (32*1024)
bool OtxFormat::load(RadioData & radioData)
bool EtxFormat::load(RadioData & radioData)
{
QFile file(filename);
@@ -40,7 +40,7 @@ bool OtxFormat::load(RadioData & radioData)
// open zip file
memset(&zip_archive, 0, sizeof(zip_archive));
if (!mz_zip_reader_init_mem(&zip_archive, archiveContents.data(), archiveContents.size(), 0)) {
qDebug() << tr("Error opening OTX archive %1").arg(filename);
qDebug() << tr("Error opening ETX archive %1").arg(filename);
return false;
}
@@ -49,13 +49,13 @@ bool OtxFormat::load(RadioData & radioData)
return result;
}
bool OtxFormat::write(const RadioData & radioData)
bool EtxFormat::write(const RadioData & radioData)
{
qDebug() << "Saving to archive" << filename;
memset(&zip_archive, 0, sizeof(zip_archive));
if (!mz_zip_writer_init_heap(&zip_archive, 0, MZ_ALLOCATION_SIZE)) {
setError(tr("Error initializing OTX archive writer"));
setError(tr("Error initializing ETX archive writer"));
return false;
}
@@ -76,12 +76,12 @@ bool OtxFormat::write(const RadioData & radioData)
}
}
else {
setError(tr("Error creating OTX file %1:\n%2.").arg(filename).arg(file.errorString()));
setError(tr("Error creating ETX file %1:\n%2.").arg(filename).arg(file.errorString()));
result = false;
}
}
else {
setError(tr("Error creating OTX archive"));
setError(tr("Error creating ETX archive"));
result = false;
}
}
@@ -90,7 +90,7 @@ bool OtxFormat::write(const RadioData & radioData)
return result;
}
bool OtxFormat::loadFile(QByteArray & filedata, const QString & filename)
bool EtxFormat::loadFile(QByteArray & filedata, const QString & filename)
{
size_t size;
void * data = mz_zip_reader_extract_file_to_heap(&zip_archive, qPrintable(filename), &size, 0);
@@ -105,10 +105,10 @@ bool OtxFormat::loadFile(QByteArray & filedata, const QString & filename)
return true;
}
bool OtxFormat::writeFile(const QByteArray & filedata, const QString & filename)
bool EtxFormat::writeFile(const QByteArray & filedata, const QString & filename)
{
if (!mz_zip_writer_add_mem(&zip_archive, filename.toStdString().c_str(), filedata.data(), filedata.size(), MZ_DEFAULT_LEVEL)) {
setError(tr("Error adding %1 to OTX archive").arg(filename));
setError(tr("Error adding %1 to ETX archive").arg(filename));
return false;
}
@@ -18,8 +18,8 @@
* GNU General Public License for more details.
*/
#ifndef _OTX_H_
#define _OTX_H_
#ifndef _ETX_H_
#define _ETX_H_
#include "categorized.h"
@@ -29,17 +29,17 @@
#include "miniz.c"
#undef MINIZ_HEADER_FILE_ONLY
class OtxFormat : public CategorizedStorageFormat
class EtxFormat : public CategorizedStorageFormat
{
Q_DECLARE_TR_FUNCTIONS(OtxFormat)
Q_DECLARE_TR_FUNCTIONS(EtxFormat)
public:
OtxFormat(const QString & filename):
EtxFormat(const QString & filename):
CategorizedStorageFormat(filename)
{
}
virtual QString name() { return "otx"; }
virtual QString name() { return "etx"; }
virtual bool load(RadioData & radioData);
virtual bool write(const RadioData & radioData);
@@ -50,4 +50,4 @@ class OtxFormat : public CategorizedStorageFormat
mz_zip_archive zip_archive;
};
#endif // _OTX_H_
#endif // _ETX_H_
+7 -7
View File
@@ -305,11 +305,11 @@ bool FirmwareInterface::seekSplash(QByteArray sps, QByteArray spe, int size)
return false;
}
#define OTX_SPS_9X "SPS\0\200\100"
#define OTX_SPS_TARANIS "SPS\0\324\100"
#define OTX_SPS_SIZE 6
#define OTX_SPE "SPE"
#define OTX_SPE_SIZE 4
#define ETX_SPS_9X "SPS\0\200\100"
#define ETX_SPS_TARANIS "SPS\0\324\100"
#define ETX_SPS_SIZE 6
#define ETX_SPE "SPE"
#define ETX_SPE_SIZE 4
void FirmwareInterface::seekSplash()
{
@@ -342,11 +342,11 @@ void FirmwareInterface::seekSplash()
return;
}
if (seekSplash(QByteArray(OTX_SPS_9X, OTX_SPS_SIZE), QByteArray(OTX_SPE, OTX_SPE_SIZE), 1024)) {
if (seekSplash(QByteArray(ETX_SPS_9X, ETX_SPS_SIZE), QByteArray(ETX_SPE, ETX_SPE_SIZE), 1024)) {
return;
}
if (seekSplash(QByteArray(OTX_SPS_TARANIS, OTX_SPS_SIZE), QByteArray(OTX_SPE, OTX_SPE_SIZE), RLE_SPLASH_MAX_SIZE)) {
if (seekSplash(QByteArray(ETX_SPS_TARANIS, ETX_SPS_SIZE), QByteArray(ETX_SPE, ETX_SPE_SIZE), RLE_SPLASH_MAX_SIZE)) {
splashWidth = SPLASHX9D_WIDTH;
splashHeight = SPLASHX9D_HEIGHT;
splash_format = QImage::Format_Indexed8;
+4 -2
View File
@@ -20,7 +20,7 @@
#include "bineeprom.h"
#include "eepe.h"
#include "otx.h"
#include "etx.h"
#include "sdcard.h"
#include "yaml.h"
#include "firmwareinterface.h"
@@ -42,6 +42,8 @@ StorageType getStorageType(const QString & filename)
return STORAGE_TYPE_XML;
else if (suffix == "OTX")
return STORAGE_TYPE_OTX;
else if (suffix == "ETX")
return STORAGE_TYPE_ETX;
else if (suffix == "YML")
return STORAGE_TYPE_YML;
else
@@ -63,7 +65,7 @@ void registerStorageFactories()
registerStorageFactory(new DefaultStorageFactory<BinEepromFormat>("bin"));
registerStorageFactory(new DefaultStorageFactory<EepeFormat>("eepe"));
registerStorageFactory(new DefaultStorageFactory<HexEepromFormat>("hex"));
registerStorageFactory(new DefaultStorageFactory<OtxFormat>("otx"));
registerStorageFactory(new DefaultStorageFactory<EtxFormat>("etx"));
registerStorageFactory(new DefaultStorageFactory<YamlFormat>("yml"));
registerStorageFactory(new SdcardStorageFactory());
}
+2 -1
View File
@@ -37,7 +37,8 @@ enum StorageType
STORAGE_TYPE_XML,
STORAGE_TYPE_SDCARD,
STORAGE_TYPE_OTX,
STORAGE_TYPE_YML
STORAGE_TYPE_YML,
STORAGE_TYPE_ETX
};
StorageType getStorageType(const QString & filename);
+11 -11
View File
@@ -1,6 +1,6 @@
#include "gtests.h"
#include "location.h"
#include "storage/otx.h"
#include "storage/etx.h"
#include "storage/storage.h"
#include "firmwares/opentx/opentxinterface.h"
#include "firmwares/customfunctiondata.h"
@@ -210,12 +210,12 @@ TEST(Conversions, ConversionX10From22)
{
QByteArray byteBuffer;
#define USE_OTX
#define USE_ETX
#if defined(USE_OTX)
OtxFormat otx(RADIO_TESTS_PATH "/model_22_x10.otx");
#if defined(USE_ETX)
EtxFormat etx(RADIO_TESTS_PATH "/model_22_x10.etx");
RadioData radio;
EXPECT_EQ(true, otx.load(radio));
EXPECT_EQ(true, etx.load(radio));
const GeneralSettings& settings = radio.generalSettings;
const ModelData& model = radio.models[0];
@@ -253,7 +253,7 @@ TEST(Conversions, ConversionX10From22)
EXPECT_STREQ("BT_X10", settings.bluetoothName);
EXPECT_STREQ("EdgeTX", settings.themeData.themeName);
#if !defined(USE_OTX)
#if !defined(USE_ETX)
byteBuffer.clear();
ASSERT_EQ(true, loadFile(byteBuffer, RADIO_TESTS_PATH "/model_22_x10/MODELS/model1.bin"));
@@ -295,12 +295,12 @@ TEST(Conversions, ConversionX12SFrom22)
{
QByteArray byteBuffer;
#define USE_OTX
#define USE_ETX
#if defined(USE_OTX)
OtxFormat otx(RADIO_TESTS_PATH "/model_22_x12s.otx");
#if defined(USE_ETX)
EtxFormat etx(RADIO_TESTS_PATH "/model_22_x12s.etx");
RadioData radio;
EXPECT_EQ(true, otx.load(radio));
EXPECT_EQ(true, etx.load(radio));
const GeneralSettings& settings = radio.generalSettings;
const ModelData& model = radio.models[0];
@@ -330,7 +330,7 @@ TEST(Conversions, ConversionX12SFrom22)
EXPECT_STREQ("BT", settings.bluetoothName);
EXPECT_STREQ("EdgeTX", settings.themeData.themeName);
#if !defined(USE_OTX)
#if !defined(USE_ETX)
byteBuffer.clear();
ASSERT_EQ(true, loadFile(byteBuffer, RADIO_TESTS_PATH "/model_22_x10/MODELS/model1.bin"));
+1 -1
View File
@@ -1507,7 +1507,7 @@ then the loaded script (or "chunk") is returned as a function. Otherwise, return
as part of the file name and the .lua/.luac will be appended to that.
@param mode (string) (optional) Controls whether to force loading the text (.lua) or pre-compiled binary (.luac)
version of the script. By default OTx will load the newest version and compile a new binary if necessary (overwriting any
version of the script. By default ETX will load the newest version and compile a new binary if necessary (overwriting any
existing .luac version of the same script, and stripping some debug info like line numbers).
You can use `mode` to control the loading behavior more specifically. Possible values are:
* `b` only binary.
+3 -3
View File
@@ -158,7 +158,7 @@ static int luaModelGetModule(lua_State *L)
if (module.type == MODULE_TYPE_MULTIMODULE) {
int protocol = g_model.moduleData[idx].getMultiProtocol() + 1;
int subprotocol = g_model.moduleData[idx].subType;
convertOtxProtocolToMulti(&protocol, &subprotocol); // Special treatment for the FrSky entry...
convertEtxProtocolToMulti(&protocol, &subprotocol); // Special treatment for the FrSky entry...
lua_pushtableinteger(L, "protocol", protocol);
lua_pushtableinteger(L, "subProtocol", subprotocol);
if (getMultiModuleStatus(idx).isValid()) {
@@ -231,8 +231,8 @@ static int luaModelSetModule(lua_State *L)
#endif
}
#if defined(MULTIMODULE)
if (protocol > 0 && subprotocol >= 0) { // Both are needed to compute otx protocol
convertMultiProtocolToOtx(&protocol, &subprotocol);
if (protocol > 0 && subprotocol >= 0) { // Both are needed to compute etx protocol
convertMultiProtocolToEtx(&protocol, &subprotocol);
g_model.moduleData[idx].setMultiProtocol(protocol - 1);
g_model.moduleData[idx].subType = subprotocol;
}
+4 -4
View File
@@ -53,7 +53,7 @@ static void sendDSM(uint8_t moduleIdx);
void multiPatchCustom(uint8_t moduleIdx)
{
if (g_model.moduleData[moduleIdx].multi.customProto) {
uint8_t type = g_model.moduleData[moduleIdx].getMultiProtocol() - 1; // custom where starting at 1, otx list at 0
uint8_t type = g_model.moduleData[moduleIdx].getMultiProtocol() - 1; // custom where starting at 1, etx list at 0
int subtype = g_model.moduleData[moduleIdx].subType;
g_model.moduleData[moduleIdx].multi.customProto = 0;
@@ -268,7 +268,7 @@ void sendChannels(uint8_t moduleIdx)
}
}
void convertMultiProtocolToOtx(int *protocol, int *subprotocol)
void convertMultiProtocolToEtx(int *protocol, int *subprotocol)
{
if (*protocol == 3 && *subprotocol == 0) {
*protocol = MODULE_SUBTYPE_MULTI_FRSKY + 1;
@@ -312,7 +312,7 @@ void convertMultiProtocolToOtx(int *protocol, int *subprotocol)
*protocol -= 1;
}
void convertOtxProtocolToMulti(int *protocol, int *subprotocol)
void convertEtxProtocolToMulti(int *protocol, int *subprotocol)
{
// Special treatment for the FrSky entry...
if (*protocol == MODULE_SUBTYPE_MULTI_FRSKY + 1) {
@@ -407,7 +407,7 @@ void sendFrameProtocolHeader(uint8_t moduleIdx, bool failsafe)
}
// Special treatment for the FrSky entry...
convertOtxProtocolToMulti(&type, &subtype);
convertEtxProtocolToMulti(&type, &subtype);
// Set the highest bit of option byte in AFHDS2A protocol to instruct MULTI to passthrough telemetry bytes instead
// of sending Frsky D telemetry
+2 -2
View File
@@ -25,8 +25,8 @@
#include "pulses_common.h"
void multiPatchCustom(uint8_t moduleIdx);
void convertOtxProtocolToMulti(int *protocol, int *subprotocol);
void convertMultiProtocolToOtx(int *protocol, int *subprotocol);
void convertEtxProtocolToMulti(int *protocol, int *subprotocol);
void convertMultiProtocolToEtx(int *protocol, int *subprotocol);
class UartMultiPulses: public DataBuffer<uint8_t, 64>
{
+20 -20
View File
@@ -133,45 +133,45 @@ inline const char * SDCARD_ERROR(FRESULT result)
const char * getBasename(const char * path);
#if defined(PCBX12S)
#define OTX_FOURCC 0x3478746F // otx for X12S
#define ETX_FOURCC 0x3478746F // etx for X12S
#elif defined(RADIO_T16)
#define OTX_FOURCC 0x3F78746F // otx for Jumper T16
#define ETX_FOURCC 0x3F78746F // etx for Jumper T16
#elif defined(RADIO_T18)
#define OTX_FOURCC 0x4078746F // otx for Jumper T18
#define ETX_FOURCC 0x4078746F // etx for Jumper T18
#elif defined(RADIO_TX16S)
#define OTX_FOURCC 0x3878746F // otx for Radiomaster TX16S
#define ETX_FOURCC 0x3878746F // etx for Radiomaster TX16S
#elif defined(PCBX10)
#define OTX_FOURCC 0x3778746F // otx for X10
#define ETX_FOURCC 0x3778746F // etx for X10
#elif defined(PCBX9E)
#define OTX_FOURCC 0x3578746F // otx for Taranis X9E
#define ETX_FOURCC 0x3578746F // etx for Taranis X9E
#elif defined(PCBXLITES)
#define OTX_FOURCC 0x3B78746F // otx for Taranis X-Lite S
#define ETX_FOURCC 0x3B78746F // etx for Taranis X-Lite S
#elif defined(PCBXLITE)
#define OTX_FOURCC 0x3978746F // otx for Taranis X-Lite
#define ETX_FOURCC 0x3978746F // etx for Taranis X-Lite
#elif defined(RADIO_T12)
#define OTX_FOURCC 0x3D78746F // otx for Jumper T12
#define ETX_FOURCC 0x3D78746F // etx for Jumper T12
#elif defined(RADIO_TLITE)
#define OTX_FOURCC 0x4278746F // otx for Jumper TLite
#define ETX_FOURCC 0x4278746F // etx for Jumper TLite
#elif defined(RADIO_TPRO)
#define OTX_FOURCC 0x4678746F // otx for Jumper TPro
#define ETX_FOURCC 0x4678746F // etx for Jumper TPro
#elif defined(RADIO_TX12)
#define OTX_FOURCC 0x4178746F // otx for Radiomaster TX12
#define ETX_FOURCC 0x4178746F // etx for Radiomaster TX12
#elif defined(RADIO_ZORRO)
#define OTX_FOURCC 0x4778746F // otx for Radiomaster Zorro
#define ETX_FOURCC 0x4778746F // otx for Radiomaster Zorro
#elif defined(RADIO_T8)
#define OTX_FOURCC 0x4378746F // otx for Radiomaster T8
#define ETX_FOURCC 0x4378746F // etx for Radiomaster T8
#elif defined(PCBX7)
#define OTX_FOURCC 0x3678746F // otx for Taranis X7 / X7S / X7 Express / X7S Express
#define ETX_FOURCC 0x3678746F // etx for Taranis X7 / X7S / X7 Express / X7S Express
#elif defined(PCBX9LITES)
#define OTX_FOURCC 0x3E78746F // otx for Taranis X9-Lite S
#define ETX_FOURCC 0x3E78746F // etx for Taranis X9-Lite S
#elif defined(PCBX9LITE)
#define OTX_FOURCC 0x3C78746F // otx for Taranis X9-Lite
#define ETX_FOURCC 0x3C78746F // etx for Taranis X9-Lite
#elif defined(PCBX9D) || defined(PCBX9DP)
#define OTX_FOURCC 0x3378746F // otx for Taranis X9D
#define ETX_FOURCC 0x3378746F // etx for Taranis X9D
#elif defined(PCBNV14)
#define OTX_FOURCC 0x3A78746F // otx for NV14
#define ETX_FOURCC 0x3A78746F // etx for NV14
#elif defined(PCBSKY9X)
#define OTX_FOURCC 0x3278746F // otx for sky9x
#define ETX_FOURCC 0x3278746F // etx for sky9x
#endif
bool isFileAvailable(const char * filename, bool exclDir = false);
@@ -1132,7 +1132,7 @@ bool w_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
// data as-is (no FrSky special casing)
int type = md->getMultiProtocol() + 1;
int subtype = val;
convertOtxProtocolToMulti(&type, &subtype);
convertEtxProtocolToMulti(&type, &subtype);
// output "[type],[subtype]"
str = yaml_unsigned2str(type);
+2 -2
View File
@@ -473,7 +473,7 @@ const char * eeBackupModel(uint8_t i_fileSrc)
uint16_t size = eeModelSize(i_fileSrc);
*(uint32_t*)&buf[0] = OTX_FOURCC;
*(uint32_t*)&buf[0] = ETX_FOURCC;
buf[4] = g_eeGeneral.version;
buf[5] = 'M';
*(uint16_t*)&buf[6] = size;
@@ -540,7 +540,7 @@ const char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
}
uint8_t version = (uint8_t)buf[4];
if (*(uint32_t*)&buf[0] != OTX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
if (*(uint32_t*)&buf[0] != ETX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
f_close(&restoreFile);
return STR_INCOMPATIBLE;
}
+2 -2
View File
@@ -508,7 +508,7 @@ const char * eeBackupModel(uint8_t i_fileSrc)
EFile theFile2;
theFile2.openRd(FILE_MODEL(i_fileSrc));
*(uint32_t*)&buf[0] = OTX_FOURCC;
*(uint32_t*)&buf[0] = ETX_FOURCC;
buf[4] = g_eeGeneral.version;
buf[5] = 'M';
*(uint16_t*)&buf[6] = eeModelSize(i_fileSrc);
@@ -561,7 +561,7 @@ const char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
}
uint8_t version = (uint8_t)buf[4];
if (*(uint32_t*)&buf[0] != OTX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
if (*(uint32_t*)&buf[0] != ETX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
f_close(&g_oLogFile);
return STR_INCOMPATIBLE;
}
+2 -2
View File
@@ -37,7 +37,7 @@ const char *writeFileBin(const char *filename, const uint8_t *data,
return SDCARD_ERROR(result);
}
*(uint32_t*)&buf[0] = OTX_FOURCC;
*(uint32_t*)&buf[0] = ETX_FOURCC;
buf[4] = version;
buf[5] = 'M';
*(uint16_t*)&buf[6] = size;
@@ -99,7 +99,7 @@ const char* openFileBin(const char * fullpath, FIL * file, uint16_t * size, uint
}
*version = (uint8_t)buf[4];
if (*(uint32_t *)&buf[0] != OTX_FOURCC || *version < FIRST_CONV_EEPROM_VER ||
if (*(uint32_t *)&buf[0] != ETX_FOURCC || *version < FIRST_CONV_EEPROM_VER ||
*version > EEPROM_VER || buf[5] != 'M') {
f_close(file);
return STR_INCOMPATIBLE;
@@ -1646,8 +1646,8 @@ static void r_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
val++; val_len--;
int subtype = yaml_str2uint(val, val_len);
// convert to OTX format and write to vars
convertMultiProtocolToOtx(&type, &subtype);
// convert to ETX format and write to vars
convertMultiProtocolToEtx(&type, &subtype);
if (type > 0) {
md->setMultiProtocol(type - 1);
md->subType = subtype;
+5 -5
View File
@@ -32,7 +32,7 @@
#define GET_SWITCH_BOOL(sw__) getSwitch((sw__), 0);
#define OTXS_DBG qDebug() << "(" << simuTimerMicros() << "us)"
#define ETXS_DBG qDebug() << "(" << simuTimerMicros() << "us)"
int16_t g_anas[Analogs::NUM_ANALOGS];
QVector<QIODevice *> OpenTxSimulator::tracebackDevices;
@@ -106,7 +106,7 @@ void OpenTxSimulator::init()
if (isRunning())
return;
OTXS_DBG;
ETXS_DBG;
if (!m_timer10ms) {
// make sure we create & control the timer from current thread
@@ -134,7 +134,7 @@ void OpenTxSimulator::start(const char * filename, bool tests)
{
if (isRunning())
return;
OTXS_DBG << "file:" << filename << "tests:" << tests;
ETXS_DBG << "file:" << filename << "tests:" << tests;
QMutexLocker lckr(&m_mtxSimuMain);
QMutexLocker slckr(&m_mtxSettings);
@@ -150,7 +150,7 @@ void OpenTxSimulator::stop()
{
if (!isRunning())
return;
OTXS_DBG;
ETXS_DBG;
setStopRequested(true);
@@ -380,7 +380,7 @@ void OpenTxSimulator::setTrainerTimeout(uint16_t ms)
void OpenTxSimulator::sendTelemetry(const QByteArray data)
{
//OTXS_DBG << data;
//ETXS_DBG << data;
sportProcessTelemetryPacket((uint8_t *)data.constData());
}
+2 -2
View File
@@ -19,9 +19,9 @@ if(GTEST_INCDIR AND GTEST_SRCDIR AND Qt5Widgets_FOUND)
foreach(model_file ${EXTRACT_MODEL_FILES})
add_custom_command(
DEPENDS ${TESTS_PATH}/${model_file}.otx
DEPENDS ${TESTS_PATH}/${model_file}.etx
OUTPUT ${TESTS_BUILD_PATH}/${model_file}/RADIO/radio.bin
COMMAND mkdir -p ${model_file} && cd ${model_file} && unzip -o -q -DD ${TESTS_PATH}/${model_file}.otx >/dev/null
COMMAND mkdir -p ${model_file} && cd ${model_file} && unzip -o -q -DD ${TESTS_PATH}/${model_file}.etx >/dev/null
WORKING_DIRECTORY ${TESTS_BUILD_PATH}
)
add_custom_target(${model_file}_files