Use ETX instead of OTX (also as a file extension).
This commit is contained in:
committed by
Raphael Coeffic
parent
20961e460b
commit
89517d8bd8
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user