Merge with latest 2.3
This commit is contained in:
+18
@@ -29,6 +29,7 @@ Michael Byrne
|
||||
<a href="https://www.frsky-rc.com">FrSky (monthly)</a>
|
||||
<a href="https://www.flysky-cn.com/home">FlySky (monthly)</a>
|
||||
<a href="https://www.jumper-rc.com">JumperRC (monthly)</a>
|
||||
<a href="https://www.radiomasterrc.com">RadioMaster (monthly)</a>
|
||||
<a href="https://alofthobbies.com">Aloft Hobbies</a>
|
||||
<a href="https://jonathan.it">Jonathan Modellismo</a>
|
||||
<a href="http://wstech.de">WsTech</a>
|
||||
@@ -1667,3 +1668,20 @@ James Snodgrass
|
||||
Peter Schneider
|
||||
Norman Schenck
|
||||
Boris Hemmer
|
||||
Gilles Arbona
|
||||
Patrice Germain
|
||||
Mart Rogers
|
||||
Stefan Möst
|
||||
John Beech
|
||||
John Rodgers
|
||||
Stanton Sweet
|
||||
Peter Suphan
|
||||
FGS
|
||||
Outward Ideas
|
||||
Sylvie Le Madec
|
||||
James Houck (monthly)
|
||||
Frank Steinmetz
|
||||
Gary Garland
|
||||
Stefano Boggia
|
||||
Jean-Jacques Pointel
|
||||
Ferenc Kunkli
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## OpenTX 2.3 Branch
|
||||
|
||||
[](https://travis-ci.org/opentx/opentx)
|
||||
[](https://chat.open-tx.org)
|
||||
[](https://discord.gg/pAmmCp2)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DJ9MASSKVW8WN)
|
||||
|
||||
The ongoing development on 2.3.x is done in this branch.
|
||||
|
||||
@@ -329,8 +329,10 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
case Switches:
|
||||
if (IS_TARANIS_X9E(board))
|
||||
return 18;
|
||||
else if (IS_TARANIS_X9LITE(board))
|
||||
else if (board == Board::BOARD_TARANIS_X9LITE)
|
||||
return 5;
|
||||
else if (board == Board::BOARD_TARANIS_X9LITES)
|
||||
return 7;
|
||||
else if (IS_TARANIS_X7(board))
|
||||
return 8;
|
||||
else if (IS_JUMPER_T12(board))
|
||||
@@ -455,8 +457,8 @@ QString Boards::getAnalogInputName(Board::Type board, int index)
|
||||
"S1",
|
||||
"6P",
|
||||
"S2",
|
||||
"S3",
|
||||
"S4",
|
||||
"L1",
|
||||
"L2",
|
||||
"LS",
|
||||
"RS",
|
||||
"JSx",
|
||||
|
||||
@@ -255,6 +255,11 @@ inline bool IS_TARANIS_X9LITE(Board::Type board)
|
||||
return board == Board::BOARD_TARANIS_X9LITE || board == Board::BOARD_TARANIS_X9LITES;
|
||||
}
|
||||
|
||||
inline bool IS_TARANIS_X9LITES(Board::Type board)
|
||||
{
|
||||
return board == Board::BOARD_TARANIS_X9LITES;
|
||||
}
|
||||
|
||||
inline bool IS_TARANIS_X9(Board::Type board)
|
||||
{
|
||||
return board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9DP_2019 || board==Board::BOARD_TARANIS_X9E;
|
||||
|
||||
@@ -55,6 +55,8 @@ QString CustomFunctionData::funcToString(const ModelData * model) const
|
||||
return tr("Trainer THR");
|
||||
else if (func == FuncTrainerAIL)
|
||||
return tr("Trainer AIL");
|
||||
else if (func == FuncTrainerChannels)
|
||||
return tr("Trainer Channels");
|
||||
else if (func == FuncInstantTrim)
|
||||
return tr("Instant Trim");
|
||||
else if (func == FuncPlaySound)
|
||||
|
||||
@@ -41,6 +41,7 @@ enum AssignFunc {
|
||||
FuncTrainerELE,
|
||||
FuncTrainerTHR,
|
||||
FuncTrainerAIL,
|
||||
FuncTrainerChannels,
|
||||
FuncInstantTrim,
|
||||
FuncPlaySound,
|
||||
FuncPlayHaptic,
|
||||
|
||||
@@ -117,7 +117,9 @@ enum MultiModuleRFProtocols {
|
||||
MODULE_SUBTYPE_MULTI_SCANNER,
|
||||
MODULE_SUBTYPE_MULTI_FRSKYX_RX,
|
||||
MODULE_SUBTYPE_MULTI_AFHDS2A_RX,
|
||||
MODULE_SUBTYPE_MULTI_LAST = MODULE_SUBTYPE_MULTI_AFHDS2A_RX
|
||||
MODULE_SUBTYPE_MULTI_HOTT,
|
||||
MODULE_SUBTYPE_MULTI_FX816,
|
||||
MODULE_SUBTYPE_MULTI_LAST = MODULE_SUBTYPE_MULTI_FX816
|
||||
};
|
||||
|
||||
enum TrainerProtocol {
|
||||
|
||||
@@ -72,6 +72,8 @@ static const QStringList STR_SUBTYPE_POTENSIC {"A20 Firefly"};
|
||||
static const QStringList STR_SUBTYPE_ZSX {"JJRC ZSX-280"};
|
||||
static const QStringList STR_SUBTYPE_FLYZONE {"FZ-410 TX"};
|
||||
static const QStringList STR_SUBTYPE_FRSKYX_RX {"D16 FCC", "D16 LBT"};
|
||||
static const QStringList STR_SUBTYPE_FX816 {"P38"};
|
||||
static const QStringList STR_SUBTYPE_ESKY150 {"4CH", "7CH"};
|
||||
|
||||
static const QStringList NO_SUBTYPE {STR_MULTI_DEFAULT};
|
||||
|
||||
@@ -118,6 +120,11 @@ const Multiprotocols multiProtocols {
|
||||
{MODULE_SUBTYPE_MULTI_ZSX, 0, false, STR_SUBTYPE_ZSX, nullptr},
|
||||
{MODULE_SUBTYPE_MULTI_FLYZONE, 0, false, STR_SUBTYPE_FLYZONE, nullptr},
|
||||
{MODULE_SUBTYPE_MULTI_FRSKYX_RX, 1, false, STR_SUBTYPE_FRSKYX_RX, STR_MULTI_RFTUNE},
|
||||
{MODULE_SUBTYPE_MULTI_ESky, 0, false, NO_SUBTYPE, nullptr},
|
||||
{MODULE_SUBTYPE_MULTI_J6PRO, 0, false, NO_SUBTYPE, nullptr},
|
||||
{MODULE_SUBTYPE_MULTI_ESKY150, 1, false, STR_SUBTYPE_ESKY150, nullptr},
|
||||
{MODULE_SUBTYPE_MULTI_FX816, 0, false, STR_SUBTYPE_FX816, nullptr},
|
||||
{MODULE_SUBTYPE_MULTI_HOTT, 0, true, NO_SUBTYPE, STR_MULTI_RFTUNE},
|
||||
{MM_RF_CUSTOM_SELECTED, 7, true, STR_SUBTYPE_CUSTOM, STR_MULTI_OPTION},
|
||||
|
||||
// Sentinel and default for protocols not listed above (MM_RF_CUSTOM is 0xff)
|
||||
@@ -160,7 +167,7 @@ QString Multiprotocols::protocolToString(int protocol, bool custom)
|
||||
"Bayang", "ESky", "MT99XX", "MJXQ", "Shenqi", "FY326", "SFHSS", "J6 PRO","FQ777","Assan","Hontai","Open LRS",
|
||||
"FlySky AFHDS2A", "Q2x2", "Walkera", "Q303", "GW008", "DM002", "Cabell", "ESky 150", "H8 3D", "Corona", "CFlie",
|
||||
"Hitec", "Wfly", "Bugs", "Bugs Mini", "Traxxas", "NCC-1701-A", "E01X", "WL Heli V911S", "GD00X", "Volantex V761",
|
||||
"KFPlan KF606", "Redpine", "Potensic", "ZXS", "FlyZone", "Scanner", "FrSky RX", "FlySky AFHDS2A RX"
|
||||
"KFPlan KF606", "Redpine", "Potensic", "ZXS", "FlyZone", "Scanner", "FrSky RX", "FlySky AFHDS2A RX", "HoTT", "Fx816"
|
||||
});
|
||||
|
||||
if (protocol == MM_RF_CUSTOM_SELECTED || custom)
|
||||
|
||||
@@ -1392,6 +1392,7 @@ class CustomFunctionsConversionTable: public ConversionTable {
|
||||
addConversion(FuncTrainerELE, val);
|
||||
addConversion(FuncTrainerTHR, val);
|
||||
addConversion(FuncTrainerAIL, val);
|
||||
addConversion(FuncTrainerChannels, val);
|
||||
val++;
|
||||
|
||||
addConversion(FuncInstantTrim, val++);
|
||||
@@ -1512,7 +1513,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
*((uint16_t *)_param) = fn.param;
|
||||
*((uint8_t *)(_param+3)) = fn.func - FuncOverrideCH1;
|
||||
}
|
||||
else if (fn.func >= FuncTrainer && fn.func <= FuncTrainerAIL) {
|
||||
else if (fn.func >= FuncTrainer && fn.func <= FuncTrainerChannels) {
|
||||
*((uint8_t *)(_param+3)) = fn.func - FuncTrainer;
|
||||
}
|
||||
else if (fn.func >= FuncSetTimer1 && fn.func <= FuncSetTimer3) {
|
||||
@@ -1579,7 +1580,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
fn.func = AssignFunc(fn.func + index);
|
||||
fn.param = (int)value;
|
||||
}
|
||||
else if (fn.func >= FuncTrainer && fn.func <= FuncTrainerAIL) {
|
||||
else if (fn.func >= FuncTrainer && fn.func <= FuncTrainerChannels) {
|
||||
fn.func = AssignFunc(fn.func + index);
|
||||
fn.param = value;
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
|
||||
#define GVARS_VARIANT 0x0001
|
||||
#define FRSKY_VARIANT 0x0002
|
||||
#define MAVLINK_VARIANT 0x0008
|
||||
#define M128_VARIANT 0x8000
|
||||
#define TARANIS_X9E_VARIANT 0x8000
|
||||
#define TARANIS_X7_VARIANT 0x4000
|
||||
#define TARANIS_XLITE_VARIANT 0x2000
|
||||
#define TARANIS_XLITES_VARIANT 0x1000
|
||||
#define TARANIS_X9LITE_VARIANT 0x0800
|
||||
#define TARANIS_X9LITES_VARIANT 0x0801
|
||||
#define JUMPER_T12_VARIANT 0x4001
|
||||
|
||||
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
|
||||
|
||||
@@ -329,6 +329,9 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
|
||||
else if (IS_TARANIS_X9E(board)) {
|
||||
variant |= TARANIS_X9E_VARIANT;
|
||||
}
|
||||
else if (IS_TARANIS_X9LITES(board)) {
|
||||
variant |= TARANIS_X9LITES_VARIANT;
|
||||
}
|
||||
else if (IS_TARANIS_X9LITE(board)) {
|
||||
variant |= TARANIS_X9LITE_VARIANT;
|
||||
}
|
||||
@@ -718,6 +721,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
return SIMU_M128_VARIANTS;
|
||||
else if (IS_TARANIS_X9E(board))
|
||||
return TARANIS_X9E_VARIANT;
|
||||
else if (IS_TARANIS_X9LITES(board))
|
||||
return TARANIS_X9LITES_VARIANT;
|
||||
else if (IS_TARANIS_X9LITE(board))
|
||||
return TARANIS_X9LITE_VARIANT;
|
||||
else if (IS_TARANIS_X7(board))
|
||||
@@ -991,6 +996,11 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
|
||||
variantError = true;
|
||||
}
|
||||
}
|
||||
else if (IS_TARANIS_X9LITES(board)) {
|
||||
if (variant != TARANIS_X9LITES_VARIANT) {
|
||||
variantError = true;
|
||||
}
|
||||
}
|
||||
else if (IS_TARANIS_X9LITE(board)) {
|
||||
if (variant != TARANIS_X9LITE_VARIANT) {
|
||||
variantError = true;
|
||||
|
||||
@@ -750,11 +750,11 @@ void GeneralSetupPanel::on_blAlarm_ChkB_stateChanged()
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_ownerID_editingFinished()
|
||||
void GeneralSetupPanel::on_registrationId_editingFinished()
|
||||
{
|
||||
//copy ownerID back to generalSettings.registrationId
|
||||
QByteArray array = ui->registrationId->text().toLocal8Bit();
|
||||
strncpy(generalSettings.registrationId, "pafleraf", 9);
|
||||
strncpy(generalSettings.registrationId, array, 8);
|
||||
generalSettings.registrationId[8] = '\0';
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class GeneralSetupPanel : public GeneralPanel
|
||||
void on_vBatMinDSB_editingFinished();
|
||||
void on_vBatMaxDSB_editingFinished();
|
||||
void on_contrastSB_editingFinished();
|
||||
void on_ownerID_editingFinished();
|
||||
void on_registrationId_editingFinished();
|
||||
|
||||
void on_pwrOnDelay_valueChanged();
|
||||
void on_pwrOffDelay_valueChanged();
|
||||
|
||||
@@ -1078,8 +1078,14 @@ void MainWindow::updateMenus()
|
||||
compareAct->setEnabled(activeChild);
|
||||
writeEepromAct->setEnabled(activeChild);
|
||||
readEepromAct->setEnabled(true);
|
||||
writeBUToRadioAct->setEnabled(true);
|
||||
readBUToFileAct->setEnabled(true);
|
||||
if (IS_HORUS(getCurrentBoard())) {
|
||||
writeBUToRadioAct->setEnabled(false);
|
||||
readBUToFileAct->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
writeBUToRadioAct->setEnabled(true);
|
||||
readBUToFileAct->setEnabled(true);
|
||||
}
|
||||
editSplashAct->setDisabled(IS_HORUS(getCurrentBoard()));
|
||||
|
||||
foreach (QAction * act, fileWindowActions) {
|
||||
@@ -1288,8 +1294,9 @@ void MainWindow::createActions()
|
||||
writeEepromAct = addAct("write_eeprom.png", SLOT(writeEeprom()));
|
||||
readEepromAct = addAct("read_eeprom.png", SLOT(readEeprom()));
|
||||
burnConfigAct = addAct("configure.png", SLOT(burnConfig()));
|
||||
writeBUToRadioAct = addAct("write_eeprom_file.png", SLOT(writeBackup()));
|
||||
readBUToFileAct = addAct("read_eeprom_file.png", SLOT(readBackup()));
|
||||
|
||||
writeBUToRadioAct = addAct("write_eeprom_file.png", SLOT(writeBackup()));
|
||||
readBUToFileAct = addAct("read_eeprom_file.png", SLOT(readBackup()));
|
||||
|
||||
createProfileAct = addAct("new.png", SLOT(createProfile()));
|
||||
copyProfileAct = addAct("copy.png", SLOT(copyProfile()));
|
||||
|
||||
@@ -70,7 +70,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
GenericPanel(parent, model, generalSettings, firmware),
|
||||
functions(model ? model->customFn : generalSettings.customFn),
|
||||
mediaPlayerCurrent(-1),
|
||||
mediaPlayer(NULL)
|
||||
mediaPlayer(nullptr)
|
||||
{
|
||||
Stopwatch s1("CustomFunctionsPanel - populate");
|
||||
lock = true;
|
||||
@@ -84,7 +84,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
if (!firmware->getCapability(VoicesAsNumbers)) {
|
||||
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
|
||||
for (int i=0; i<fswCapability; i++) {
|
||||
if (functions[i].func==FuncPlayPrompt || functions[i].func==FuncBackgroundMusic) {
|
||||
if (functions[i].func == FuncPlayPrompt || functions[i].func == FuncBackgroundMusic) {
|
||||
QString temp = functions[i].paramarm;
|
||||
if (!temp.isEmpty()) {
|
||||
tracksSet.insert(temp);
|
||||
@@ -98,7 +98,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
if (IS_STM32(firmware->getBoard())) {
|
||||
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/FUNCTIONS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
|
||||
for (int i=0; i<fswCapability; i++) {
|
||||
if (functions[i].func==FuncPlayScript) {
|
||||
if (functions[i].func == FuncPlayScript) {
|
||||
QString temp = functions[i].paramarm;
|
||||
if (!temp.isEmpty()) {
|
||||
scriptsSet.insert(temp);
|
||||
@@ -389,7 +389,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
if (!cfn.isEmpty()) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_SHOW_FUNC;
|
||||
|
||||
if (func>=FuncOverrideCH1 && func<=FuncOverrideCH32) {
|
||||
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32) {
|
||||
if (model) {
|
||||
int channelsMax = model->getChannelsMax(true);
|
||||
fswtchParam[i]->setDecimals(0);
|
||||
@@ -403,7 +403,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM | CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
}
|
||||
else if (func==FuncLogs) {
|
||||
else if (func == FuncLogs) {
|
||||
fswtchParam[i]->setDecimals(1);
|
||||
fswtchParam[i]->setMinimum(0);
|
||||
fswtchParam[i]->setMaximum(25.5);
|
||||
@@ -413,13 +413,13 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
fswtchParam[i]->setValue(cfn.param/10.0);
|
||||
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM;
|
||||
}
|
||||
else if (func>=FuncAdjustGV1 && func<=FuncAdjustGVLast) {
|
||||
else if (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast) {
|
||||
int gvidx = func - FuncAdjustGV1;
|
||||
if (modified)
|
||||
cfn.adjustMode = fswtchGVmode[i]->currentIndex();
|
||||
fswtchGVmode[i]->setCurrentIndex(cfn.adjustMode);
|
||||
widgetsMask |= CUSTOM_FUNCTION_GV_MODE | CUSTOM_FUNCTION_ENABLE;
|
||||
if (cfn.adjustMode==FUNC_ADJUST_GVAR_CONSTANT || cfn.adjustMode==FUNC_ADJUST_GVAR_INCDEC) {
|
||||
if (cfn.adjustMode == FUNC_ADJUST_GVAR_CONSTANT || cfn.adjustMode == FUNC_ADJUST_GVAR_INCDEC) {
|
||||
if (modified)
|
||||
cfn.param = fswtchParam[i]->value() * model->gvarData[gvidx].multiplierSet();
|
||||
if (IS_ARM(getCurrentBoard())) {
|
||||
@@ -454,13 +454,13 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
|
||||
}
|
||||
}
|
||||
else if (func==FuncReset) {
|
||||
else if (func == FuncReset) {
|
||||
if (modified)
|
||||
cfn.param = fswtchParamT[i]->currentData().toInt();
|
||||
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
else if (func>=FuncSetTimer1 && func<=FuncSetTimer3) {
|
||||
else if (func >= FuncSetTimer1 && func <= FuncSetTimer3) {
|
||||
if (modified)
|
||||
cfn.param = fswtchParamTime[i]->timeInSeconds();
|
||||
RawSourceRange range = RawSource(SOURCE_TYPE_SPECIAL, func - FuncSetTimer1 + 2).getRange(model, generalSettings);
|
||||
@@ -468,39 +468,39 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
fswtchParamTime[i]->setTime(cfn.param);
|
||||
widgetsMask |= CUSTOM_FUNCTION_TIME_PARAM | CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
else if (func>=FuncSetFailsafeInternalModule && func<=FuncBindExternalModule) {
|
||||
else if (func >= FuncSetFailsafeInternalModule && func <= FuncBindExternalModule) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
else if (func==FuncVolume) {
|
||||
else if (func == FuncVolume) {
|
||||
if (modified)
|
||||
cfn.param = fswtchParamT[i]->currentData().toInt();
|
||||
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
else if (func==FuncPlaySound || func==FuncPlayHaptic || func==FuncPlayValue || func==FuncPlayPrompt || func==FuncPlayBoth || func==FuncBackgroundMusic) {
|
||||
else if (func == FuncPlaySound || func == FuncPlayHaptic || func == FuncPlayValue || func == FuncPlayPrompt || func == FuncPlayBoth || func == FuncBackgroundMusic) {
|
||||
if (func != FuncBackgroundMusic) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_REPEAT;
|
||||
fswtchRepeat[i]->update();
|
||||
}
|
||||
if (func==FuncPlayValue) {
|
||||
if (func == FuncPlayValue) {
|
||||
if (modified)
|
||||
cfn.param = fswtchParamT[i]->currentData().toInt();
|
||||
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_REPEAT;
|
||||
}
|
||||
else if (func==FuncPlayPrompt || func==FuncPlayBoth) {
|
||||
else if (func == FuncPlayPrompt || func == FuncPlayBoth) {
|
||||
if (firmware->getCapability(VoicesAsNumbers)) {
|
||||
fswtchParam[i]->setDecimals(0);
|
||||
fswtchParam[i]->setSingleStep(1);
|
||||
fswtchParam[i]->setMinimum(0);
|
||||
if (func==FuncPlayPrompt) {
|
||||
if (func == FuncPlayPrompt) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM | CUSTOM_FUNCTION_REPEAT | CUSTOM_FUNCTION_GV_TOOGLE;
|
||||
}
|
||||
else {
|
||||
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM | CUSTOM_FUNCTION_REPEAT;
|
||||
fswtchParamGV[i]->setChecked(false);
|
||||
}
|
||||
fswtchParam[i]->setMaximum(func==FuncPlayBoth ? 254 : 255);
|
||||
fswtchParam[i]->setMaximum(func == FuncPlayBoth ? 254 : 255);
|
||||
if (modified) {
|
||||
if (fswtchParamGV[i]->isChecked()) {
|
||||
fswtchParam[i]->setMinimum(1);
|
||||
@@ -533,7 +533,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (func==FuncBackgroundMusic) {
|
||||
else if (func == FuncBackgroundMusic) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
|
||||
if (modified) {
|
||||
Helpers::getFileComboBoxValue(fswtchParamArmT[i], cfn.paramarm, firmware->getCapability(VoicesMaxLength));
|
||||
@@ -543,27 +543,27 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
widgetsMask |= CUSTOM_FUNCTION_PLAY;
|
||||
}
|
||||
}
|
||||
else if (func==FuncPlaySound) {
|
||||
else if (func == FuncPlaySound) {
|
||||
if (modified)
|
||||
cfn.param = (uint8_t)fswtchParamT[i]->currentIndex();
|
||||
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
|
||||
}
|
||||
else if (func==FuncPlayHaptic) {
|
||||
else if (func == FuncPlayHaptic) {
|
||||
if (modified)
|
||||
cfn.param = (uint8_t)fswtchParamT[i]->currentIndex();
|
||||
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
|
||||
}
|
||||
}
|
||||
else if (func==FuncPlayScript) {
|
||||
else if (func == FuncPlayScript) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
|
||||
if (modified) {
|
||||
Helpers::getFileComboBoxValue(fswtchParamArmT[i], cfn.paramarm, 8);
|
||||
}
|
||||
Helpers::populateFileComboBox(fswtchParamArmT[i], scriptsSet, cfn.paramarm);
|
||||
}
|
||||
else if (func==FuncBacklight && IS_TARANIS_PLUS(getCurrentBoard())) {
|
||||
else if (func == FuncBacklight && IS_TARANIS_PLUS(getCurrentBoard())) {
|
||||
if (modified)
|
||||
cfn.param = (uint8_t)fswtchBLcolor[i]->value();
|
||||
fswtchBLcolor[i]->setValue(cfn.param);
|
||||
|
||||
@@ -85,7 +85,7 @@ class SyncProcess : public QObject
|
||||
maxFileSize = 2 * 1024 * 1024;
|
||||
logLevel = QtWarningMsg;
|
||||
flags = OPT_RECURSIVE;
|
||||
dirFilterFlags = QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot | QDir::Readable;
|
||||
dirFilterFlags = QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot;
|
||||
}
|
||||
|
||||
friend inline QDebug operator<<(QDebug debug, const SyncOptions &o) {
|
||||
|
||||
@@ -50,4 +50,3 @@ void ReleaseNotesFirmwareDialog::replyFinished(QNetworkReply * reply)
|
||||
ui->textEditor->setOpenExternalLinks(true);
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 161 KiB |
@@ -14,8 +14,6 @@
|
||||
---- # GNU General Public License for more details. #
|
||||
---- # #
|
||||
---- #########################################################################
|
||||
-- Navigation variables
|
||||
local dirty = true
|
||||
|
||||
-- Model types
|
||||
local modelType = 0
|
||||
@@ -27,10 +25,8 @@ local MODELTYPE_QUAD = 2
|
||||
local function fieldIncDec(event, value, max)
|
||||
if event == EVT_ROT_LEFT or event == EVT_UP_BREAK then
|
||||
value = (value + max)
|
||||
dirty = true
|
||||
elseif event == EVT_ROT_RIGHT or event == EVT_DOWN_BREAK then
|
||||
value = (value + max + 2)
|
||||
dirty = true
|
||||
end
|
||||
value = (value % (max+1))
|
||||
return value
|
||||
@@ -38,7 +34,7 @@ end
|
||||
|
||||
-- Model Type Menu
|
||||
local function modelTypeSurround(index)
|
||||
if(index<=1) then
|
||||
if index <= 1 then
|
||||
lcd.drawFilledRectangle(59*(index%2)+12, 13, 43, 23)
|
||||
else
|
||||
lcd.drawFilledRectangle(59*(index%2)+12, 34, 40, 20)
|
||||
@@ -56,10 +52,7 @@ local function drawModelChoiceMenu()
|
||||
end
|
||||
|
||||
local function modelTypeMenu(event)
|
||||
if dirty == true then
|
||||
drawModelChoiceMenu()
|
||||
dirty = false
|
||||
end
|
||||
drawModelChoiceMenu()
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if modelType == MODELTYPE_PLANE then
|
||||
return "plane.lua"
|
||||
@@ -68,7 +61,6 @@ local function modelTypeMenu(event)
|
||||
elseif modelType == MODELTYPE_QUAD then
|
||||
return "multi.lua"
|
||||
end
|
||||
dirty = true
|
||||
else
|
||||
modelType = fieldIncDec(event, modelType, 2)
|
||||
end
|
||||
|
||||
@@ -46,12 +46,14 @@ option(TRACE_LUA_INTERNALS "Turn on traces for Lua internals" OFF)
|
||||
option(DEBUG_WINDOWS "Turn on windows traces" OFF)
|
||||
option(FRSKY_STICKS "Reverse sticks for FrSky sticks" OFF)
|
||||
option(NANO "Use nano newlib and binalloc")
|
||||
option(NIGHTLY_BUILD_WARNING "Warn this is a nightly build" OFF)
|
||||
option(TEST_BUILD_WARNING "Warn this is a test build" OFF)
|
||||
option(MODULE_PROTOCOL_FCC "Add support for FCC modules" ON)
|
||||
option(MODULE_PROTOCOL_LBT "Add support for EU/LBT modules" ON)
|
||||
option(MODULE_PROTOCOL_FLEX "Add support for non certified FLEX modules" OFF)
|
||||
option(MODULE_PROTOCOL_D8 "Add support for D8 modules" ON)
|
||||
option(FRSKY_RELEASE "Used to build FrSky released firmware" OFF)
|
||||
option(TBS_RELEASE "Used to build TBS released firmware" OFF)
|
||||
option(ALLOW_TRAINER_MULTI "Allow multi trainer" OFF)
|
||||
option(BOOTLOADER "Include Bootloader" ON)
|
||||
|
||||
# since we reset all default CMAKE compiler flags for firmware builds, provide an alternate way for user to specify additional flags.
|
||||
@@ -167,8 +169,6 @@ endif()
|
||||
|
||||
include(storage/conversions/CMakeLists.txt)
|
||||
|
||||
add_subdirectory(lua)
|
||||
|
||||
if(RTC_BACKUP_RAM)
|
||||
add_definitions(-DRTC_BACKUP_RAM)
|
||||
set(SRC ${SRC} storage/rlc.cpp)
|
||||
@@ -338,8 +338,8 @@ if(EEPROM_VARIANT_NEEDED)
|
||||
add_definitions(-DEEPROM_VARIANT=${EEPROM_VARIANT})
|
||||
endif()
|
||||
|
||||
if(NIGHTLY_BUILD_WARNING)
|
||||
add_definitions(-DNIGHTLY_BUILD_WARNING)
|
||||
if(TEST_BUILD_WARNING)
|
||||
add_definitions(-DTEST_BUILD_WARNING)
|
||||
endif()
|
||||
|
||||
if(MODULE_PROTOCOL_FCC)
|
||||
@@ -362,11 +362,19 @@ if(JUMPER_RELEASE)
|
||||
add_definitions(-DJUMPER_RELEASE)
|
||||
endif()
|
||||
|
||||
if(TBS_RELEASE)
|
||||
add_definitions(-DTBS_RELEASE)
|
||||
endif()
|
||||
|
||||
if(FRSKY_RELEASE)
|
||||
add_definitions(-DFRSKY_RELEASE)
|
||||
set(POPUP_LEVEL 3)
|
||||
endif()
|
||||
|
||||
if(ALLOW_TRAINER_MULTI)
|
||||
add_definitions(-DALLOW_TRAINER_MULTI)
|
||||
endif()
|
||||
|
||||
add_definitions(-DPOPUP_LEVEL=${POPUP_LEVEL})
|
||||
|
||||
if(BOOTLOADER)
|
||||
@@ -578,3 +586,8 @@ if(NOT MSVC)
|
||||
PrintTargetReport("firmware")
|
||||
|
||||
endif(NOT MSVC)
|
||||
|
||||
# Include the lua subdirectory after CMAKE_C_COMPILER has been
|
||||
# set. Otherwise, the custom commands it includes will use the
|
||||
# default CMAKE_C_COMPILER instead of the one we set manually
|
||||
add_subdirectory(lua)
|
||||
|
||||
@@ -514,6 +514,9 @@ class AudioQueue {
|
||||
bool isEmpty() const { return fragmentsFifo.empty(); };
|
||||
void wakeup();
|
||||
bool started() const { return _started; };
|
||||
#if defined(AUDIO_UNMUTE_DELAY)
|
||||
tmr10ms_t lastAudioPlayTime = 0;
|
||||
#endif
|
||||
|
||||
AudioBufferFifo buffersFifo;
|
||||
|
||||
|
||||
+18
-14
@@ -21,6 +21,10 @@
|
||||
#include "opentx.h"
|
||||
#include "io/frsky_firmware_update.h"
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
extern FIL g_bluetoothFile;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E)
|
||||
#define BLUETOOTH_COMMAND_NAME "TTM:REN-"
|
||||
#define BLUETOOTH_ANSWER_NAME "TTM:REN"
|
||||
@@ -44,9 +48,9 @@ Bluetooth bluetooth;
|
||||
|
||||
void Bluetooth::write(const uint8_t * data, uint8_t length)
|
||||
{
|
||||
TRACE_NOCRLF("BT>");
|
||||
BLUETOOTH_TRACE("BT>");
|
||||
for (int i=0; i<length; i++) {
|
||||
TRACE_NOCRLF(" %02X", data[i]);
|
||||
BLUETOOTH_TRACE(" %02X", data[i]);
|
||||
while (btTxFifo.isFull()) {
|
||||
if (!bluetoothIsWriting())
|
||||
bluetoothWriteWakeup();
|
||||
@@ -54,13 +58,13 @@ void Bluetooth::write(const uint8_t * data, uint8_t length)
|
||||
}
|
||||
btTxFifo.push(data[i]);
|
||||
}
|
||||
TRACE_NOCRLF("\r\n");
|
||||
BLUETOOTH_TRACE(CRLF);
|
||||
bluetoothWriteWakeup();
|
||||
}
|
||||
|
||||
void Bluetooth::writeString(const char * str)
|
||||
{
|
||||
TRACE("BT> %s", str);
|
||||
BLUETOOTH_TRACE("BT> %s" CRLF, str);
|
||||
while (*str != 0) {
|
||||
btTxFifo.push(*str++);
|
||||
}
|
||||
@@ -77,19 +81,19 @@ char * Bluetooth::readline(bool error_reset)
|
||||
if (!btRxFifo.pop(byte)) {
|
||||
#if defined(PCBX9E)
|
||||
// X9E BT module can get unresponsive
|
||||
TRACE("NO RESPONSE FROM BT MODULE");
|
||||
BLUETOOTH_TRACE("NO RESPONSE FROM BT MODULE" CRLF);
|
||||
#endif
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TRACE_NOCRLF("%02X ", byte);
|
||||
BLUETOOTH_TRACE("%02X ", byte);
|
||||
|
||||
#if 0
|
||||
if (error_reset && byte == 'R' && bufferIndex == 4 && memcmp(buffer, "ERRO", 4)) {
|
||||
#if defined(PCBX9E) // X9E enter BT reset loop if following code is implemented
|
||||
TRACE("BT Error...");
|
||||
BLUETOOTH_TRACE("BT Error..." CRLF);
|
||||
#else
|
||||
TRACE("BT Reset...");
|
||||
BLUETOOTH_TRACE("BT Reset..." CRLF);
|
||||
bufferIndex = 0;
|
||||
bluetoothDisable();
|
||||
state = BLUETOOTH_STATE_OFF;
|
||||
@@ -104,12 +108,12 @@ char * Bluetooth::readline(bool error_reset)
|
||||
if (bufferIndex > 2 && buffer[bufferIndex-1] == '\r') {
|
||||
buffer[bufferIndex-1] = '\0';
|
||||
bufferIndex = 0;
|
||||
TRACE("BT< %s", buffer);
|
||||
BLUETOOTH_TRACE("BT< %s" CRLF, buffer);
|
||||
if (error_reset && !strcmp((char *)buffer, "ERROR")) {
|
||||
#if defined(PCBX9E) // X9E enter BT reset loop if following code is implemented
|
||||
TRACE("BT Error...");
|
||||
BLUETOOTH_TRACE("BT Error..." CRLF);
|
||||
#else
|
||||
TRACE("BT Reset...");
|
||||
BLUETOOTH_TRACE("BT Reset..." CRLF);
|
||||
bluetoothDisable();
|
||||
state = BLUETOOTH_STATE_OFF;
|
||||
wakeupTime = get_tmr10ms() + 100; /* 1s */
|
||||
@@ -137,7 +141,7 @@ char * Bluetooth::readline(bool error_reset)
|
||||
|
||||
void Bluetooth::processTrainerFrame(const uint8_t * buffer)
|
||||
{
|
||||
TRACE("");
|
||||
BLUETOOTH_TRACE(CRLF);
|
||||
|
||||
for (uint8_t channel=0, i=1; channel<8; channel+=2, i+=3) {
|
||||
// +-500 != 512, but close enough.
|
||||
@@ -155,7 +159,7 @@ void Bluetooth::appendTrainerByte(uint8_t data)
|
||||
// we check for "DisConnected", but the first byte could be altered (if received in state STATE_DATA_XOR)
|
||||
if (data == '\n') {
|
||||
if (!strncmp((char *)&buffer[bufferIndex-13], "isConnected", 11)) {
|
||||
TRACE("BT< DisConnected");
|
||||
BLUETOOTH_TRACE("BT< DisConnected" CRLF);
|
||||
state = BLUETOOTH_STATE_DISCONNECTED;
|
||||
bufferIndex = 0;
|
||||
wakeupTime += 200; // 1s
|
||||
@@ -285,7 +289,7 @@ void Bluetooth::receiveTrainer()
|
||||
return;
|
||||
}
|
||||
|
||||
TRACE_NOCRLF("%02X ", byte);
|
||||
BLUETOOTH_TRACE("%02X ", byte);
|
||||
|
||||
processTrainerByte(byte);
|
||||
}
|
||||
|
||||
+11
-2
@@ -46,8 +46,17 @@ enum BluetoothStates {
|
||||
|
||||
#define LEN_BLUETOOTH_ADDR 16
|
||||
#define MAX_BLUETOOTH_DISTANT_ADDR 6
|
||||
#define BLUETOOTH_PACKET_SIZE 14
|
||||
#define BLUETOOTH_LINE_LENGTH 32
|
||||
#define BLUETOOTH_PACKET_SIZE 14
|
||||
#define BLUETOOTH_LINE_LENGTH 32
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
#define BLUETOOTH_TRACE(...) \
|
||||
f_printf(&g_bluetoothFile, __VA_ARGS__); \
|
||||
TRACE_NOCRLF(__VA_ARGS__);
|
||||
#else
|
||||
#define BLUETOOTH_TRACE(...) \
|
||||
TRACE_NOCRLF(__VA_ARGS__);
|
||||
#endif
|
||||
|
||||
class Bluetooth
|
||||
{
|
||||
|
||||
@@ -206,7 +206,7 @@ enum TrainerMode {
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_T16)
|
||||
#if defined(RADIO_T16) || defined(ALLOW_TRAINER_MULTI)
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_MULTI
|
||||
#elif defined(BLUETOOTH)
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH
|
||||
@@ -583,7 +583,7 @@ enum SwitchSources {
|
||||
#define SWSRC_TRAINER SWSRC_LAST_SWITCH,
|
||||
#endif
|
||||
|
||||
#define SWSRC_LAST_TRIM (SWSRC_FIRST_TRIM + 2*NUM_TRIMS - 1)
|
||||
#define SWSRC_LAST_TRIM (SWSRC_FIRST_TRIM + 2 * NUM_TRIMS - 1)
|
||||
|
||||
enum MixSources {
|
||||
MIXSRC_NONE,
|
||||
|
||||
@@ -448,6 +448,9 @@ PACK(struct ModuleData {
|
||||
uint8_t autoBindMode:1;
|
||||
uint8_t lowPowerMode:1;
|
||||
int8_t optionValue;
|
||||
uint8_t receiverTelemetryOff:1;
|
||||
uint8_t receiverHigherChannels:1;
|
||||
uint8_t spare:6;
|
||||
} multi);
|
||||
NOBACKUP(struct {
|
||||
uint8_t power:2; // 0=10 mW, 1=100 mW, 2=500 mW, 3=1W
|
||||
|
||||
+6
-3
@@ -24,6 +24,9 @@
|
||||
#include "definitions.h"
|
||||
#include "rtc.h"
|
||||
#include "dump.h"
|
||||
|
||||
#define CRLF "\r\n"
|
||||
|
||||
#if defined(CLI)
|
||||
#include "cli.h"
|
||||
#else
|
||||
@@ -48,7 +51,7 @@ uint8_t auxSerialTracesEnabled();
|
||||
#endif
|
||||
|
||||
#define TRACE_NOCRLF(...) debugPrintf(__VA_ARGS__)
|
||||
#define TRACE(f_, ...) debugPrintf((f_ "\r\n"), ##__VA_ARGS__)
|
||||
#define TRACE(f_, ...) debugPrintf((f_ CRLF), ##__VA_ARGS__)
|
||||
#define DUMP(data, size) dump(data, size)
|
||||
#define TRACE_DEBUG(...) debugPrintf("-D- " __VA_ARGS__)
|
||||
#define TRACE_DEBUG_WP(...) debugPrintf(__VA_ARGS__)
|
||||
@@ -65,7 +68,7 @@ uint8_t auxSerialTracesEnabled();
|
||||
#endif
|
||||
|
||||
#if defined(TRACE_LUA_INTERNALS_ENABLED)
|
||||
#define TRACE_LUA_INTERNALS(f_, ...) debugPrintf(("[LUA INT] " f_ "\r\n"), ##__VA_ARGS__)
|
||||
#define TRACE_LUA_INTERNALS(f_, ...) debugPrintf(("[LUA INT] " f_ CRLF), ##__VA_ARGS__)
|
||||
|
||||
#define TRACE_LUA_INTERNALS_WITH_LINEINFO(L, f_, ...) do { \
|
||||
lua_Debug ar; \
|
||||
@@ -73,7 +76,7 @@ uint8_t auxSerialTracesEnabled();
|
||||
lua_getinfo(L, ">Sl", &ar); \
|
||||
debugPrintf("%s:%d: ", ar.short_src, ar.currentline); \
|
||||
} \
|
||||
debugPrintf(("[LUA INT] " f_ "\r\n"), ##__VA_ARGS__); \
|
||||
debugPrintf(("[LUA INT] " f_ CRLF), ##__VA_ARGS__); \
|
||||
} while(0)
|
||||
#else
|
||||
#define TRACE_LUA_INTERNALS(...)
|
||||
|
||||
+2
-2
@@ -40,14 +40,14 @@ void dumpBody(const void *data, unsigned int size)
|
||||
dumpPrintf("%.2X ", ((uint8_t *)data)[i]);
|
||||
dumpPosition++;
|
||||
if ((dumpPosition & (32-1)) == 0) {
|
||||
dumpPrintf("\r\n");
|
||||
dumpPrintf(CRLF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dumpEnd()
|
||||
{
|
||||
dumpPrintf("\r\n");
|
||||
dumpPrintf(CRLF);
|
||||
}
|
||||
|
||||
#if defined(DEBUG) || defined(CLI)
|
||||
|
||||
@@ -1465,8 +1465,19 @@ void menuModelSetup(event_t event)
|
||||
if (MULTIMODULE_PROTOCOL_KNOWN(moduleIdx)) {
|
||||
int optionValue = g_model.moduleData[moduleIdx].multi.optionValue;
|
||||
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
const uint8_t multi_proto = g_model.moduleData[moduleIdx].getMultiProtocol();
|
||||
if (multi_proto < MODULE_SUBTYPE_MULTI_LAST) {
|
||||
|
||||
if (status.isValid()) {
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
lcdDrawText(INDENT_WIDTH, y, mm_options_strings::options[status.optionDisp]);
|
||||
if (attr && status.optionDisp == 2) {
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN + 23, y, "RSSI(", LEFT);
|
||||
lcdDrawNumber(lcdLastRightPos, y, TELEMETRY_RSSI(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, ")", LEFT);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const mm_protocol_definition * pdef = getMultiProtocolDefinition(multi_proto);
|
||||
if (pdef->optionsstr) {
|
||||
lcdDrawText(INDENT_WIDTH, y, pdef->optionsstr);
|
||||
@@ -1477,15 +1488,7 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
lcdDrawText(INDENT_WIDTH, y, mm_options_strings::options[status.optionDisp]);
|
||||
if (attr && status.optionDisp == 2) {
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN + 23, y, "RSSI(", LEFT);
|
||||
lcdDrawNumber(lcdLastRightPos, y, TELEMETRY_RSSI(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, ")", LEFT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (multi_proto == MODULE_SUBTYPE_MULTI_FS_AFHDS2A)
|
||||
optionValue = 50 + 5 * optionValue;
|
||||
|
||||
@@ -216,58 +216,46 @@ enum NavigationDirection {
|
||||
#define incrTelemetryScreen() direction = down
|
||||
|
||||
#if defined(NAVIGATION_XLITE)
|
||||
#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_LONG(KEY_LEFT)
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_LONG(KEY_RIGHT)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_LEFT) && IS_SHIFT_PRESSED())
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_LONG(KEY_RIGHT) && IS_SHIFT_PRESSED())
|
||||
#elif defined(NAVIGATION_X7)
|
||||
#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_LONG(KEY_PAGE)
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGE)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_PAGE))
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_BREAK(KEY_PAGE))
|
||||
#elif defined(NAVIGATION_9X)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_UP))
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_LONG(KEY_DOWN))
|
||||
#else
|
||||
#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_FIRST(KEY_UP)
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_FIRST(KEY_DOWN)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_FIRST(KEY_UP))
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_FIRST(KEY_DOWN))
|
||||
#endif
|
||||
|
||||
void menuViewTelemetryFrsky(event_t event)
|
||||
{
|
||||
enum NavigationDirection direction = none;
|
||||
|
||||
switch (event) {
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
if (event == EVT_KEY_FIRST(KEY_EXIT) && TELEMETRY_SCREEN_TYPE(s_frsky_view) != TELEMETRY_SCREEN_TYPE_SCRIPT) {
|
||||
killEvents(event);
|
||||
chainMenu(menuMainView);
|
||||
}
|
||||
#if defined(LUA)
|
||||
case EVT_KEY_LONG(KEY_EXIT):
|
||||
else if (event == EVT_KEY_LONG(KEY_EXIT)) {
|
||||
killEvents(event);
|
||||
chainMenu(menuMainView);
|
||||
}
|
||||
#endif
|
||||
killEvents(event);
|
||||
chainMenu(menuMainView);
|
||||
break;
|
||||
|
||||
case EVT_KEY_PREVIOUS_VIEW:
|
||||
#if defined(PCBXLITE)
|
||||
if (IS_SHIFT_PRESSED()) {
|
||||
decrTelemetryScreen();
|
||||
}
|
||||
#else
|
||||
if (IS_KEY_LONG(EVT_KEY_PREVIOUS_VIEW)) {
|
||||
killEvents(event);
|
||||
}
|
||||
decrTelemetryScreen();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EVT_KEY_NEXT_VIEW:
|
||||
#if defined(PCBXLITE)
|
||||
if (IS_SHIFT_PRESSED()) {
|
||||
incrTelemetryScreen();
|
||||
}
|
||||
#else
|
||||
incrTelemetryScreen();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
killEvents(event);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_FLIGHT);
|
||||
POPUP_MENU_START(onMainViewMenu);
|
||||
break;
|
||||
else if (EVT_KEY_PREVIOUS_VIEW(event)) {
|
||||
killEvents(event);
|
||||
decrTelemetryScreen();
|
||||
}
|
||||
else if (EVT_KEY_NEXT_VIEW(event)) {
|
||||
killEvents(event);
|
||||
incrTelemetryScreen();
|
||||
}
|
||||
else if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_FLIGHT);
|
||||
POPUP_MENU_START(onMainViewMenu);
|
||||
}
|
||||
|
||||
for (int i=0; i<=TELEMETRY_SCREEN_TYPE_MAX; i++) {
|
||||
|
||||
@@ -1216,8 +1216,17 @@ void menuModelSetup(event_t event)
|
||||
if (MULTIMODULE_PROTOCOL_KNOWN(moduleIdx)) {
|
||||
int optionValue = g_model.moduleData[moduleIdx].multi.optionValue;
|
||||
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
const uint8_t multi_proto = g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol();
|
||||
if (multi_proto < MODULE_SUBTYPE_MULTI_LAST) {
|
||||
if (status.isValid()) {
|
||||
lcdDrawText(INDENT_WIDTH, y, mm_options_strings::options[status.optionDisp]);
|
||||
if (attr && status.optionDisp == 2) {
|
||||
lcdDrawText(MODEL_SETUP_3RD_COLUMN+22, y, "RSSI(", LEFT);
|
||||
lcdDrawNumber(lcdLastRightPos, y, TELEMETRY_RSSI(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, ")", LEFT);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const mm_protocol_definition * pdef = getMultiProtocolDefinition(multi_proto);
|
||||
if (pdef->optionsstr)
|
||||
lcdDrawText(INDENT_WIDTH, y, pdef->optionsstr);
|
||||
@@ -1227,15 +1236,7 @@ void menuModelSetup(event_t event)
|
||||
lcdDrawText(lcdLastRightPos, y, ")", LEFT);
|
||||
}
|
||||
}
|
||||
else {
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
lcdDrawText(INDENT_WIDTH, y, mm_options_strings::options[status.optionDisp]);
|
||||
if (attr && status.optionDisp == 2) {
|
||||
lcdDrawText(MODEL_SETUP_3RD_COLUMN+22, y, "RSSI(", LEFT);
|
||||
lcdDrawNumber(lcdLastRightPos, y, TELEMETRY_RSSI(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, ")", LEFT);
|
||||
}
|
||||
}
|
||||
|
||||
if (multi_proto == MODULE_SUBTYPE_MULTI_FS_AFHDS2A)
|
||||
optionValue = 50 + 5 * optionValue;
|
||||
|
||||
@@ -1408,15 +1409,15 @@ void menuModelSetup(event_t event)
|
||||
|
||||
if (old_editMode > 0 && s_editMode == 0) {
|
||||
switch(menuVerticalPosition) {
|
||||
case ITEM_MODEL_SETUP_INTERNAL_MODULE_NOT_ACCESS_BIND:
|
||||
if (menuHorizontalPosition == 0)
|
||||
checkModelIdUnique(g_eeGeneral.currModel, INTERNAL_MODULE);
|
||||
break;
|
||||
case ITEM_MODEL_SETUP_INTERNAL_MODULE_NOT_ACCESS_BIND:
|
||||
if (menuHorizontalPosition == 0)
|
||||
checkModelIdUnique(g_eeGeneral.currModel, INTERNAL_MODULE);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_EXTERNAL_MODULE_NOT_ACCESS_BIND:
|
||||
if (menuHorizontalPosition == 0)
|
||||
checkModelIdUnique(g_eeGeneral.currModel, EXTERNAL_MODULE);
|
||||
break;
|
||||
case ITEM_MODEL_SETUP_EXTERNAL_MODULE_NOT_ACCESS_BIND:
|
||||
if (menuHorizontalPosition == 0)
|
||||
checkModelIdUnique(g_eeGeneral.currModel, EXTERNAL_MODULE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ void menuRadioDiagKeys(event_t event)
|
||||
displayKeyState(5 * FW + 2, y, i);
|
||||
}
|
||||
|
||||
for (uint8_t i = 0, cnt = 0; i <= NUM_SWITCHES; i++) {
|
||||
for (uint8_t i = 0, cnt = 0; i < NUM_SWITCHES; i++) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
div_t qr = div(cnt++, 6);
|
||||
coord_t x = 4 * FH * qr.quot;
|
||||
|
||||
@@ -22,27 +22,37 @@
|
||||
void onBindMenu(const char * result)
|
||||
{
|
||||
uint8_t moduleIdx = CURRENT_MODULE_EDITED(menuVerticalPosition - HEADER_LINE);
|
||||
uint8_t receiverTelemetryOff, receiverHigherChannels;
|
||||
|
||||
if (result == STR_BINDING_1_8_TELEM_ON) {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = false;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = false;
|
||||
receiverTelemetryOff = false;
|
||||
receiverHigherChannels = false;
|
||||
}
|
||||
else if (result == STR_BINDING_1_8_TELEM_OFF) {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = true;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = false;
|
||||
receiverTelemetryOff = true;
|
||||
receiverHigherChannels = false;
|
||||
}
|
||||
else if (result == STR_BINDING_9_16_TELEM_ON) {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = false;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = true;
|
||||
receiverTelemetryOff = false;
|
||||
receiverHigherChannels = true;
|
||||
}
|
||||
else if (result == STR_BINDING_9_16_TELEM_OFF) {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = true;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = true;
|
||||
receiverTelemetryOff = true;
|
||||
receiverHigherChannels = true;
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isModuleMultimodule(moduleIdx)) {
|
||||
g_model.moduleData[moduleIdx].multi.receiverTelemetryOff = receiverTelemetryOff;
|
||||
g_model.moduleData[moduleIdx].multi.receiverHigherChannels = receiverHigherChannels;
|
||||
}
|
||||
else {
|
||||
g_model.moduleData[moduleIdx].pxx.receiverTelemetryOff = receiverTelemetryOff;
|
||||
g_model.moduleData[moduleIdx].pxx.receiverHigherChannels = receiverHigherChannels;
|
||||
}
|
||||
|
||||
moduleState[moduleIdx].mode = MODULE_MODE_BIND;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,15 +25,20 @@ extern uint8_t g_moduleIdx;
|
||||
|
||||
bool addRadioTool(uint8_t index, const char * label)
|
||||
{
|
||||
int8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
LcdFlags attr = (sub == index ? INVERS : 0);
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + index * FH;
|
||||
lcdDrawNumber(3, y, index + 1, LEADING0|LEFT, 2);
|
||||
lcdDrawText(3*FW, y, label, (sub == index ? INVERS : 0));
|
||||
if (attr && s_editMode > 0) {
|
||||
s_editMode = 0;
|
||||
killAllEvents();
|
||||
return true;
|
||||
if (index >= menuVerticalOffset) {
|
||||
uint8_t lineIndex = index - menuVerticalOffset;
|
||||
if (lineIndex < NUM_BODY_LINES) {
|
||||
int8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
LcdFlags attr = (sub == index ? INVERS : 0);
|
||||
coord_t y = MENU_HEADER_HEIGHT + lineIndex * FH;
|
||||
lcdDrawNumber(3, y, index + 1, LEADING0 | LEFT, 2);
|
||||
lcdDrawText(3 * FW, y, label, (sub == index ? INVERS : 0));
|
||||
if (attr && s_editMode > 0) {
|
||||
s_editMode = 0;
|
||||
killAllEvents();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -739,6 +739,13 @@ bool isTrainerModeAvailable(int mode)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E)
|
||||
if (g_eeGeneral.bluetoothMode && mode == TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE) {
|
||||
// bluetooth uses the same USART than SBUS
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) && !defined(TRAINER_BATTERY_COMPARTMENT)
|
||||
if (mode == TRAINER_MODE_MASTER_BATTERY_COMPARTMENT)
|
||||
return false;
|
||||
@@ -934,7 +941,7 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
{MM_RF_CUSTOM_SELECTED, 7, true, true, NO_SUBTYPE, STR_MULTI_OPTION},
|
||||
|
||||
// Sentinel and default for protocols not listed above (MM_RF_CUSTOM is 0xff)
|
||||
{0xfe, 0, false, true, NO_SUBTYPE, nullptr}
|
||||
{0xfe, 0, false, false, NO_SUBTYPE, nullptr}
|
||||
};
|
||||
|
||||
#undef NO_SUBTYPE
|
||||
|
||||
+15
-11
@@ -172,6 +172,11 @@ inline uint8_t MULTI_DISABLE_CHAN_MAP_ROW(uint8_t moduleIdx)
|
||||
if (!isModuleMultimodule(moduleIdx))
|
||||
return HIDDEN_ROW;
|
||||
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
if (status.isValid()) {
|
||||
return status.supportsDisableMapping() == true ? 0 : HIDDEN_ROW;
|
||||
}
|
||||
|
||||
uint8_t protocol = g_model.moduleData[moduleIdx].getMultiProtocol();
|
||||
if (protocol < MODULE_SUBTYPE_MULTI_LAST) {
|
||||
const mm_protocol_definition * pdef = getMultiProtocolDefinition(protocol);
|
||||
@@ -179,11 +184,6 @@ inline uint8_t MULTI_DISABLE_CHAN_MAP_ROW(uint8_t moduleIdx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
if (status.supportsDisableMapping() && status.isValid()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
@@ -245,12 +245,15 @@ inline uint8_t MULTIMODULE_HASOPTIONS(uint8_t moduleIdx)
|
||||
return false;
|
||||
|
||||
uint8_t protocol = g_model.moduleData[moduleIdx].getMultiProtocol();
|
||||
if (protocol < MODULE_SUBTYPE_MULTI_LAST) {
|
||||
return getMultiProtocolDefinition(protocol)->optionsstr != nullptr;
|
||||
}
|
||||
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
return status.optionDisp;
|
||||
|
||||
if (status.isValid())
|
||||
return status.optionDisp;
|
||||
|
||||
if (protocol < MODULE_SUBTYPE_MULTI_LAST)
|
||||
return getMultiProtocolDefinition(protocol)->optionsstr != nullptr;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#define MULTIMODULE_MODULE_ROWS(moduleIdx) MULTIMODULE_PROTOCOL_KNOWN(moduleIdx) ? (uint8_t) 0 : HIDDEN_ROW, MULTIMODULE_PROTOCOL_KNOWN(moduleIdx) ? (uint8_t) 0 : HIDDEN_ROW, MULTI_DISABLE_CHAN_MAP_ROW(moduleIdx), // AUTOBIND, DISABLE TELEM, DISABLE CN.MAP
|
||||
@@ -258,6 +261,7 @@ inline uint8_t MULTIMODULE_HASOPTIONS(uint8_t moduleIdx)
|
||||
#define MULTIMODULE_MODE_ROWS(moduleIdx) (g_model.moduleData[moduleIdx].multi.customProto) ? (uint8_t) 3 : MULTIMODULE_HAS_SUBTYPE(moduleIdx) ? (uint8_t)2 : (uint8_t)1
|
||||
#define MULTIMODULE_SUBTYPE_ROWS(moduleIdx) isModuleMultimodule(moduleIdx) ? MULTIMODULE_RFPROTO_COLUMNS(moduleIdx) : HIDDEN_ROW,
|
||||
#define MULTIMODULE_OPTIONS_ROW(moduleIdx) (isModuleMultimodule(moduleIdx) && MULTIMODULE_HASOPTIONS(moduleIdx)) ? (uint8_t) 0: HIDDEN_ROW
|
||||
#define MODULE_POWER_ROW(moduleIdx) (MULTIMODULE_PROTOCOL_KNOWN(moduleIdx) || isModuleR9MNonAccess(moduleIdx)) ? (isModuleR9MLiteNonPro(moduleIdx) ? (isModuleR9M_FCC_VARIANT(moduleIdx) ? READONLY_ROW : (uint8_t)0) : (uint8_t)0) : HIDDEN_ROW
|
||||
|
||||
#else
|
||||
#define MULTIMODULE_STATUS_ROWS(moduleIdx)
|
||||
@@ -265,11 +269,11 @@ inline uint8_t MULTIMODULE_HASOPTIONS(uint8_t moduleIdx)
|
||||
#define MULTIMODULE_SUBTYPE_ROWS(moduleIdx)
|
||||
#define MULTIMODULE_MODE_ROWS(moduleIdx) (uint8_t)0
|
||||
#define MULTIMODULE_OPTIONS_ROW(moduleIdx) HIDDEN_ROW
|
||||
#define MODULE_POWER_ROW(moduleIdx) isModuleR9MNonAccess(moduleIdx) ? (isModuleR9MLiteNonPro(moduleIdx) ? (isModuleR9M_FCC_VARIANT(moduleIdx) ? READONLY_ROW : (uint8_t)0) : (uint8_t)0) : HIDDEN_ROW
|
||||
#endif
|
||||
|
||||
#define FAILSAFE_ROWS(moduleIdx) isModuleFailsafeAvailable(moduleIdx) ? (g_model.moduleData[moduleIdx].failsafeMode==FAILSAFE_CUSTOM ? (uint8_t)1 : (uint8_t)0) : HIDDEN_ROW
|
||||
#define MODULE_OPTION_ROW(moduleIdx) (isModuleR9MNonAccess(moduleIdx) || isModuleSBUS(moduleIdx) ? TITLE_ROW : MULTIMODULE_OPTIONS_ROW(moduleIdx))
|
||||
#define MODULE_POWER_ROW(moduleIdx) (MULTIMODULE_PROTOCOL_KNOWN(moduleIdx) || isModuleR9MNonAccess(moduleIdx)) ? (isModuleR9MLiteNonPro(moduleIdx) ? (isModuleR9M_FCC_VARIANT(moduleIdx) ? READONLY_ROW : (uint8_t)0) : (uint8_t)0) : HIDDEN_ROW
|
||||
|
||||
void editStickHardwareSettings(coord_t x, coord_t y, int idx, event_t event, LcdFlags flags);
|
||||
|
||||
|
||||
@@ -440,13 +440,15 @@ When called without parameters, it will only return the status of the output buf
|
||||
|
||||
@retval boolean data queued in output buffer or not.
|
||||
|
||||
@status current Introduced in 2.2.0
|
||||
@retval nil incorrect telemetry protocol.
|
||||
|
||||
@status current Introduced in 2.2.0, retval nil added in 2.3.4
|
||||
*/
|
||||
|
||||
static int luaSportTelemetryPush(lua_State * L)
|
||||
{
|
||||
if (!IS_FRSKY_SPORT_PROTOCOL()) {
|
||||
lua_pushboolean(L, false);
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -637,12 +639,14 @@ When called without parameters, it will only return the status of the output buf
|
||||
|
||||
@retval boolean data queued in output buffer or not.
|
||||
|
||||
@status current Introduced in 2.2.0
|
||||
@retval nil incorrect telemetry protocol.
|
||||
|
||||
@status current Introduced in 2.2.0, retval nil added in 2.3.4
|
||||
*/
|
||||
static int luaCrossfireTelemetryPush(lua_State * L)
|
||||
{
|
||||
if (telemetryProtocol != PROTOCOL_TELEMETRY_CROSSFIRE) {
|
||||
lua_pushboolean(L, false);
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+2
-17
@@ -417,21 +417,6 @@ void handleGui(event_t event) {
|
||||
}
|
||||
else if (luaTask(event, RUN_TELEM_FG_SCRIPT, true)) {
|
||||
// the telemetry screen is active
|
||||
// prevent events from keys MENU, UP, DOWN, ENT(short) and EXIT(short) from reaching the normal menus,
|
||||
// so Lua telemetry script can fully use them
|
||||
if (event) {
|
||||
uint8_t key = EVT_KEY_MASK(event);
|
||||
#if defined(PCBXLITE)
|
||||
// SHIFT + LEFT/RIGHT LONG used to change telemetry screen on XLITE
|
||||
if ((!IS_KEY_LONG(event) && key == KEY_RIGHT && IS_SHIFT_PRESSED()) || (!IS_KEY_LONG(event) && key == KEY_LEFT && IS_SHIFT_PRESSED()) || (!IS_KEY_LONG(event) && key == KEY_EXIT)) {
|
||||
#else
|
||||
// no need to filter out MENU and ENT(short), because they are not used by menuViewTelemetryFrsky()
|
||||
if (key == KEY_PLUS || key == KEY_MINUS || (!IS_KEY_LONG(event) && key == KEY_EXIT)) {
|
||||
#endif
|
||||
// TRACE("Telemetry script event 0x%02x killed", event);
|
||||
event = 0;
|
||||
}
|
||||
}
|
||||
menuHandlers[menuLevel](event);
|
||||
}
|
||||
else
|
||||
@@ -505,9 +490,9 @@ void guiMain(event_t evt)
|
||||
|
||||
lcdRefresh();
|
||||
|
||||
if (mainRequestFlags & (1 << REQUEST_SCREENSHOT)) {
|
||||
if (mainRequestFlags & (1u << REQUEST_SCREENSHOT)) {
|
||||
writeScreenshot();
|
||||
mainRequestFlags &= ~(1 << REQUEST_SCREENSHOT);
|
||||
mainRequestFlags &= ~(1u << REQUEST_SCREENSHOT);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+29
-33
@@ -447,36 +447,27 @@ void checkModelIdUnique(uint8_t index, uint8_t module)
|
||||
|
||||
uint8_t findNextUnusedModelId(uint8_t index, uint8_t module)
|
||||
{
|
||||
// assume 63 is the highest Model ID
|
||||
// and use 64 bits
|
||||
uint8_t usedModelIds[8];
|
||||
uint8_t usedModelIds[(MAX_RXNUM + 7) / 8];
|
||||
memset(usedModelIds, 0, sizeof(usedModelIds));
|
||||
|
||||
for (uint8_t mod_i = 0; mod_i < MAX_MODELS; mod_i++) {
|
||||
|
||||
if (mod_i == index)
|
||||
for (uint8_t modelIndex = 0; modelIndex < MAX_MODELS; modelIndex++) {
|
||||
if (modelIndex == index)
|
||||
continue;
|
||||
|
||||
uint8_t id = modelHeaders[mod_i].modelId[module];
|
||||
uint8_t id = modelHeaders[modelIndex].modelId[module];
|
||||
if (id == 0)
|
||||
continue;
|
||||
|
||||
uint8_t mask = 1;
|
||||
for (uint8_t i = 1; i < (id & 7); i++)
|
||||
mask <<= 1;
|
||||
|
||||
usedModelIds[id >> 3] |= mask;
|
||||
uint8_t mask = 1u << (id & 7u);
|
||||
usedModelIds[id >> 3u] |= mask;
|
||||
}
|
||||
|
||||
uint8_t new_id = 1;
|
||||
uint8_t tst_mask = 1;
|
||||
for (;new_id < getMaxRxNum(module); new_id++) {
|
||||
if (!(usedModelIds[new_id >> 3] & tst_mask)) {
|
||||
for (uint8_t id = 1; id <= getMaxRxNum(module); id++) {
|
||||
uint8_t mask = 1u << (id & 7u);
|
||||
if (!(usedModelIds[id >> 3u] & mask)) {
|
||||
// found free ID
|
||||
return new_id;
|
||||
return id;
|
||||
}
|
||||
if ((tst_mask <<= 1) == 0)
|
||||
tst_mask = 1;
|
||||
}
|
||||
|
||||
// failed finding something...
|
||||
@@ -492,7 +483,7 @@ void modelDefault(uint8_t id)
|
||||
|
||||
memcpy(g_model.modelRegistrationID, g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID);
|
||||
|
||||
#if defined(LUA) && defined(PCBTARANIS) //Horus uses menuModelWizard() for wizard
|
||||
#if defined(LUA) && defined(PCBTARANIS) // Horus uses menuModelWizard() for wizard
|
||||
if (isFileAvailable(WIZARD_PATH "/" WIZARD_NAME)) {
|
||||
f_chdir(WIZARD_PATH);
|
||||
luaExec(WIZARD_NAME);
|
||||
@@ -502,23 +493,20 @@ void modelDefault(uint8_t id)
|
||||
#if defined(FRSKY_RELEASE)
|
||||
g_model.moduleData[INTERNAL_MODULE].type = IS_PXX2_INTERNAL_ENABLED() ? MODULE_TYPE_ISRM_PXX2 : MODULE_TYPE_XJT_PXX1;
|
||||
g_model.moduleData[INTERNAL_MODULE].channelsCount = defaultModuleChannels_M8(INTERNAL_MODULE);
|
||||
#if defined(EEPROM)
|
||||
g_model.header.modelId[INTERNAL_MODULE] = findNextUnusedModelId(id, INTERNAL_MODULE);
|
||||
modelHeaders[id].modelId[INTERNAL_MODULE] = g_model.header.modelId[INTERNAL_MODULE];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
g_model.trainerData.mode = TRAINER_MODE_MASTER_BLUETOOTH;
|
||||
#endif
|
||||
|
||||
#if defined(EEPROM)
|
||||
for (int i=0; i<NUM_MODULES; i++) {
|
||||
modelHeaders[id].modelId[i] = g_model.header.modelId[i] = id+1;
|
||||
}
|
||||
checkModelIdUnique(id, 0);
|
||||
#endif
|
||||
|
||||
#if defined(FLIGHT_MODES) && defined(GVARS)
|
||||
for (int p=1; p<MAX_FLIGHT_MODES; p++) {
|
||||
for (int i=0; i<MAX_GVARS; i++) {
|
||||
g_model.flightModeData[p].gvars[i] = GVAR_MAX+1;
|
||||
for (int fmIdx = 1; fmIdx < MAX_FLIGHT_MODES; fmIdx++) {
|
||||
for (int gvarIdx = 0; gvarIdx < MAX_GVARS; gvarIdx++) {
|
||||
g_model.flightModeData[fmIdx].gvars[gvarIdx] = GVAR_MAX + 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -896,7 +884,7 @@ void checkFailsafe()
|
||||
void checkRSSIAlarmsDisabled()
|
||||
{
|
||||
if (g_model.rssiAlarms.disabled) {
|
||||
#if !defined(INTERNAL_MODULE)
|
||||
#if !defined(HARDWARE_INTERNAL_MODULE)
|
||||
if (!isModuleMultimoduleDSM2(EXTERNAL_MODULE))
|
||||
#else
|
||||
if (!isModuleMultimoduleDSM2(INTERNAL_MODULE) && !isModuleMultimoduleDSM2(EXTERNAL_MODULE))
|
||||
@@ -1601,8 +1589,8 @@ void opentxStart(const uint8_t startOptions = OPENTX_START_DEFAULT_ARGS)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(NIGHTLY_BUILD_WARNING)
|
||||
ALERT(STR_NIGHTLY_WARNING, TR_NIGHTLY_NOTSAFE, AU_ERROR);
|
||||
#if defined(TEST_BUILD_WARNING)
|
||||
ALERT(STR_TEST_WARNING, TR_TEST_NOTSAFE, AU_ERROR);
|
||||
#endif
|
||||
|
||||
#if defined(GUI)
|
||||
@@ -2049,12 +2037,20 @@ void opentxInit()
|
||||
WDG_ENABLE(WDG_DURATION);
|
||||
}
|
||||
|
||||
#if defined(SEMIHOSTING)
|
||||
extern "C" void initialise_monitor_handles();
|
||||
#endif
|
||||
|
||||
#if defined(SIMU)
|
||||
void simuMain()
|
||||
#else
|
||||
int main()
|
||||
#endif
|
||||
{
|
||||
#if defined(SEMIHOSTING)
|
||||
initialise_monitor_handles();
|
||||
#endif
|
||||
|
||||
#if defined(STM32)
|
||||
TRACE("reusableBuffer: modelSel=%d, moduleSetup=%d, calib=%d, sdManager=%d, hardwareAndSettings=%d, spectrumAnalyser=%d, usb=%d",
|
||||
sizeof(reusableBuffer.modelsel),
|
||||
|
||||
+2
-2
@@ -498,7 +498,7 @@ extern uint8_t flightModeTransitionLast;
|
||||
|
||||
#if defined(SIMU)
|
||||
inline int availableMemory() { return 1000; }
|
||||
#elif !defined(SIMU)
|
||||
#else
|
||||
extern unsigned char *heap;
|
||||
extern int _end;
|
||||
extern int _heap_end;
|
||||
@@ -1371,7 +1371,7 @@ extern uint8_t latencyToggleSwitch;
|
||||
|
||||
inline bool isAsteriskDisplayed()
|
||||
{
|
||||
#if defined(ASTERISK) || !defined(WATCHDOG) || defined(LOG_TELEMETRY) || defined(DEBUG_LATENCY)
|
||||
#if defined(ASTERISK) || !defined(WATCHDOG) || defined(LOG_TELEMETRY) || defined(LOG_BLUETOOTH) || defined(DEBUG_LATENCY)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ inline bool isModuleISRMD16(uint8_t idx)
|
||||
|
||||
inline bool isModuleD16(uint8_t idx)
|
||||
{
|
||||
return isModuleXJTD16(idx) || isModuleISRMD16(idx);
|
||||
return isModuleXJTD16(idx) || isModuleISRMD16(idx) || IS_D16_MULTI(idx);
|
||||
}
|
||||
|
||||
inline bool isModuleISRMAccess(uint8_t idx)
|
||||
@@ -466,14 +466,15 @@ inline bool isModuleBindRangeAvailable(uint8_t moduleIdx)
|
||||
return isModulePXX2(moduleIdx) || isModulePXX1(moduleIdx) || isModuleDSM2(moduleIdx) || isModuleMultimodule(moduleIdx);
|
||||
}
|
||||
|
||||
constexpr uint8_t MAX_RXNUM = 63;
|
||||
|
||||
inline uint8_t getMaxRxNum(uint8_t idx)
|
||||
{
|
||||
if (isModuleDSM2(idx))
|
||||
return 20;
|
||||
|
||||
#if defined(MULTIMODULE)
|
||||
if (isModuleMultimodule(idx))
|
||||
{
|
||||
if (isModuleMultimodule(idx)) {
|
||||
switch (g_model.moduleData[idx].getMultiProtocol()) {
|
||||
case MODULE_SUBTYPE_MULTI_OLRS:
|
||||
return 4;
|
||||
@@ -484,7 +485,7 @@ inline uint8_t getMaxRxNum(uint8_t idx)
|
||||
}
|
||||
#endif
|
||||
|
||||
return 63;
|
||||
return MAX_RXNUM;
|
||||
}
|
||||
|
||||
inline const char * getModuleDelay(uint8_t idx)
|
||||
@@ -519,7 +520,7 @@ inline bool isTelemAllowedOnBind(uint8_t moduleIndex)
|
||||
{
|
||||
#if defined(HARDWARE_INTERNAL_MODULE)
|
||||
if (moduleIndex == INTERNAL_MODULE)
|
||||
return isModuleISRM(moduleIndex) || isSportLineUsedByInternalModule();
|
||||
return true;
|
||||
|
||||
if (isSportLineUsedByInternalModule())
|
||||
return false;
|
||||
@@ -607,6 +608,8 @@ inline void resetMultiProtocolsOptions(uint8_t moduleIdx)
|
||||
g_model.moduleData[moduleIdx].multi.disableTelemetry = 0;
|
||||
g_model.moduleData[moduleIdx].multi.disableMapping = 0;
|
||||
g_model.moduleData[moduleIdx].multi.lowPowerMode = 0;
|
||||
g_model.moduleData[moduleIdx].failsafeMode = FAILSAFE_NOT_SET;
|
||||
g_model.header.modelId[moduleIdx] = 0;
|
||||
}
|
||||
|
||||
inline void getMultiOptionValues(int8_t multi_proto, int8_t & min, int8_t & max)
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
static void sendFrameProtocolHeader(uint8_t moduleIdx, bool failsafe);
|
||||
void sendChannels(uint8_t moduleIdx);
|
||||
static void sendD16BindOption(uint8_t moduleIdx);
|
||||
#if defined(LUA)
|
||||
static void sendSport(uint8_t moduleIdx);
|
||||
static void sendHott(uint8_t moduleIdx);
|
||||
@@ -174,10 +175,13 @@ void setupPulsesMulti(uint8_t moduleIdx)
|
||||
| g_model.moduleData[moduleIdx].multi.disableMapping));
|
||||
|
||||
// Multi V1.3.X.X -> Send protocol additional data: max 9 bytes
|
||||
#if defined(LUA)
|
||||
if (getMultiModuleStatus(moduleIdx).isValid()) {
|
||||
MultiModuleStatus &status = getMultiModuleStatus(moduleIdx);
|
||||
if (status.minor >= 3 && !(status.flags & 0x80)) { //Version 1.3.x.x or more and Buffer not full
|
||||
if (IS_D16_MULTI(moduleIdx) && moduleState[moduleIdx].mode == MODULE_MODE_BIND) {
|
||||
sendD16BindOption(moduleIdx);//1 byte of additional data
|
||||
}
|
||||
#if defined(LUA)
|
||||
// SPort send
|
||||
if (IS_D16_MULTI(moduleIdx) && outputTelemetryBuffer.destination == TELEMETRY_ENDPOINT_SPORT && outputTelemetryBuffer.size) {
|
||||
sendSport(moduleIdx); //8 bytes of additional data
|
||||
@@ -185,9 +189,9 @@ void setupPulsesMulti(uint8_t moduleIdx)
|
||||
else if (IS_HOTT_MULTI(moduleIdx)) {
|
||||
sendHott(moduleIdx); //1 byte of additional data
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void setupPulsesMultiExternalModule()
|
||||
@@ -345,6 +349,13 @@ void sendFrameProtocolHeader(uint8_t moduleIdx, bool failsafe)
|
||||
sendMulti(moduleIdx, (uint8_t) optionValue);
|
||||
}
|
||||
|
||||
void sendD16BindOption(uint8_t moduleIdx)
|
||||
{
|
||||
uint8_t bind_opt = g_model.moduleData[moduleIdx].multi.receiverTelemetryOff ? 1 : 0;
|
||||
bind_opt |= g_model.moduleData[moduleIdx].multi.receiverHigherChannels ? 2 : 0;
|
||||
sendMulti(moduleIdx, bind_opt);
|
||||
}
|
||||
|
||||
#if defined(LUA)
|
||||
void sendSport(uint8_t moduleIdx)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ void Pxx1Pulses<PxxTransport>::addFlag1(uint8_t module, uint8_t sendFailsafe)
|
||||
flag1 |= PXX_SEND_RANGECHECK;
|
||||
}
|
||||
|
||||
if (sendFailsafe && g_model.moduleData[module].failsafeMode != FAILSAFE_NOT_SET && g_model.moduleData[module].failsafeMode != FAILSAFE_RECEIVER) {
|
||||
if (sendFailsafe) {
|
||||
flag1 |= PXX_SEND_FAILSAFE;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ void Pxx1Pulses<PxxTransport>::setupFrame(uint8_t module)
|
||||
#if defined(PXX_FREQUENCY_HIGH)
|
||||
if (moduleState[module].protocol == PROTOCOL_CHANNELS_PXX1_SERIAL) {
|
||||
if (moduleState[module].counter-- == 0) {
|
||||
sendFailsafe = 1;
|
||||
sendFailsafe = (g_model.moduleData[module].failsafeMode != FAILSAFE_NOT_SET && g_model.moduleData[module].failsafeMode != FAILSAFE_RECEIVER);
|
||||
moduleState[module].counter = 1000;
|
||||
}
|
||||
add8ChannelsFrame(module, 0, sendFailsafe);
|
||||
@@ -196,12 +196,12 @@ void Pxx1Pulses<PxxTransport>::setupFrame(uint8_t module)
|
||||
if (moduleState[module].counter & 0x01) {
|
||||
sendUpperChannels = g_model.moduleData[module].channelsCount;
|
||||
if (sendUpperChannels && moduleState[module].counter == 1) {
|
||||
sendFailsafe = 1;
|
||||
sendFailsafe = (g_model.moduleData[module].failsafeMode != FAILSAFE_NOT_SET && g_model.moduleData[module].failsafeMode != FAILSAFE_RECEIVER);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (moduleState[module].counter == 0) {
|
||||
sendFailsafe = 1;
|
||||
sendFailsafe = (g_model.moduleData[module].failsafeMode != FAILSAFE_NOT_SET && g_model.moduleData[module].failsafeMode != FAILSAFE_RECEIVER);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ bool isFilePatternAvailable(const char * path, const char * file, const char * p
|
||||
|
||||
fplen = strlen(path);
|
||||
if (fplen > LEN_FILE_PATH_MAX) {
|
||||
TRACE_ERROR("isFilePatternAvailable(%s) = error: file path too long.\n", path, file);
|
||||
TRACE_ERROR("isFilePatternAvailable(%s) = error: path too long.\n", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ const char * getBasename(const char * path);
|
||||
#elif defined(PCBX7)
|
||||
#define OTX_FOURCC 0x3678746F // otx for Taranis X7 / X7S / X7 Express / X7S Express
|
||||
#elif defined(PCBX9LITES)
|
||||
#define OTX_FOURCC 0x3E78746F // otx for Taranis X9-Lite
|
||||
#define OTX_FOURCC 0x3E78746F // otx for Taranis X9-Lite S
|
||||
#elif defined(PCBX9LITE)
|
||||
#define OTX_FOURCC 0x3C78746F // otx for Taranis X9-Lite
|
||||
#elif defined(PCBX9D) || defined(PCBX9DP)
|
||||
|
||||
+1
-1
@@ -364,7 +364,7 @@ void OpenTxSim::updateKeysAndSwitches(bool start)
|
||||
static FXuint trimKeys[] = { KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12 };
|
||||
#endif
|
||||
|
||||
for (unsigned i=0; i<2*NUM_TRIMS; i++) {
|
||||
for (unsigned i=0; i<NUM_TRIMS_KEYS; i++) {
|
||||
simuSetTrim(i, getApp()->getKeyState(trimKeys[i]));
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
#define DISPLAY_VERSION "FrSky"
|
||||
#elif defined(JUMPER_RELEASE)
|
||||
#define DISPLAY_VERSION "JumperRC"
|
||||
#elif defined(TBS_RELEASE)
|
||||
#define DISPLAY_VERSION "TBS"
|
||||
#else
|
||||
#define DISPLAY_VERSION VERSION
|
||||
#endif
|
||||
|
||||
@@ -776,6 +776,15 @@ bool eeLoadGeneral(bool allowFixes)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9LITES)
|
||||
if (g_eeGeneral.variant == 0x0800) {
|
||||
TRACE("Pre release EEPROM detected, variant %d instead of %d for X9LiteS radio. Loading anyway", g_eeGeneral.variant, EEPROM_VARIANT);
|
||||
g_eeGeneral.variant = EEPROM_VARIANT;
|
||||
storageDirty(EE_GENERAL);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_T12)
|
||||
if (g_eeGeneral.variant != (EEPROM_VARIANT & 0xFFFE)) {
|
||||
TRACE("EEPROM variant %d instead of %d", g_eeGeneral.variant, EEPROM_VARIANT);
|
||||
|
||||
@@ -554,15 +554,15 @@ void ModelsList::moveModel(ModelCell * model, ModelsCategory * previous_category
|
||||
|
||||
bool ModelsList::isModelIdUnique(uint8_t moduleIdx, char* warn_buf, size_t warn_buf_len)
|
||||
{
|
||||
ModelCell* mod_cell = modelslist.getCurrentModel();
|
||||
if (!mod_cell || !mod_cell->valid_rfData) {
|
||||
ModelCell* modelCell = modelslist.getCurrentModel();
|
||||
if (!modelCell || !modelCell->valid_rfData) {
|
||||
// in doubt, pretend it's unique
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t modelId = mod_cell->modelId[moduleIdx];
|
||||
uint8_t type = mod_cell->moduleData[moduleIdx].type;
|
||||
uint8_t rfProtocol = mod_cell->moduleData[moduleIdx].rfProtocol;
|
||||
uint8_t modelId = modelCell->modelId[moduleIdx];
|
||||
uint8_t type = modelCell->moduleData[moduleIdx].type;
|
||||
uint8_t rfProtocol = modelCell->moduleData[moduleIdx].rfProtocol;
|
||||
|
||||
uint8_t additionalOnes = 0;
|
||||
char* curr = warn_buf;
|
||||
@@ -570,10 +570,10 @@ bool ModelsList::isModelIdUnique(uint8_t moduleIdx, char* warn_buf, size_t warn_
|
||||
|
||||
bool hit_found = false;
|
||||
const std::list<ModelsCategory*>& cats = modelslist.getCategories();
|
||||
std::list<ModelsCategory*>::const_iterator cat_it = cats.begin();
|
||||
for (;cat_it != cats.end(); cat_it++) {
|
||||
for (ModelsCategory::const_iterator it = (*cat_it)->begin(); it != (*cat_it)->end(); it++) {
|
||||
if (mod_cell == *it)
|
||||
std::list<ModelsCategory*>::const_iterator catIt = cats.begin();
|
||||
for (;catIt != cats.end(); catIt++) {
|
||||
for (ModelsCategory::const_iterator it = (*catIt)->begin(); it != (*catIt)->end(); it++) {
|
||||
if (modelCell == *it)
|
||||
continue;
|
||||
|
||||
if (!(*it)->valid_rfData)
|
||||
@@ -619,24 +619,21 @@ bool ModelsList::isModelIdUnique(uint8_t moduleIdx, char* warn_buf, size_t warn_
|
||||
|
||||
uint8_t ModelsList::findNextUnusedModelId(uint8_t moduleIdx)
|
||||
{
|
||||
ModelCell* mod_cell = modelslist.getCurrentModel();
|
||||
if (!mod_cell || !mod_cell->valid_rfData) {
|
||||
ModelCell * modelCell = modelslist.getCurrentModel();
|
||||
if (!modelCell || !modelCell->valid_rfData) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t type = mod_cell->moduleData[moduleIdx].type;
|
||||
uint8_t rfProtocol = mod_cell->moduleData[moduleIdx].rfProtocol;
|
||||
uint8_t type = modelCell->moduleData[moduleIdx].type;
|
||||
uint8_t rfProtocol = modelCell->moduleData[moduleIdx].rfProtocol;
|
||||
|
||||
// assume 63 is the highest Model ID
|
||||
// and use 64 bits
|
||||
uint8_t usedModelIds[8];
|
||||
uint8_t usedModelIds[(MAX_RXNUM + 7) / 8];
|
||||
memset(usedModelIds, 0, sizeof(usedModelIds));
|
||||
|
||||
const std::list<ModelsCategory*>& cats = modelslist.getCategories();
|
||||
std::list<ModelsCategory*>::const_iterator cat_it = cats.begin();
|
||||
for (;cat_it != cats.end(); cat_it++) {
|
||||
for (ModelsCategory::const_iterator it = (*cat_it)->begin(); it != (*cat_it)->end(); it++) {
|
||||
if (mod_cell == *it)
|
||||
const std::list<ModelsCategory *> & cats = modelslist.getCategories();
|
||||
for (auto catIt = cats.begin(); catIt != cats.end(); catIt++) {
|
||||
for (auto it = (*catIt)->begin(); it != (*catIt)->end(); it++) {
|
||||
if (modelCell == *it)
|
||||
continue;
|
||||
|
||||
if (!(*it)->valid_rfData)
|
||||
@@ -648,25 +645,18 @@ uint8_t ModelsList::findNextUnusedModelId(uint8_t moduleIdx)
|
||||
(rfProtocol == (*it)->moduleData[moduleIdx].rfProtocol)) {
|
||||
|
||||
uint8_t id = (*it)->modelId[moduleIdx];
|
||||
|
||||
uint8_t mask = 1;
|
||||
for (uint8_t i = 1; i < (id & 7); i++)
|
||||
mask <<= 1;
|
||||
|
||||
usedModelIds[id >> 3] |= mask;
|
||||
uint8_t mask = 1 << (id & 7u);
|
||||
usedModelIds[id >> 3u] |= mask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t new_id = 1;
|
||||
uint8_t tst_mask = 1;
|
||||
for (;new_id < getMaxRxNum(moduleIdx); new_id++) {
|
||||
if (!(usedModelIds[new_id >> 3] & tst_mask)) {
|
||||
for (uint8_t id = 1; id <= getMaxRxNum(moduleIdx); id++) {
|
||||
uint8_t mask = 1u << (id & 7u);
|
||||
if (!(usedModelIds[id >> 3u] & mask)) {
|
||||
// found free ID
|
||||
return new_id;
|
||||
return id;
|
||||
}
|
||||
if ((tst_mask <<= 1) == 0)
|
||||
tst_mask = 1;
|
||||
}
|
||||
|
||||
// failed finding something...
|
||||
|
||||
@@ -73,7 +73,7 @@ extern int _close(int file)
|
||||
|
||||
extern int _fstat(int file, struct stat * st)
|
||||
{
|
||||
st->st_mode = S_IFCHR ;
|
||||
st->st_mode = S_IFCHR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -97,6 +97,12 @@ extern int _write(int file, char *ptr, int len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern int _getpid()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void _exit(int status)
|
||||
{
|
||||
TRACE("_exit(%d)", status);
|
||||
@@ -105,12 +111,5 @@ extern void _exit(int status)
|
||||
|
||||
extern void _kill(int pid, int sig)
|
||||
{
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
extern int _getpid()
|
||||
{
|
||||
return -1 ;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ set_property(CACHE TIMERS PROPERTY STRINGS 2 3)
|
||||
option(CLI "Command Line Interface" OFF)
|
||||
option(DEBUG "Debug mode" OFF)
|
||||
option(LOG_TELEMETRY "Telemetry Logs on SD card" OFF)
|
||||
option(LOG_BLUETOOTH "Bluetooth Logs on SD card" OFF)
|
||||
option(TRACE_SD_CARD "Traces SD enabled" OFF)
|
||||
option(TRACE_FATFS "Traces FatFS enabled" OFF)
|
||||
option(TRACE_AUDIO "Traces audio enabled" OFF)
|
||||
@@ -32,6 +33,10 @@ if(LOG_TELEMETRY)
|
||||
add_definitions(-DLOG_TELEMETRY)
|
||||
endif()
|
||||
|
||||
if(LOG_BLUETOOTH)
|
||||
add_definitions(-DLOG_BLUETOOTH)
|
||||
endif()
|
||||
|
||||
if(TRACE_SD_CARD)
|
||||
add_definitions(-DTRACE_SD_CARD)
|
||||
set(DEBUG ON)
|
||||
|
||||
@@ -88,33 +88,61 @@ void dacInit()
|
||||
NVIC_SetPriority(AUDIO_DMA_Stream_IRQn, 7);
|
||||
}
|
||||
|
||||
#if defined(AUDIO_MUTE_GPIO_PIN)
|
||||
void audioMute()
|
||||
{
|
||||
#if defined(AUDIO_UNMUTE_DELAY)
|
||||
tmr10ms_t now = get_tmr10ms();
|
||||
if (!audioQueue.lastAudioPlayTime) {
|
||||
// we start the mute delay now
|
||||
audioQueue.lastAudioPlayTime = now;
|
||||
}
|
||||
else if (now - audioQueue.lastAudioPlayTime > AUDIO_MUTE_DELAY / 10) {
|
||||
// delay expired, we may mute
|
||||
GPIO_SetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
}
|
||||
#else
|
||||
// mute
|
||||
GPIO_SetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
#endif
|
||||
}
|
||||
|
||||
void audioUnmute()
|
||||
{
|
||||
#if defined(AUDIO_UNMUTE_DELAY)
|
||||
// if muted
|
||||
if (GPIO_ReadOutputDataBit(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN)) {
|
||||
// ..un-mute
|
||||
GPIO_ResetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
RTOS_WAIT_MS(AUDIO_UNMUTE_DELAY);
|
||||
}
|
||||
// reset the mute delay
|
||||
audioQueue.lastAudioPlayTime = 0;
|
||||
#else
|
||||
GPIO_ResetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void audioConsumeCurrentBuffer()
|
||||
{
|
||||
if (!nextBuffer) {
|
||||
nextBuffer = audioQueue.buffersFifo.getNextFilledBuffer();
|
||||
if (nextBuffer) {
|
||||
#if defined(AUDIO_MUTE_GPIO_PIN)
|
||||
// if muted
|
||||
if (GPIO_ReadOutputDataBit(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN)) {
|
||||
// ..un-mute
|
||||
GPIO_ResetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
#if defined(AUDIO_UNMUTE_DELAY)
|
||||
RTOS_WAIT_MS(AUDIO_UNMUTE_DELAY);
|
||||
audioUnmute();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
AUDIO_DMA_Stream->CR &= ~DMA_SxCR_EN ; // Disable DMA channel
|
||||
AUDIO_DMA->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5 ; // Write ones to clear bits
|
||||
AUDIO_DMA_Stream->CR &= ~DMA_SxCR_EN; // Disable DMA channel
|
||||
AUDIO_DMA->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5; // Write ones to clear bits
|
||||
AUDIO_DMA_Stream->M0AR = CONVERT_PTR_UINT(nextBuffer->data);
|
||||
AUDIO_DMA_Stream->NDTR = nextBuffer->size;
|
||||
AUDIO_DMA_Stream->CR |= DMA_SxCR_EN | DMA_SxCR_TCIE ; // Enable DMA channel and interrupt
|
||||
DAC->SR = DAC_SR_DMAUDR1 ; // Write 1 to clear flag
|
||||
DAC->CR |= DAC_CR_EN1 | DAC_CR_DMAEN1 ; // Enable DAC
|
||||
AUDIO_DMA_Stream->CR |= DMA_SxCR_EN | DMA_SxCR_TCIE; // Enable DMA channel and interrupt
|
||||
DAC->SR = DAC_SR_DMAUDR1; // Write 1 to clear flag
|
||||
DAC->CR |= DAC_CR_EN1 | DAC_CR_DMAEN1; // Enable DAC
|
||||
}
|
||||
#if defined(AUDIO_MUTE_GPIO_PIN)
|
||||
else {
|
||||
// mute
|
||||
GPIO_SetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
audioMute();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -107,6 +107,12 @@ void bluetoothInit(uint32_t baudrate, bool enable)
|
||||
void bluetoothDisable()
|
||||
{
|
||||
GPIO_SetBits(BT_EN_GPIO, BT_EN_GPIO_PIN); // close bluetooth (recent modules will go to bootloader mode)
|
||||
USART_ITConfig(BT_USART, USART_IT_RXNE, DISABLE);
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = BT_RX_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_Init(BT_USART_GPIO, &GPIO_InitStructure);
|
||||
USART_DeInit(BT_USART);
|
||||
}
|
||||
|
||||
extern "C" void BT_USART_IRQHandler(void)
|
||||
|
||||
@@ -74,7 +74,7 @@ set(BOOTLOADER_SRC
|
||||
../../../../../targets/${TARGET_DIR}/keys_driver.cpp
|
||||
../../../../../targets/${TARGET_DIR}/diskio.cpp
|
||||
../../../../../targets/${TARGET_DIR}/board.cpp
|
||||
../../../../../targets/${TARGET_DIR}/pwr_driver.cpp
|
||||
../pwr_driver.cpp
|
||||
../../../../../targets/${TARGET_DIR}/bootloader/boot_menu.cpp
|
||||
../usbd_usr.cpp
|
||||
../usbd_storage_msd.cpp
|
||||
@@ -142,6 +142,7 @@ remove_definitions(-DDEBUG)
|
||||
remove_definitions(-DDISK_CACHE)
|
||||
remove_definitions(-DLUA)
|
||||
remove_definitions(-DCLI)
|
||||
remove_definitions(-DSEMIHOSTING)
|
||||
remove_definitions(-DUSB_SERIAL)
|
||||
remove_definitions(-DWATCHDOG)
|
||||
|
||||
|
||||
+18
-12
@@ -23,17 +23,14 @@
|
||||
void pwrInit()
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
|
||||
// Board PWR
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN;
|
||||
GPIO_Init(PWR_ON_GPIO, &GPIO_InitStructure);
|
||||
|
||||
#if defined(INTMODULE_BOOTCMD_GPIO)
|
||||
GPIO_SetBits(INTMODULE_BOOTCMD_GPIO, INTMODULE_BOOTCMD_GPIO_PIN);
|
||||
INIT_INTMODULE_BOOTCMD_PIN();
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_BOOTCMD_GPIO_PIN;
|
||||
GPIO_Init(INTMODULE_BOOTCMD_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
@@ -54,23 +51,32 @@ void pwrInit()
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
||||
GPIO_Init(PWR_SWITCH_GPIO, &GPIO_InitStructure);
|
||||
|
||||
#if defined(PCBREV_HARDCODED)
|
||||
hardwareOptions.pcbrev = PCBREV_HARDCODED;
|
||||
#elif defined(PCBREV_GPIO_PIN)
|
||||
GPIO_ResetBits(PCBREV_GPIO, PCBREV_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
|
||||
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
|
||||
hardwareOptions.pcbrev = PCBREV_VALUE();
|
||||
#endif
|
||||
|
||||
#if defined(TRAINER_DETECT_GPIO_PIN)
|
||||
GPIO_InitStructure.GPIO_Pin = TRAINER_DETECT_GPIO_PIN;
|
||||
GPIO_Init(TRAINER_DETECT_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
#if defined(SD_PRESENT_GPIO_PIN)
|
||||
GPIO_ResetBits(SD_PRESENT_GPIO, SD_PRESENT_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = SD_PRESENT_GPIO_PIN;
|
||||
GPIO_Init(SD_PRESENT_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
#if defined(INTMODULE_USART) && defined(TRAINER_MODULE_CPPM_GPIO_PIN)
|
||||
GPIO_SetBits(TRAINER_MODULE_CPPM_GPIO, TRAINER_MODULE_CPPM_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = TRAINER_MODULE_CPPM_GPIO_PIN;
|
||||
GPIO_Init(TRAINER_MODULE_CPPM_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
#if defined(PCBREV_GPIO_PIN)
|
||||
GPIO_ResetBits(PCBREV_GPIO, PCBREV_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
|
||||
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
}
|
||||
|
||||
void pwrOn()
|
||||
@@ -175,7 +175,7 @@ set(FIRMWARE_TARGET_SRC
|
||||
${LCD_DRIVER}
|
||||
board.cpp
|
||||
backlight_driver.cpp
|
||||
pwr_driver.cpp
|
||||
../common/arm/stm32/pwr_driver.cpp
|
||||
sdram_driver.c
|
||||
startup_stm32f42_43xxx.s
|
||||
../common/arm/stm32/heartbeat_driver.cpp
|
||||
|
||||
@@ -41,10 +41,6 @@ void watchdogInit(unsigned int duration)
|
||||
IWDG->KR = 0xCCCC; // start
|
||||
}
|
||||
|
||||
#if defined(SEMIHOSTING)
|
||||
extern "C" void initialise_monitor_handles();
|
||||
#endif
|
||||
|
||||
#if defined(PCBX10) && !defined(RADIO_T16)
|
||||
void sportUpdateInit()
|
||||
{
|
||||
@@ -70,10 +66,6 @@ void sportUpdatePowerOff()
|
||||
|
||||
void boardInit()
|
||||
{
|
||||
#if defined(SEMIHOSTING)
|
||||
initialise_monitor_handles();
|
||||
#endif
|
||||
|
||||
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph |
|
||||
PCBREV_RCC_AHB1Periph |
|
||||
LED_RCC_AHB1Periph |
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
#include "hal.h"
|
||||
|
||||
PACK(typedef struct {
|
||||
uint8_t pcbrev : 2;
|
||||
uint8_t sticksPwmDisabled : 1;
|
||||
uint8_t pxx2Enabled : 1;
|
||||
uint8_t pcbrev:2;
|
||||
uint8_t sticksPwmDisabled:1;
|
||||
uint8_t pxx2Enabled:1;
|
||||
}) HardwareOptions;
|
||||
|
||||
extern HardwareOptions hardwareOptions;
|
||||
|
||||
@@ -310,10 +310,15 @@ DRESULT disk_ioctl (
|
||||
// TODO everything here should not be in the driver layer ...
|
||||
|
||||
FATFS g_FATFS_Obj __DMA; // initialized in boardInit()
|
||||
|
||||
#if defined(LOG_TELEMETRY)
|
||||
FIL g_telemetryFile = {};
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
FIL g_bluetoothFile = {};
|
||||
#endif
|
||||
|
||||
#if defined(BOOT)
|
||||
void sdInit(void)
|
||||
{
|
||||
@@ -350,6 +355,13 @@ void sdMount()
|
||||
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_open(&g_bluetoothFile, LOGS_PATH "/bluetooth.log", FA_OPEN_ALWAYS | FA_WRITE);
|
||||
if (f_size(&g_bluetoothFile) > 0) {
|
||||
f_lseek(&g_bluetoothFile, f_size(&g_bluetoothFile)); // append
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
TRACE("f_mount() failed");
|
||||
@@ -362,9 +374,15 @@ void sdDone()
|
||||
|
||||
if (sdMounted()) {
|
||||
audioQueue.stopSD();
|
||||
|
||||
#if defined(LOG_TELEMETRY)
|
||||
f_close(&g_telemetryFile);
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_close(&g_bluetoothFile);
|
||||
#endif
|
||||
|
||||
f_mount(nullptr, "", 0); // unmount SD
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,24 +120,24 @@
|
||||
// Gimbal switch left
|
||||
#define STORAGE_SWITCH_I
|
||||
#define HARDWARE_SWITCH_I
|
||||
#define SWITCHES_GPIO_REG_I GPIOH->IDR
|
||||
#define SWITCHES_GPIO_PIN_I GPIO_Pin_14 // PH.14
|
||||
#define SWITCHES_GPIO_REG_I GPIOH->IDR
|
||||
#define SWITCHES_GPIO_PIN_I GPIO_Pin_14 // PH.14
|
||||
// Gimbal switch right
|
||||
#define STORAGE_SWITCH_J
|
||||
#define HARDWARE_SWITCH_J
|
||||
#define SWITCHES_GPIO_REG_J GPIOH->IDR
|
||||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_15 // PH.15
|
||||
#define SWITCHES_GPIO_REG_J GPIOH->IDR
|
||||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_15 // PH.15
|
||||
#elif defined(PCBX12S)
|
||||
// Gimbal switch left
|
||||
#define STORAGE_SWITCH_I
|
||||
#define HARDWARE_SWITCH_I
|
||||
#define SWITCHES_GPIO_REG_I GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_I GPIO_Pin_1 // PB.01
|
||||
#define SWITCHES_GPIO_REG_I GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_I GPIO_Pin_1 // PB.01
|
||||
// Gimbal switch right
|
||||
#define STORAGE_SWITCH_J
|
||||
#define HARDWARE_SWITCH_J
|
||||
#define SWITCHES_GPIO_REG_J GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_0 // PB.00
|
||||
#define SWITCHES_GPIO_REG_J GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_0 // PB.00
|
||||
#endif
|
||||
|
||||
// Trims
|
||||
@@ -184,15 +184,15 @@
|
||||
#define TRIMS_GPIO_REG_RHR GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_RHR GPIO_Pin_7 // PD.07
|
||||
#if defined(RADIO_T16)
|
||||
#define TRIMS_GPIO_REG_LSU GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_LSU GPIO_Pin_13 // PD.13
|
||||
#define TRIMS_GPIO_REG_LSD GPIOJ->IDR
|
||||
#define TRIMS_GPIO_PIN_LSD GPIO_Pin_8 // PJ.08
|
||||
#define TRIMS_GPIO_REG_LSU GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_LSU GPIO_Pin_13 // PD.13
|
||||
#define TRIMS_GPIO_REG_LSD GPIOJ->IDR
|
||||
#define TRIMS_GPIO_PIN_LSD GPIO_Pin_8 // PJ.08
|
||||
#else
|
||||
#define TRIMS_GPIO_REG_LSU GPIOJ->IDR
|
||||
#define TRIMS_GPIO_PIN_LSU GPIO_Pin_8 // PJ.08
|
||||
#define TRIMS_GPIO_REG_LSD GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_LSD GPIO_Pin_13 // PD.13
|
||||
#define TRIMS_GPIO_REG_LSU GPIOJ->IDR
|
||||
#define TRIMS_GPIO_PIN_LSU GPIO_Pin_8 // PJ.08
|
||||
#define TRIMS_GPIO_REG_LSD GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_LSD GPIO_Pin_13 // PD.13
|
||||
#endif
|
||||
#define TRIMS_GPIO_REG_RSU GPIOB->IDR
|
||||
#define TRIMS_GPIO_PIN_RSU GPIO_Pin_14 // PB.14
|
||||
@@ -288,11 +288,11 @@
|
||||
#define ADC_DMA_Stream DMA2_Stream0
|
||||
#define ADC_SET_DMA_FLAGS() ADC_DMA->LIFCR = (DMA_LIFCR_CTCIF0 | DMA_LIFCR_CHTIF0 | DMA_LIFCR_CTEIF0 | DMA_LIFCR_CDMEIF0 | DMA_LIFCR_CFEIF0)
|
||||
#define ADC_TRANSFER_COMPLETE() (ADC_DMA->LISR & DMA_LISR_TCIF0)
|
||||
#if defined(RADIO_T16)
|
||||
#define ADC_VREF_PREC2 300
|
||||
#else
|
||||
#define ADC_VREF_PREC2 250
|
||||
#endif
|
||||
#if defined(RADIO_T16)
|
||||
#define ADC_VREF_PREC2 300
|
||||
#else
|
||||
#define ADC_VREF_PREC2 250
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Power
|
||||
@@ -316,15 +316,15 @@
|
||||
|
||||
// PCBREV
|
||||
#if defined(PCBX10)
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOH
|
||||
#define PCBREV_GPIO_PIN (GPIO_Pin_7 | GPIO_Pin_8)
|
||||
#define PCBREV_GPIO GPIOH
|
||||
#define PCBREV_VALUE() (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_7) + (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_8) << 1))
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOH
|
||||
#define PCBREV_GPIO_PIN (GPIO_Pin_7 | GPIO_Pin_8)
|
||||
#define PCBREV_GPIO GPIOH
|
||||
#define PCBREV_VALUE() (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_7) + (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_8) << 1))
|
||||
#else
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOI
|
||||
#define PCBREV_GPIO GPIOI
|
||||
#define PCBREV_GPIO_PIN GPIO_Pin_11 // PI.11
|
||||
#define PCBREV_VALUE() GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN)
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOI
|
||||
#define PCBREV_GPIO GPIOI
|
||||
#define PCBREV_GPIO_PIN GPIO_Pin_11 // PI.11
|
||||
#define PCBREV_VALUE() GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN)
|
||||
#endif
|
||||
|
||||
// Led
|
||||
@@ -344,22 +344,22 @@
|
||||
|
||||
// Serial Port (DEBUG)
|
||||
#if defined(PCBX12S)
|
||||
#define AUX_SERIAL_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA1)
|
||||
#define AUX_SERIAL_RCC_APB1Periph RCC_APB1Periph_USART3
|
||||
#define AUX_SERIAL_GPIO GPIOB
|
||||
#define AUX_SERIAL_GPIO_PIN_TX GPIO_Pin_10 // PB.10
|
||||
#define AUX_SERIAL_GPIO_PIN_RX GPIO_Pin_11 // PB.11
|
||||
#define AUX_SERIAL_GPIO_PinSource_TX GPIO_PinSource10
|
||||
#define AUX_SERIAL_GPIO_PinSource_RX GPIO_PinSource11
|
||||
#define AUX_SERIAL_GPIO_AF GPIO_AF_USART3
|
||||
#define AUX_SERIAL_USART USART3
|
||||
#define AUX_SERIAL_USART_IRQHandler USART3_IRQHandler
|
||||
#define AUX_SERIAL_USART_IRQn USART3_IRQn
|
||||
#define AUX_SERIAL_DMA_Stream_RX DMA1_Stream1
|
||||
#define AUX_SERIAL_DMA_Channel_RX DMA_Channel_4
|
||||
#define AUX_SERIAL_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA1)
|
||||
#define AUX_SERIAL_RCC_APB1Periph RCC_APB1Periph_USART3
|
||||
#define AUX_SERIAL_GPIO GPIOB
|
||||
#define AUX_SERIAL_GPIO_PIN_TX GPIO_Pin_10 // PB.10
|
||||
#define AUX_SERIAL_GPIO_PIN_RX GPIO_Pin_11 // PB.11
|
||||
#define AUX_SERIAL_GPIO_PinSource_TX GPIO_PinSource10
|
||||
#define AUX_SERIAL_GPIO_PinSource_RX GPIO_PinSource11
|
||||
#define AUX_SERIAL_GPIO_AF GPIO_AF_USART3
|
||||
#define AUX_SERIAL_USART USART3
|
||||
#define AUX_SERIAL_USART_IRQHandler USART3_IRQHandler
|
||||
#define AUX_SERIAL_USART_IRQn USART3_IRQn
|
||||
#define AUX_SERIAL_DMA_Stream_RX DMA1_Stream1
|
||||
#define AUX_SERIAL_DMA_Channel_RX DMA_Channel_4
|
||||
#else
|
||||
#define AUX_SERIAL_RCC_AHB1Periph 0
|
||||
#define AUX_SERIAL_RCC_APB1Periph 0
|
||||
#define AUX_SERIAL_RCC_AHB1Periph 0
|
||||
#define AUX_SERIAL_RCC_APB1Periph 0
|
||||
#endif
|
||||
|
||||
// Telemetry
|
||||
@@ -385,8 +385,8 @@
|
||||
#define TELEMETRY_TIMER_IRQn TIM1_TRG_COM_TIM11_IRQn
|
||||
#define TELEMETRY_TIMER_IRQHandler TIM1_TRG_COM_TIM11_IRQHandler
|
||||
#if defined(PCBX12S)
|
||||
#define TELEMETRY_DMA_Stream_RX DMA1_Stream5
|
||||
#define TELEMETRY_DMA_Channel_RX DMA_Channel_4
|
||||
#define TELEMETRY_DMA_Stream_RX DMA1_Stream5
|
||||
#define TELEMETRY_DMA_Channel_RX DMA_Channel_4
|
||||
#endif
|
||||
#define TELEMETRY_DMA_Stream_TX DMA1_Stream6
|
||||
#define TELEMETRY_DMA_Channel_TX DMA_Channel_4
|
||||
@@ -547,7 +547,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_T16)
|
||||
#define AUDIO_UNMUTE_DELAY 150
|
||||
#define AUDIO_UNMUTE_DELAY 120 // ms
|
||||
#define AUDIO_MUTE_DELAY 500 // ms
|
||||
#endif
|
||||
|
||||
// I2C Bus
|
||||
@@ -589,7 +590,7 @@
|
||||
#endif
|
||||
|
||||
#if !defined(RADIO_T16)
|
||||
#define EXTERNAL_ANTENNA
|
||||
#define EXTERNAL_ANTENNA
|
||||
#endif
|
||||
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA2)
|
||||
#define INTMODULE_PWR_GPIO GPIOA
|
||||
@@ -615,6 +616,7 @@
|
||||
#define INTMODULE_BOOTCMD_GPIO GPIOI
|
||||
#define INTMODULE_BOOTCMD_GPIO_PIN GPIO_Pin_9 // PI.09
|
||||
#endif
|
||||
#define INIT_INTMODULE_BOOTCMD_PIN() GPIO_ResetBits(INTMODULE_BOOTCMD_GPIO, INTMODULE_BOOTCMD_GPIO_PIN);
|
||||
#if defined(PCBX10) || PCBREV >= 13
|
||||
#define INTMODULE_RCC_APB1Periph RCC_APB1Periph_TIM2
|
||||
#define INTMODULE_RCC_APB2Periph RCC_APB2Periph_USART1
|
||||
@@ -634,6 +636,7 @@
|
||||
// External Module
|
||||
#define EXTMODULE_PWR_GPIO GPIOB
|
||||
#define EXTMODULE_PWR_GPIO_PIN GPIO_Pin_3 // PB.03
|
||||
#define EXTERNAL_MODULE_PWR_OFF() GPIO_ResetBits(EXTMODULE_PWR_GPIO, EXTMODULE_PWR_GPIO_PIN)
|
||||
#if defined(PCBX10) && defined(PCBREV_EXPRESS)
|
||||
#define EXTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA1)
|
||||
#define EXTMODULE_RCC_APB1Periph (RCC_APB1Periph_TIM2 | RCC_APB1Periph_USART3)
|
||||
@@ -714,9 +717,9 @@
|
||||
#define INTMODULE_HEARTBEAT_EXTI_IRQn EXTI15_10_IRQn
|
||||
#define INTMODULE_HEARTBEAT_REUSE_INTERRUPT_ROTARY_ENCODER
|
||||
#if defined(PXX2)
|
||||
#define INTMODULE_HEARTBEAT_TRIGGER EXTI_Trigger_Falling
|
||||
#define INTMODULE_HEARTBEAT_TRIGGER EXTI_Trigger_Falling
|
||||
#else
|
||||
#define INTMODULE_HEARTBEAT_TRIGGER EXTI_Trigger_Rising
|
||||
#define INTMODULE_HEARTBEAT_TRIGGER EXTI_Trigger_Rising
|
||||
#endif
|
||||
|
||||
// Trainer Port
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
#include "storage/rtc_backup.h"
|
||||
|
||||
void pwrInit()
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
|
||||
// Internal module PWR
|
||||
GPIO_ResetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_PWR_GPIO_PIN;
|
||||
GPIO_Init(INTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
||||
|
||||
// External module PWR
|
||||
GPIO_ResetBits(EXTMODULE_PWR_GPIO, EXTMODULE_PWR_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PWR_GPIO_PIN;
|
||||
GPIO_Init(EXTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
||||
|
||||
#if defined(INTMODULE_BOOTCMD_GPIO)
|
||||
GPIO_ResetBits(INTMODULE_BOOTCMD_GPIO, INTMODULE_BOOTCMD_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_BOOTCMD_GPIO_PIN;
|
||||
GPIO_Init(INTMODULE_BOOTCMD_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
|
||||
// PWR SWITCH
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
||||
GPIO_Init(PWR_SWITCH_GPIO, &GPIO_InitStructure);
|
||||
|
||||
// PCBREV
|
||||
#if defined(PCBREV_GPIO_PIN)
|
||||
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
|
||||
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
|
||||
hardwareOptions.pcbrev = PCBREV_VALUE();
|
||||
#endif
|
||||
|
||||
// SD-DETECT PIN
|
||||
GPIO_ResetBits(SD_PRESENT_GPIO, SD_PRESENT_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = SD_PRESENT_GPIO_PIN;
|
||||
GPIO_Init(SD_PRESENT_GPIO, &GPIO_InitStructure);
|
||||
|
||||
// TRAINER DETECT PIN
|
||||
GPIO_InitStructure.GPIO_Pin = TRAINER_DETECT_GPIO_PIN;
|
||||
GPIO_Init(TRAINER_DETECT_GPIO, &GPIO_InitStructure);
|
||||
}
|
||||
|
||||
void pwrOn()
|
||||
{
|
||||
// we keep the init of the PIN to have pwrOn as quick as possible
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(PWR_ON_GPIO, &GPIO_InitStructure);
|
||||
|
||||
GPIO_SetBits(PWR_ON_GPIO, PWR_ON_GPIO_PIN);
|
||||
}
|
||||
|
||||
void pwrOff()
|
||||
{
|
||||
GPIO_ResetBits(PWR_ON_GPIO, PWR_ON_GPIO_PIN);
|
||||
}
|
||||
|
||||
bool pwrPressed()
|
||||
{
|
||||
return GPIO_ReadInputDataBit(PWR_ON_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
|
||||
}
|
||||
|
||||
void pwrResetHandler()
|
||||
{
|
||||
RCC->AHB1ENR |= PWR_RCC_AHB1Periph;
|
||||
|
||||
// these two NOPs are needed (see STM32F errata sheet) before the peripheral
|
||||
// register can be written after the peripheral clock was enabled
|
||||
__ASM volatile ("nop");
|
||||
__ASM volatile ("nop");
|
||||
|
||||
if (WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
|
||||
pwrOn();
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@ void simuSetKey(uint8_t key, bool state)
|
||||
keysStates[key] = state;
|
||||
}
|
||||
|
||||
bool trimsStates[NUM_TRIMS * 2] = { false };
|
||||
bool trimsStates[NUM_TRIMS_KEYS] = { false };
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
// TRACE("simuSetTrim(%d, %d)", trim, state);
|
||||
@@ -496,17 +496,17 @@ void pwrOff()
|
||||
void readKeysAndTrims()
|
||||
{
|
||||
uint8_t index = 0;
|
||||
uint32_t keys_input = readKeys();
|
||||
for (uint8_t i = 1; i != uint8_t(1 << TRM_BASE); i <<= 1) {
|
||||
keys[index++].input(keys_input & i);
|
||||
auto keysInput = readKeys();
|
||||
for (auto mask = (1 << 0); mask < (1 << TRM_BASE); mask <<= 1) {
|
||||
keys[index++].input(keysInput & mask);
|
||||
}
|
||||
|
||||
uint32_t trims_input = readTrims();
|
||||
for (uint8_t i = 1; i != uint8_t(1 << 8); i <<= 1) {
|
||||
keys[index++].input(trims_input & i);
|
||||
auto trimsInput = readTrims();
|
||||
for (auto mask = (1 << 0); mask < (1 << NUM_TRIMS_KEYS); mask <<= 1) {
|
||||
keys[index++].input(trimsInput & mask);
|
||||
}
|
||||
|
||||
if (keys_input || trims_input) {
|
||||
if (keysInput || trimsInput) {
|
||||
backlightOn();
|
||||
}
|
||||
}
|
||||
@@ -525,7 +525,7 @@ uint32_t readKeys()
|
||||
{
|
||||
uint32_t result = 0;
|
||||
|
||||
for (int i=0; i<NUM_KEYS; i++) {
|
||||
for (int i = 0; i < NUM_KEYS; i++) {
|
||||
if (keysStates[i]) {
|
||||
// TRACE("key pressed %d", i);
|
||||
result |= 1 << i;
|
||||
@@ -539,7 +539,7 @@ uint32_t readTrims()
|
||||
{
|
||||
uint32_t result = 0;
|
||||
|
||||
for (int i=0; i<NUM_TRIMS*2; i++) {
|
||||
for (int i=0; i<NUM_TRIMS_KEYS; i++) {
|
||||
if (trimsStates[i]) {
|
||||
// TRACE("trim pressed %d", i);
|
||||
result |= 1 << i;
|
||||
|
||||
@@ -214,6 +214,13 @@ void sdInit(void)
|
||||
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_open(&g_bluetoothFile, LOGS_PATH "/bluetooth.log", FA_OPEN_ALWAYS | FA_WRITE);
|
||||
if (f_size(&g_bluetoothFile) > 0) {
|
||||
f_lseek(&g_bluetoothFile, f_size(&g_bluetoothFile)); // append
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
TRACE_SIMPGMSPACE("f_mount() failed");
|
||||
@@ -226,6 +233,9 @@ void sdDone()
|
||||
audioQueue.stopSD();
|
||||
#if defined(LOG_TELEMETRY)
|
||||
f_close(&g_telemetryFile);
|
||||
#endif
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_close(&g_bluetoothFile);
|
||||
#endif
|
||||
f_mount(NULL, "", 0); // unmount SD
|
||||
}
|
||||
|
||||
@@ -162,6 +162,14 @@ elseif(PCB STREQUAL X7)
|
||||
set(BLUETOOTH YES)
|
||||
add_definitions(-DBLUETOOTH_PROBE)
|
||||
set(ROTARY_ENCODER YES)
|
||||
if(DEFINED PCBREV_HARDCODED)
|
||||
# This *can* be used to prevent messing with PA14 (SWCLK), so stlink can be used
|
||||
# without interruptions.
|
||||
if(NOT ${PCBREV_HARDCODED} MATCHES "^[0-1]$")
|
||||
message(FATAL_ERROR "PCBREV_HARDCODED must be 0 or 1, not '${PCBREV_HARDCODED}'")
|
||||
endif()
|
||||
add_definitions(-DPCBREV_HARDCODED=${PCBREV_HARDCODED})
|
||||
endif()
|
||||
endif()
|
||||
elseif(PCB STREQUAL X9LITE)
|
||||
option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module" OFF)
|
||||
@@ -201,7 +209,7 @@ elseif(PCB STREQUAL X9LITES)
|
||||
set(FLAVOUR x9lites)
|
||||
add_definitions(-DBOARD_NAME="x9lites")
|
||||
add_definitions(-DPCBX9LITES -DPCBX9LITE -DPCBX9 -DSOFTWARE_VOLUME -DHARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
add_definitions(-DEEPROM_VARIANT=0x0800)
|
||||
add_definitions(-DEEPROM_VARIANT=0x0801)
|
||||
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||
set(PXX2 ON)
|
||||
set(GUI_DIR 128x64)
|
||||
@@ -381,7 +389,7 @@ set(FIRMWARE_TARGET_SRC
|
||||
${LCD_DRIVER}
|
||||
board.cpp
|
||||
i2c_driver.cpp
|
||||
pwr_driver.cpp
|
||||
../common/arm/stm32/pwr_driver.cpp
|
||||
../common/arm/stm32/heartbeat_driver.cpp
|
||||
../common/arm/loadboot.cpp
|
||||
)
|
||||
|
||||
@@ -116,7 +116,7 @@ void boardInit()
|
||||
BT_RCC_APB2Periph,
|
||||
ENABLE);
|
||||
|
||||
#if defined(BLUETOOTH)
|
||||
#if defined(BLUETOOTH) && !defined(PCBX9E)
|
||||
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -61,6 +61,13 @@ void boardOff();
|
||||
void init2MhzTimer();
|
||||
void init5msTimer();
|
||||
|
||||
// PCBREV driver
|
||||
enum {
|
||||
// X7
|
||||
PCBREV_X7_STD = 0,
|
||||
PCBREV_X7_40 = 1,
|
||||
};
|
||||
|
||||
// SD driver
|
||||
#define BLOCK_SIZE 512 /* Block Size in Bytes */
|
||||
#if !defined(SIMU) || defined(SIMU_DISKIO)
|
||||
@@ -529,28 +536,27 @@ enum Analogs {
|
||||
#define NUM_MOUSE_ANALOGS 0
|
||||
#define STORAGE_NUM_MOUSE_ANALOGS 0
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
#define NUM_TRIMS_KEYS 4
|
||||
#else
|
||||
#define NUM_TRIMS_KEYS (NUM_TRIMS * 2)
|
||||
#endif
|
||||
|
||||
#if defined(STICKS_PWM)
|
||||
#define NUM_PWMSTICKS 4
|
||||
#define STICKS_PWM_ENABLED() (!hardwareOptions.sticksPwmDisabled)
|
||||
void sticksPwmInit();
|
||||
void sticksPwmRead(uint16_t * values);
|
||||
extern volatile uint32_t pwm_interrupt_count; // TODO => reusable buffer (boot section)
|
||||
#define NUM_TRIMS_KEYS 4
|
||||
#else
|
||||
#define NUM_TRIMS_KEYS 8
|
||||
#define STICKS_PWM_ENABLED() false
|
||||
#endif
|
||||
|
||||
#if NUM_PWMSTICKS > 0
|
||||
PACK(typedef struct {
|
||||
uint8_t pcbrev:2;
|
||||
uint8_t sticksPwmDisabled:1;
|
||||
uint8_t pxx2Enabled:1;
|
||||
}) HardwareOptions;
|
||||
#else
|
||||
PACK(typedef struct {
|
||||
uint8_t pxx2Enabled:1;
|
||||
}) HardwareOptions;
|
||||
#endif
|
||||
|
||||
extern HardwareOptions hardwareOptions;
|
||||
|
||||
@@ -701,7 +707,7 @@ void telemetryPortInvertedInit(uint32_t baudrate);
|
||||
#if defined(PCBX7ACCESS)
|
||||
#define HAS_SPORT_UPDATE_CONNECTOR() true
|
||||
#elif defined(PCBX7)
|
||||
#define IS_PCBREV_40() (GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN) == Bit_SET)
|
||||
#define IS_PCBREV_40() (hardwareOptions.pcbrev == PCBREV_X7_40)
|
||||
#define HAS_SPORT_UPDATE_CONNECTOR() IS_PCBREV_40()
|
||||
#elif defined(SPORT_UPDATE_PWR_GPIO)
|
||||
#define HAS_SPORT_UPDATE_CONNECTOR() true
|
||||
|
||||
@@ -978,10 +978,15 @@ void sdPoll10ms()
|
||||
// TODO everything here should not be in the driver layer ...
|
||||
|
||||
FATFS g_FATFS_Obj;
|
||||
|
||||
#if defined(LOG_TELEMETRY)
|
||||
FIL g_telemetryFile = {};
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
FIL g_bluetoothFile = {};
|
||||
#endif
|
||||
|
||||
#if defined(BOOT)
|
||||
void sdInit(void)
|
||||
{
|
||||
@@ -1016,6 +1021,13 @@ void sdMount()
|
||||
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_open(&g_bluetoothFile, LOGS_PATH "/bluetooth.log", FA_OPEN_ALWAYS | FA_WRITE);
|
||||
if (f_size(&g_bluetoothFile) > 0) {
|
||||
f_lseek(&g_bluetoothFile, f_size(&g_bluetoothFile)); // append
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1025,6 +1037,9 @@ void sdDone()
|
||||
audioQueue.stopSD();
|
||||
#if defined(LOG_TELEMETRY)
|
||||
f_close(&g_telemetryFile);
|
||||
#endif
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_close(&g_bluetoothFile);
|
||||
#endif
|
||||
f_mount(nullptr, "", 0); // unmount SD
|
||||
}
|
||||
|
||||
@@ -986,23 +986,24 @@
|
||||
#define INTMODULE_PWR_GPIO GPIOD
|
||||
#define INTMODULE_PWR_GPIO_PIN GPIO_Pin_9 // PD.09
|
||||
#endif
|
||||
#define INTMODULE_GPIO GPIOB
|
||||
#define INTMODULE_TX_GPIO_PIN GPIO_Pin_6 // PB.06
|
||||
#define INTMODULE_RX_GPIO_PIN GPIO_Pin_7 // PB.07
|
||||
#define INTMODULE_GPIO_PinSource_TX GPIO_PinSource6
|
||||
#define INTMODULE_GPIO_PinSource_RX GPIO_PinSource7
|
||||
#define INTMODULE_USART USART1
|
||||
#define INTMODULE_GPIO_AF GPIO_AF_USART1
|
||||
#define INTMODULE_USART_IRQHandler USART1_IRQHandler
|
||||
#define INTMODULE_USART_IRQn USART1_IRQn
|
||||
#define INTMODULE_DMA_STREAM DMA2_Stream7
|
||||
#define INTMODULE_GPIO GPIOB
|
||||
#define INTMODULE_TX_GPIO_PIN GPIO_Pin_6 // PB.06
|
||||
#define INTMODULE_RX_GPIO_PIN GPIO_Pin_7 // PB.07
|
||||
#define INTMODULE_GPIO_PinSource_TX GPIO_PinSource6
|
||||
#define INTMODULE_GPIO_PinSource_RX GPIO_PinSource7
|
||||
#define INTMODULE_USART USART1
|
||||
#define INTMODULE_GPIO_AF GPIO_AF_USART1
|
||||
#define INTMODULE_USART_IRQHandler USART1_IRQHandler
|
||||
#define INTMODULE_USART_IRQn USART1_IRQn
|
||||
#define INTMODULE_DMA_STREAM DMA2_Stream7
|
||||
#define INTMODULE_DMA_STREAM_IRQ DMA2_Stream7_IRQn
|
||||
#define INTMODULE_DMA_STREAM_IRQHandler DMA2_Stream7_IRQHandler
|
||||
#define INTMODULE_DMA_FLAG_TC DMA_IT_TCIF7
|
||||
#define INTMODULE_DMA_CHANNEL DMA_Channel_4
|
||||
#define INTMODULE_DMA_FLAG_TC DMA_IT_TCIF7
|
||||
#define INTMODULE_DMA_CHANNEL DMA_Channel_4
|
||||
#if defined(PCBXLITES)
|
||||
#define INTMODULE_BOOTCMD_GPIO GPIOC
|
||||
#define INTMODULE_BOOTCMD_GPIO_PIN GPIO_Pin_8 // PC.08
|
||||
#define INTMODULE_BOOTCMD_GPIO GPIOC
|
||||
#define INTMODULE_BOOTCMD_GPIO_PIN GPIO_Pin_8 // PC.08
|
||||
#define INIT_INTMODULE_BOOTCMD_PIN() GPIO_SetBits(INTMODULE_BOOTCMD_GPIO, INTMODULE_BOOTCMD_GPIO_PIN);
|
||||
#endif
|
||||
#elif defined(RADIO_X9DP2019)
|
||||
#define INTMODULE_RCC_APB1Periph 0
|
||||
@@ -1374,6 +1375,7 @@
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOA
|
||||
#define PCBREV_GPIO GPIOA
|
||||
#define PCBREV_GPIO_PIN GPIO_Pin_14 // PA.14
|
||||
#define PCBREV_VALUE() GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN)
|
||||
#else
|
||||
#define PCBREV_RCC_AHB1Periph 0
|
||||
#endif
|
||||
|
||||
@@ -282,7 +282,7 @@ void processFlySkyTelemetryData(uint8_t data, uint8_t * rxBuffer, uint8_t &rxBuf
|
||||
debugPrintf("[%02X %02X %02X%02X] ", rxBuffer[i*4+2], rxBuffer[i*4 + 3],
|
||||
rxBuffer[i*4 + 4], rxBuffer[i*4 + 5]);
|
||||
}
|
||||
debugPrintf("\r\n");
|
||||
debugPrintf(CRLF);
|
||||
#endif
|
||||
if (data == 0xAA) processFlySkyPacket(rxBuffer + 1);
|
||||
else if (data == 0xAC) processFlySkyPacketAC(rxBuffer + 1);
|
||||
|
||||
@@ -401,7 +401,7 @@ void processHitecTelemetryData(uint8_t data, uint8_t * rxBuffer, uint8_t &rxBuff
|
||||
for (int i=0; i<5; i++) {
|
||||
debugPrintf("%02X ", rxBuffer[4+i]);
|
||||
}
|
||||
debugPrintf("\r\n");
|
||||
debugPrintf(CRLF);
|
||||
#endif
|
||||
processHitecPacket(rxBuffer + 1);
|
||||
rxBufferCount = 0;
|
||||
|
||||
@@ -552,7 +552,7 @@ void MultiModuleStatus::getStatusString(char * statusText) const
|
||||
return;
|
||||
}
|
||||
|
||||
if (major == 1 && minor < 3 && SLOW_BLINK_ON_PHASE) {
|
||||
if (major <= 1 && minor <= 3 && revision <= 0 && patch <= 47 && SLOW_BLINK_ON_PHASE) {
|
||||
strcpy(statusText, STR_MODULE_UPGRADE);
|
||||
}
|
||||
else {
|
||||
@@ -625,7 +625,7 @@ static void processMultiTelemetryByte(const uint8_t data, uint8_t module)
|
||||
debugPrintf("[%02X%02X %02X%02X] ", rxBuffer[i*4+2], rxBuffer[i*4 + 3],
|
||||
rxBuffer[i*4 + 4], rxBuffer[i*4 + 5]);
|
||||
}
|
||||
debugPrintf("\r\n");
|
||||
debugPrintf(CRLF);
|
||||
#endif
|
||||
// Packet is complete, process it
|
||||
processMultiTelemetryPaket(rxBuffer, module);
|
||||
|
||||
@@ -434,7 +434,7 @@ void processSpektrumTelemetryData(uint8_t module, uint8_t data, uint8_t* rxBuffe
|
||||
debugPrintf("%02X%02X %02X%02X ", rxBuffer[i], rxBuffer[i + 1],
|
||||
rxBuffer[i + 2], rxBuffer[i + 3]);
|
||||
}
|
||||
debugPrintf("\r\n");
|
||||
debugPrintf(CRLF);
|
||||
#endif
|
||||
processSpektrumPacket(rxBuffer);
|
||||
rxBufferCount = 0;
|
||||
|
||||
@@ -107,17 +107,20 @@ void frskyDSetDefault(int index, uint16_t id);
|
||||
extern uint8_t telemetryProtocol;
|
||||
|
||||
#if defined (MULTIMODULE)
|
||||
#define IS_D16_MULTI(module) ((g_model.moduleData[module].getMultiProtocol() == MODULE_SUBTYPE_MULTI_FRSKY) && (g_model.moduleData[module].subType == MM_RF_FRSKY_SUBTYPE_D16 || g_model.moduleData[module].subType == MM_RF_FRSKY_SUBTYPE_D16_8CH || g_model.moduleData[module].subType == MM_RF_FRSKY_SUBTYPE_D16_LBT || g_model.moduleData[module].subType == MM_RF_FRSKY_SUBTYPE_D16_LBT_8CH))
|
||||
#define IS_HOTT_MULTI(module) (g_model.moduleData[module].getMultiProtocol() == MODULE_SUBTYPE_MULTI_HOTT)
|
||||
#if defined(HARDWARE_INTERNAL_MODULE)
|
||||
#define IS_FRSKY_SPORT_PROTOCOL() (telemetryProtocol == PROTOCOL_TELEMETRY_FRSKY_SPORT || (telemetryProtocol == PROTOCOL_TELEMETRY_MULTIMODULE && (IS_D16_MULTI(INTERNAL_MODULE)||IS_D16_MULTI(EXTERNAL_MODULE))))
|
||||
#define IS_D16_MULTI(module) ((g_model.moduleData[module].getMultiProtocol() == MODULE_SUBTYPE_MULTI_FRSKY) && (g_model.moduleData[module].subType == MM_RF_FRSKY_SUBTYPE_D16 || g_model.moduleData[module].subType == MM_RF_FRSKY_SUBTYPE_D16_8CH || g_model.moduleData[module].subType == MM_RF_FRSKY_SUBTYPE_D16_LBT || g_model.moduleData[module].subType == MM_RF_FRSKY_SUBTYPE_D16_LBT_8CH))
|
||||
#define IS_HOTT_MULTI(module) (g_model.moduleData[module].getMultiProtocol() == MODULE_SUBTYPE_MULTI_HOTT)
|
||||
#if defined(HARDWARE_INTERNAL_MODULE)
|
||||
#define IS_FRSKY_SPORT_PROTOCOL() (telemetryProtocol == PROTOCOL_TELEMETRY_FRSKY_SPORT || (telemetryProtocol == PROTOCOL_TELEMETRY_MULTIMODULE && (IS_D16_MULTI(INTERNAL_MODULE)||IS_D16_MULTI(EXTERNAL_MODULE))))
|
||||
#else
|
||||
#define IS_FRSKY_SPORT_PROTOCOL() (telemetryProtocol == PROTOCOL_TELEMETRY_FRSKY_SPORT || (telemetryProtocol == PROTOCOL_TELEMETRY_MULTIMODULE && IS_D16_MULTI(EXTERNAL_MODULE)))
|
||||
#endif
|
||||
#else
|
||||
#define IS_FRSKY_SPORT_PROTOCOL() (telemetryProtocol == PROTOCOL_TELEMETRY_FRSKY_SPORT || (telemetryProtocol == PROTOCOL_TELEMETRY_MULTIMODULE && IS_D16_MULTI(EXTERNAL_MODULE)))
|
||||
#define IS_D16_MULTI(module) false
|
||||
#define IS_HOTT_MULTI(module) false
|
||||
#define IS_FRSKY_SPORT_PROTOCOL() (telemetryProtocol == PROTOCOL_TELEMETRY_FRSKY_SPORT)
|
||||
#endif
|
||||
#else
|
||||
#define IS_FRSKY_SPORT_PROTOCOL() (telemetryProtocol == PROTOCOL_TELEMETRY_FRSKY_SPORT)
|
||||
#endif
|
||||
#define IS_SPEKTRUM_PROTOCOL() (telemetryProtocol == PROTOCOL_TELEMETRY_SPEKTRUM)
|
||||
|
||||
#define IS_SPEKTRUM_PROTOCOL() (telemetryProtocol == PROTOCOL_TELEMETRY_SPEKTRUM)
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
||||
inline bool isSportLineUsedByInternalModule()
|
||||
|
||||
@@ -821,10 +821,8 @@ const char STR_MODELS_PATH[] = MODELS_PATH;
|
||||
const char STR_MODELS_EXT[] = MODELS_EXT;
|
||||
#endif
|
||||
|
||||
#if defined(NIGHTLY_BUILD_WARNING)
|
||||
const char STR_NIGHTLY_WARNING[] = TR_NIGHTLY_WARNING;
|
||||
const char STR_NIGHTLY_NOTSAFE[] = TR_NIGHTLY_NOTSAFE;
|
||||
#endif
|
||||
const char STR_TEST_WARNING[] = TR_TEST_WARNING;
|
||||
const char STR_TEST_NOTSAFE[] = TR_TEST_NOTSAFE;
|
||||
|
||||
#if LCD_W >= 212
|
||||
const char * const STR_PHASES_HEADERS[] = TR_PHASES_HEADERS;
|
||||
|
||||
@@ -572,8 +572,8 @@ extern const char STR_THROTTLE_UPPERCASE[];
|
||||
extern const char STR_ALARMSWARN[];
|
||||
extern const char STR_SWITCHWARN[];
|
||||
extern const char STR_FAILSAFEWARN[];
|
||||
extern const char STR_NIGHTLY_WARNING[];
|
||||
extern const char STR_NIGHTLY_NOTSAFE[];
|
||||
extern const char STR_TEST_WARNING[];
|
||||
extern const char STR_TEST_NOTSAFE[];
|
||||
extern const char STR_WRONG_SDCARDVERSION[];
|
||||
extern const char STR_WARN_RTC_BATTERY_LOW[];
|
||||
extern const char STR_WARN_MULTI_LOWPOWER[];
|
||||
|
||||
@@ -363,6 +363,7 @@
|
||||
#define TR_VTRAINER_MASTER_CPPM_MODULE "Master/CPPM Module"
|
||||
#define TR_VTRAINER_MASTER_BATTERY "Master/Serial\0 "
|
||||
#define TR_VTRAINER_BLUETOOTH TR("Master/BT\0 ""Slave/BT\0", "Master/Bluetooth\0 ""Slave/Bluetooth\0 ")
|
||||
#define TR_VTRAINER_MULTI "Master/Multi"
|
||||
|
||||
#define LEN_VFAILSAFE "\011"
|
||||
#define TR_VFAILSAFE "Not set\0 ""Hold\0 ""Custom\0 ""No pulses""Receiver\0"
|
||||
@@ -486,7 +487,7 @@
|
||||
#define TR_DELAYUP "Delay up"
|
||||
#define TR_SLOWDOWN "Slow dn"
|
||||
#define TR_SLOWUP "Slow up"
|
||||
#define TR_MIXER "MIXER"
|
||||
#define TR_MIXES "MIXES"
|
||||
#define TR_CV "CV"
|
||||
#if defined(PCBNV14)
|
||||
#define TR_GV "GV"
|
||||
@@ -646,6 +647,8 @@
|
||||
#define TR_MULTI_FIXEDID TR("FixedID", "Fixed ID")
|
||||
#define TR_MULTI_OPTION TR("Option", "Option value")
|
||||
#define TR_MULTI_AUTOBIND TR(INDENT "Autobind",INDENT "Bind on channel")
|
||||
#define TR_DISABLE_CH_MAP TR("No Ch. map", "Disable Ch. map")
|
||||
#define TR_DISABLE_TELEM TR("No Telem", "Disable Telemetry")
|
||||
#define TR_MULTI_DSM_AUTODTECT TR(INDENT "Autodetect", INDENT "Autodetect format")
|
||||
#define TR_MULTI_LOWPOWER TR(INDENT "Low power", INDENT "Low power mode")
|
||||
#define TR_MODULE_TELEMETRY TR(INDENT "S.Port", INDENT "S.Port link")
|
||||
@@ -656,6 +659,8 @@
|
||||
#define TR_MODULE_NO_TELEMETRY TR3("No telemetry", "No MULTI_TELEMETRY", "No MULTI_TELEMETRY detected")
|
||||
#define TR_MODULE_WAITFORBIND "Bind to load protocol"
|
||||
#define TR_MODULE_BINDING TR("Bind...","Binding")
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebinding required"
|
||||
#define TR_REG_OK "Registration ok"
|
||||
#define TR_BIND_OK "Bind successful"
|
||||
@@ -667,6 +672,8 @@
|
||||
#define TR_MODULE_STATUS TR(INDENT "Status", INDENT "Module Status")
|
||||
#define TR_MODULE_SYNC TR(INDENT "Sync", INDENT "Module Sync")
|
||||
#define TR_MULTI_SERVOFREQ TR("Servo rate", "Servo update rate")
|
||||
#define TR_MULTI_MAX_THROW TR("Max. Throw", "Enable max. throw")
|
||||
#define TR_MULTI_RFCHAN TR("RF Channel", "Select RF channel")
|
||||
#define TR_SYNCMENU "[Sync]"
|
||||
#define TR_LIMIT INDENT "Limit"
|
||||
#define TR_MINRSSI "Min Rssi"
|
||||
@@ -733,6 +740,9 @@
|
||||
#define TR_SPECTRUM_ANALYSER_EXT "Spectrum (EXT)"
|
||||
#define TR_SPECTRUM_ANALYSER_INT "Spectrum (INT)"
|
||||
#define TR_SDCARD_FULL "SD card full"
|
||||
#define TR_NEEDS_FILE "NEEDS FILE"
|
||||
#define TR_EXT_MULTI_SPEC "opentx-inv"
|
||||
#define TR_INT_MULTI_SPEC "stm-opentx-noinv"
|
||||
#define TR_INCOMPATIBLE "Incompatible"
|
||||
#define TR_WARNING "警告"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
@@ -742,10 +752,11 @@
|
||||
#define TR_ALARMSWARN "ALARMS"
|
||||
#define TR_SWITCHWARN TR("SWITCH", "CONTROL")
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Version not safe to fly"
|
||||
#define TR_TEST_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_TEST_NOTSAFE "Version not safe to fly"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Expected ver: ","Expected version: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "RTC Battery low"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Low power mode"
|
||||
#define TR_BATTERY "BATTERY"
|
||||
#define TR_WRONG_PCBREV "Wrong PCB detected"
|
||||
#define TR_EMERGENCY_MODE "EMERGENCY MODE"
|
||||
@@ -835,7 +846,9 @@
|
||||
#define TR_FLASH_POWER_MANAGEMENT_UNIT "Flash pwr mngt unit"
|
||||
#define TR_CURRENT_VERSION TR("Curr Vers: ", "Current version: ")
|
||||
#define TR_FLASH_INTERNAL_MODULE TR("Flash int. module", "Flash internal module")
|
||||
#define TR_FLASH_INTERNAL_MULTI TR("Flash Int. Multi", "Flash Internal Multi")
|
||||
#define TR_FLASH_EXTERNAL_MODULE TR("Flash ext. module", "Flash external module")
|
||||
#define TR_FLASH_EXTERNAL_MULTI TR("Flash Ext. Multi", "Flash External Multi")
|
||||
#define TR_FIRMWARE_UPDATE_ERROR TR("FW update error", "Firmware update error")
|
||||
#define TR_FIRMWARE_UPDATE_SUCCESS "Flash successful"
|
||||
#define TR_WRITING "Writing..."
|
||||
@@ -923,6 +936,7 @@
|
||||
#define TR_ANALOGS_BTN BUTTON(TR("Anas", "Analogs"))
|
||||
#define TR_SET BUTTON("Set")
|
||||
#define TR_TRAINER "Trainer"
|
||||
#define TR_CHANS "Chans"
|
||||
#define TR_ANTENNAPROBLEM CENTER "TX antenna problem!"
|
||||
#if defined(COLORLCD)
|
||||
#define TR_MODELIDUSED "ID used in:"
|
||||
@@ -1171,3 +1185,5 @@
|
||||
#define TR_MENU_OTHER "Other"
|
||||
#define TR_MENU_INVERT "Invert"
|
||||
#define TR_JITTER_FILTER "ADC filter"
|
||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
||||
#define TR_AUTH_FAILURE "Auth-failure"
|
||||
|
||||
@@ -650,7 +650,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Párovat při zavedení protokolu"
|
||||
#define TR_MODULE_BINDING TR("Bind...","Párování")
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Nutno přepárovat"
|
||||
#define TR_REG_OK "Registrace ok"
|
||||
#define TR_BIND_OK "Úspěšné párovaní"
|
||||
@@ -742,8 +742,8 @@
|
||||
#define TR_ALARMSWARN "ALARMU"
|
||||
#define TR_SWITCHWARN "POZICE"
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NOČNÍ", "NOČNÍ SESTAVENÍ")
|
||||
#define TR_NIGHTLY_NOTSAFE "Verze není bezpečná k létání"
|
||||
#define TR_TEST_WARNING TR("NOČNÍ", "NOČNÍ SESTAVENÍ")
|
||||
#define TR_TEST_NOTSAFE "Use for tests only"
|
||||
#define TR_WRONG_SDCARDVERSION "Očekávaná ver.: "
|
||||
#define TR_WARN_RTC_BATTERY_LOW "Slabá RTC baterie"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Low power mode"
|
||||
|
||||
@@ -658,7 +658,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Bind to load protocol"
|
||||
#define TR_MODULE_BINDING "Binding"
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebinding required"
|
||||
#define TR_REG_OK "Registration ok"
|
||||
#define TR_BIND_OK "Bind successful"
|
||||
@@ -749,8 +749,8 @@
|
||||
#define TR_ALARMSWARN "ALARM"
|
||||
#define TR_SWITCHWARN "SCHALTER"
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Nicht für Flug geeignet"
|
||||
#define TR_TEST_WARNING TR("TESTING", "TEST BUILD")
|
||||
#define TR_TEST_NOTSAFE "Use for tests only"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Erw. Version: ","Erwartete Version: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "RTC Battery low"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Low power mode"
|
||||
|
||||
@@ -654,7 +654,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Bind to load protocol"
|
||||
#define TR_MODULE_BINDING TR("Bind...","Binding")
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebinding required"
|
||||
#define TR_REG_OK "Registration ok"
|
||||
#define TR_BIND_OK "Bind successful"
|
||||
@@ -746,8 +746,8 @@
|
||||
#define TR_ALARMSWARN "ALARMS"
|
||||
#define TR_SWITCHWARN TR("SWITCH", "CONTROL")
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Version not safe to fly"
|
||||
#define TR_TEST_WARNING TR("TESTING", "TEST BUILD")
|
||||
#define TR_TEST_NOTSAFE "Use for tests only"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Expected ver: ", "Expected version: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "RTC Battery low"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Low power mode"
|
||||
|
||||
@@ -680,7 +680,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Bind to load protocol"
|
||||
#define TR_MODULE_BINDING "Binding"
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebinding required"
|
||||
#define TR_REG_OK "Registration ok"
|
||||
#define TR_BIND_OK "Bind successful"
|
||||
@@ -772,9 +772,9 @@
|
||||
#define TR_ALARMSWARN "ALARMAS"
|
||||
#define TR_SWITCHWARN "INTERPTOR"
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Version not safe to fly"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Expected ver: ","Expected version: ")
|
||||
#define TR_TEST_WARNING TR("TESTING", "TEST BUILD")
|
||||
#define TR_TEST_NOTSAFE "Use for tests only"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Expected ver: ","Expected version: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "RTC Battery low"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Low power mode"
|
||||
#define TR_BATTERY "BATTERY"
|
||||
|
||||
@@ -674,7 +674,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Bind to load protocol"
|
||||
#define TR_MODULE_BINDING "Binding"
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebinding required"
|
||||
#define TR_REG_OK "Registration ok"
|
||||
#define TR_BIND_OK "Bind successful"
|
||||
@@ -766,8 +766,8 @@
|
||||
#define TR_ALARMSWARN "ALARMS"
|
||||
#define TR_SWITCHWARN TR("SWITCH","CONTROL")
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Version not safe to fly"
|
||||
#define TR_TEST_WARNING TR("TESTING", "TEST BUILD")
|
||||
#define TR_TEST_NOTSAFE "Use for tests only"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Expected ver: ","Expected version: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "RTC Battery low"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Low power mode"
|
||||
|
||||
@@ -678,7 +678,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Binder d'abord"
|
||||
#define TR_MODULE_BINDING "Bind..."
|
||||
#define TR_MODULE_UPGRADE_ALERT "Mise à jour requise"
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebind requis"
|
||||
#define TR_REG_OK "Enregistr. ok"
|
||||
#define TR_BIND_OK "Bind ok"
|
||||
@@ -769,8 +769,8 @@
|
||||
#define TR_ALARMSWARN "SON"
|
||||
#define TR_SWITCHWARN TR("INTERS","CONTROLES")
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Version de test uniq."
|
||||
#define TR_TEST_WARNING TR("TESTING", "TEST BUILD")
|
||||
#define TR_TEST_NOTSAFE "Version de test uniq."
|
||||
#define TR_WRONG_SDCARDVERSION "Version requise: "
|
||||
#define TR_WARN_RTC_BATTERY_LOW "Batterie RTC faible"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Mode basse puis."
|
||||
|
||||
@@ -771,8 +771,8 @@
|
||||
#define TR_ALARMSWARN "ALLARMI"
|
||||
#define TR_SWITCHWARN "CONTROLLI"
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Versione non sicura"
|
||||
#define TR_TEST_WARNING TR("PER TEST", "BUILD PER TEST")
|
||||
#define TR_TEST_NOTSAFE "Usare solo per test"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Richiede ver: ", "Richiede versione: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "Batteria RTC scarica"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Modalità bassa pot."
|
||||
|
||||
@@ -661,7 +661,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Bind to load protocol"
|
||||
#define TR_MODULE_BINDING "Binding"
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebinding required"
|
||||
#define TR_REG_OK "Registration ok"
|
||||
#define TR_BIND_OK "Bind successful"
|
||||
@@ -753,8 +753,8 @@
|
||||
#define TR_ALARMSWARN "ALARM"
|
||||
#define TR_SWITCHWARN "SCHAKELAAR"
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Version not safe to fly"
|
||||
#define TR_TEST_WARNING TR("TESTING", "TEST BUILD")
|
||||
#define TR_TEST_NOTSAFE "Use for tests only"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Verwachte ver: ","Verwachte versie: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "RTC Battery low"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Low power mode"
|
||||
|
||||
@@ -675,7 +675,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Bind to load protocol"
|
||||
#define TR_MODULE_BINDING "Binding"
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebinding required"
|
||||
#define TR_REG_OK "Registration ok"
|
||||
#define TR_BIND_OK "Bind successful"
|
||||
@@ -767,8 +767,8 @@
|
||||
#define TR_ALARMSWARN "ALARM"
|
||||
#define TR_SWITCHWARN TR("Przełą","Kontrola")
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Version not safe to fly"
|
||||
#define TR_TEST_WARNING TR("TESTING", "TEST BUILD")
|
||||
#define TR_TEST_NOTSAFE "Use for tests only"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Expected ver: ","Expected version: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "RTC Battery low"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Low power mode"
|
||||
|
||||
@@ -666,7 +666,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Bind to load protocol"
|
||||
#define TR_MODULE_BINDING "Binding"
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebinding required"
|
||||
#define TR_REG_OK "Registration ok"
|
||||
#define TR_BIND_OK "Bind successful"
|
||||
@@ -757,8 +757,8 @@
|
||||
#define TR_ALARMSWARN "ALARMES"
|
||||
#define TR_SWITCHWARN "CHAVES"
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Version not safe to fly"
|
||||
#define TR_TEST_WARNING TR("TESTING", "TEST BUILD")
|
||||
#define TR_TEST_NOTSAFE "Use for tests only"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Expected ver: ","Expected version: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "RTC Battery low"
|
||||
#define TR_WARN_MULTI_LOWPOWER "Low power mode"
|
||||
|
||||
@@ -678,7 +678,7 @@
|
||||
#define TR_MODULE_WAITFORBIND "Bind to load protocol"
|
||||
#define TR_MODULE_BINDING "Binding"
|
||||
#define TR_MODULE_UPGRADE_ALERT TR3("Upg. needed", "Module upgrade required", "Module\nUpgrade required")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. needed", "Module update recommended")
|
||||
#define TR_MODULE_UPGRADE TR("Upg. advised", "Module update recommended")
|
||||
#define TR_REBIND "Rebinding required"
|
||||
#define TR_REG_OK "Registration ok"
|
||||
#define TR_BIND_OK "Bind successful"
|
||||
@@ -769,8 +769,8 @@
|
||||
#define TR_ALARMSWARN "ALARM"
|
||||
#define TR_SWITCHWARN "BRYTARE"
|
||||
#define TR_FAILSAFEWARN "FAILSAFE"
|
||||
#define TR_NIGHTLY_WARNING TR("NIGHTLY", "NIGHTLY BUILD")
|
||||
#define TR_NIGHTLY_NOTSAFE "Version not safe to fly"
|
||||
#define TR_TEST_WARNING TR("TESTING", "TEST BUILD")
|
||||
#define TR_TEST_NOTSAFE "Use for tests only"
|
||||
#define TR_SDCARDVERSIONWARN "SD Card Check"
|
||||
#define TR_WRONG_SDCARDVERSION TR("Expected ver: ","Expected version: ")
|
||||
#define TR_WARN_RTC_BATTERY_LOW "RTC Battery low"
|
||||
|
||||
@@ -30,7 +30,7 @@ def build_target(target, path, cmake_options):
|
||||
suffix = os.environ["OPENTX_VERSION_SUFFIX"]
|
||||
cmd.append('-DVERSION_SUFFIX="%s"' % suffix)
|
||||
if suffix.startswith("N"):
|
||||
cmd.append('-DNIGHTLY_BUILD_WARNING=YES')
|
||||
cmd.append('-DTEST_BUILD_WARNING=YES')
|
||||
cmd.append(srcdir)
|
||||
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
@@ -96,6 +96,11 @@ def main():
|
||||
cmake_options["PCB"] = "X7"
|
||||
firmware_options = options_taranis_x9dp
|
||||
maxsize = 65536 * 8
|
||||
elif options[optcount] == "x7access":
|
||||
cmake_options["PCB"] = "X7"
|
||||
cmake_options["PCBREV"] = "ACCESS"
|
||||
firmware_options = options_taranis_x9dp
|
||||
maxsize = 65536 * 8
|
||||
elif board_name == "xlite":
|
||||
cmake_options["PCB"] = "XLITE"
|
||||
firmware_options = options_taranis_xlite
|
||||
|
||||
@@ -25,7 +25,7 @@ done
|
||||
SRCDIR=$1
|
||||
OUTDIR=$2
|
||||
|
||||
COMMON_OPTIONS="-DALLOW_NIGHTLY_BUILDS=YES -DNIGHTLY_BUILD_WARNING=YES -DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES"
|
||||
COMMON_OPTIONS="-DALLOW_NIGHTLY_BUILDS=YES -DTEST_BUILD_WARNING=YES -DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES"
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
COMMON_OPTIONS="${COMMON_OPTIONS} -DCMAKE_PREFIX_PATH=~/Qt/5.7/clang_64/ -DCMAKE_OSX_DEPLOYMENT_TARGET='10.9'"
|
||||
fi
|
||||
@@ -94,7 +94,7 @@ cmake ${COMMON_OPTIONS} -DPCB=X10 ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X10 -DPCBREV=T16 ${SRCDIR}
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=YES ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
|
||||
@@ -40,48 +40,71 @@ cd build
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=AR9X ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=SKY9X ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=9XRPRO ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X9LITE ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X9LITES ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X7 ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X7 -DPCBREV=T12 ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X9D ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X9D+ ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X9D+ -DPCBREV=2019 ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=XLITE ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=XLITES ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X9E ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X10 ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X10 -DPCBREV=T16 -DINTERNAL_MODULE_MULTI=YES ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X10 -DPCBREV=EXPRESS ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
cmake ${COMMON_OPTIONS} -DPCB=X12S ${SRCDIR}
|
||||
make -j${JOBS} libsimulator
|
||||
rm CMakeCache.txt
|
||||
|
||||
make -j${JOBS} package
|
||||
|
||||
|
||||
Executable
+118
@@ -0,0 +1,118 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import os
|
||||
from builtins import NotADirectoryError
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
|
||||
boards = {
|
||||
"XLITE": {
|
||||
"PCB": "XLITE",
|
||||
},
|
||||
"XLITES": {
|
||||
"PCB": "XLITES",
|
||||
},
|
||||
"X9LITE": {
|
||||
"PCB": "X9LITE",
|
||||
},
|
||||
"X9LITES": {
|
||||
"PCB": "X9LITES",
|
||||
},
|
||||
"X9D": {
|
||||
"PCB": "X9D+",
|
||||
},
|
||||
"X9D+": {
|
||||
"PCB": "X9D+",
|
||||
},
|
||||
"X9D+2019": {
|
||||
"PCB": "X9D+",
|
||||
"PCBREV": "2019",
|
||||
},
|
||||
"X9E": {
|
||||
"PCB": "X9E",
|
||||
},
|
||||
"X7": {
|
||||
"PCB": "X7",
|
||||
},
|
||||
"X7ACCESS": {
|
||||
"PCB": "X7",
|
||||
"PCBREV": "ACCESS",
|
||||
},
|
||||
"X10": {
|
||||
"PCB": "X10",
|
||||
},
|
||||
"X10EXPRESS": {
|
||||
"PCB": "X10",
|
||||
"PCBREV": "EXPRESS",
|
||||
},
|
||||
"X12S": {
|
||||
"PCB": "X12S",
|
||||
},
|
||||
"T16": {
|
||||
"PCB": "X10",
|
||||
"PCBREV": "T16",
|
||||
"INTERNAL_MODULE_MULTI": "YES"
|
||||
},
|
||||
"T12": {
|
||||
"PCB": "X7",
|
||||
"PCBREV": "T12",
|
||||
},
|
||||
}
|
||||
|
||||
translations = [
|
||||
"EN"
|
||||
]
|
||||
|
||||
|
||||
def timestamp():
|
||||
return datetime.datetime.now().strftime("%y%m%d")
|
||||
|
||||
|
||||
def build(board, translation, srcdir):
|
||||
cmake_options = " ".join(["-D%s=%s" % (key, value) for key, value in boards[board].items()])
|
||||
cwd = os.getcwd()
|
||||
if not os.path.exists("output"):
|
||||
os.mkdir("output")
|
||||
path = tempfile.mkdtemp()
|
||||
os.chdir(path)
|
||||
command = "cmake %s -DTRANSLATIONS=%s -DTBS_RELEASE=YES -DTEST_BUILD_WARNING=YES %s" % (cmake_options, translation, srcdir)
|
||||
print(command)
|
||||
os.system(command)
|
||||
os.system("make firmware -j6")
|
||||
os.chdir(cwd)
|
||||
index = 0
|
||||
while 1:
|
||||
suffix = "" if index == 0 else "_%d" % index
|
||||
filename = "output/firmware_%s_%s_%s%s.bin" % (board.lower(), translation.lower(), timestamp(), suffix)
|
||||
if not os.path.exists(filename):
|
||||
shutil.copy("%s/firmware.bin" % path, filename)
|
||||
break
|
||||
index += 1
|
||||
shutil.rmtree(path)
|
||||
|
||||
|
||||
def dir_path(string):
|
||||
if os.path.isdir(string):
|
||||
return string
|
||||
else:
|
||||
raise NotADirectoryError(string)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Build FrSky firmware")
|
||||
parser.add_argument("-b", "--boards", action="append", help="Destination boards", required=True)
|
||||
parser.add_argument("-t", "--translations", action="append", help="Translations", required=True)
|
||||
parser.add_argument("srcdir", type=dir_path)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
for board in (boards.keys() if "ALL" in args.boards else args.boards):
|
||||
for translation in (translations if "ALL" in args.translations else args.translations):
|
||||
build(board, translation, args.srcdir)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user