mirror of
https://github.com/opentx/opentx.git
synced 2025-07-12 10:59:54 +03:00
parent
5bf197439a
commit
5d4f6679e5
41 changed files with 276 additions and 2286 deletions
|
@ -24,8 +24,6 @@ set(COMPANION_OSX_APP_BUNDLE_NAME "OpenTX Companion ${VERSION_MAJOR}.${VERSION_M
|
|||
# On OS X we copy dfu-util to the application bundle. This the path from which we copy
|
||||
# the binary (default homebrew path)
|
||||
set(DFU_UTIL_PATH "/usr/local/bin/dfu-util")
|
||||
set(AVRDUDE_PATH "/usr/local/bin/avrdude")
|
||||
set(AVRDUDE_CONF "/usr/local/etc/avrdude.conf")
|
||||
|
||||
option(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
|
||||
if(ALLOW_NIGHTLY_BUILDS)
|
||||
|
@ -239,7 +237,6 @@ set(companion_SRCS
|
|||
flasheepromdialog.cpp
|
||||
printdialog.cpp
|
||||
modelprinter.cpp
|
||||
fusesdialog.cpp
|
||||
logsdialog.cpp
|
||||
downloaddialog.cpp
|
||||
splashlibrarydialog.cpp
|
||||
|
@ -259,7 +256,6 @@ set(companion_MOC_HDRS
|
|||
burnconfigdialog.h
|
||||
comparedialog.h
|
||||
printdialog.h
|
||||
fusesdialog.h
|
||||
logsdialog.h
|
||||
creditsdialog.h
|
||||
releasenotesdialog.h
|
||||
|
@ -291,7 +287,6 @@ set(companion_MOC_HDRS
|
|||
set(companion_UIS
|
||||
mdichild.ui
|
||||
comparedialog.ui
|
||||
fusesdialog.ui
|
||||
logsdialog.ui
|
||||
apppreferencesdialog.ui
|
||||
fwpreferencesdialog.ui
|
||||
|
@ -407,7 +402,7 @@ elseif(WIN32)
|
|||
install(TARGETS ${SIMULATOR_NAME} DESTINATION ${INSTALL_DESTINATION})
|
||||
install(FILES ${simulator_plugins} DESTINATION "${INSTALL_DESTINATION}")
|
||||
# supporting utilities
|
||||
set(INSTALL_TEMP_FILES avrdude.exe avrdude.conf dfu-util.exe libusb0.dll libusb-1.0.dll license.txt)
|
||||
set(INSTALL_TEMP_FILES dfu-util.exe libusb0.dll libusb-1.0.dll license.txt)
|
||||
foreach(tmpfile ${INSTALL_TEMP_FILES})
|
||||
install(FILES "${COMPANION_SRC_DIRECTORY}/../targets/windows/${tmpfile}" DESTINATION ${INSTALL_DESTINATION})
|
||||
endforeach()
|
||||
|
@ -554,14 +549,11 @@ IF(APPLE)
|
|||
set(${COMPANION_SOURCES} ${COMPANION_SOURCES} ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE})
|
||||
install(FILES ${MAC_ICON_FILE} DESTINATION ${companion_res_dir} COMPONENT Runtime)
|
||||
|
||||
# Copy dfu-util and avrdude, resolve symlink first
|
||||
# Copy dfu-util, resolve symlink first
|
||||
get_filename_component(DFU_UTIL_ABSOLUTE_PATH ${DFU_UTIL_PATH} REALPATH)
|
||||
get_filename_component(AVRDUDE_ABSOLUTE_PATH ${AVRDUDE_PATH} REALPATH)
|
||||
get_filename_component(AVRDUDECONF_ABSOLUTE_PATH ${AVRDUDE_CONF} REALPATH)
|
||||
install(PROGRAMS ${DFU_UTIL_ABSOLUTE_PATH} ${AVRDUDE_ABSOLUTE_PATH} DESTINATION ${companion_res_dir} COMPONENT Runtime)
|
||||
install(FILES ${AVRDUDECONF_ABSOLUTE_PATH} DESTINATION ${companion_res_dir} COMPONENT Runtime)
|
||||
install(PROGRAMS ${DFU_UTIL_ABSOLUTE_PATH} DESTINATION ${companion_res_dir} COMPONENT Runtime)
|
||||
|
||||
set(bundle_tools_path "\${CMAKE_INSTALL_PREFIX}/${companion_res_dir}/dfu-util;\${CMAKE_INSTALL_PREFIX}/${companion_res_dir}/avrdude")
|
||||
set(bundle_tools_path "\${CMAKE_INSTALL_PREFIX}/${companion_res_dir}/dfu-util;")
|
||||
|
||||
|
||||
# Include depencies (adding frameworks, fixing the embbeded libraries)
|
||||
|
|
|
@ -36,61 +36,23 @@ burnConfigDialog::burnConfigDialog(QWidget *parent) :
|
|||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("configure.png"));
|
||||
ui->avrdude_programmer->model()->sort(0);
|
||||
|
||||
getSettings();
|
||||
populateProgrammers();
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_STM32(board)) {
|
||||
setWindowTitle(tr("DFU-UTIL Configuration"));
|
||||
ui->avrArgs->hide();
|
||||
ui->avrdude_location->hide();
|
||||
ui->avrdude_port->hide();
|
||||
ui->avrdude_programmer->hide();
|
||||
ui->label_av1->hide();
|
||||
ui->label_av2->hide();
|
||||
ui->label_av4->hide();
|
||||
ui->label_av5->hide();
|
||||
ui->pushButton->hide();
|
||||
ui->pushButton_3->hide();
|
||||
ui->pushButton_4->hide();
|
||||
ui->label_sb1->hide();
|
||||
ui->label_sb3->hide();
|
||||
ui->samba_location->hide();
|
||||
ui->samba_port->hide();
|
||||
ui->sb_browse->hide();
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
setWindowTitle(tr("SAM-BA Configuration"));
|
||||
ui->avrArgs->hide();
|
||||
ui->avrdude_location->hide();
|
||||
ui->avrdude_port->hide();
|
||||
ui->avrdude_programmer->hide();
|
||||
ui->label_av1->hide();
|
||||
ui->label_av2->hide();
|
||||
ui->label_av4->hide();
|
||||
ui->label_av5->hide();
|
||||
ui->pushButton->hide();
|
||||
ui->pushButton_3->hide();
|
||||
ui->pushButton_4->hide();
|
||||
ui->label_dfu1->hide();
|
||||
ui->dfu_location->hide();
|
||||
ui->dfu_browse->hide();
|
||||
}
|
||||
else {
|
||||
setWindowTitle(tr("AVRDUDE Configuration"));
|
||||
ui->label_sb1->hide();
|
||||
ui->label_sb3->hide();
|
||||
ui->samba_location->hide();
|
||||
ui->samba_port->hide();
|
||||
ui->sb_browse->hide();
|
||||
setWindowTitle(tr("SAM-BA Configuration"));
|
||||
ui->label_dfu1->hide();
|
||||
ui->label_dfu2->hide();
|
||||
ui->dfu_location->hide();
|
||||
ui->dfu_browse->hide();
|
||||
}
|
||||
ui->label_av3->hide();
|
||||
ui->avrdude_mcu->hide();
|
||||
ui->label_sb2->hide();
|
||||
ui->arm_mcu->hide();
|
||||
ui->label_dfu2->hide();
|
||||
|
@ -105,46 +67,26 @@ burnConfigDialog::~burnConfigDialog()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
QStringList burnConfigDialog::getAvrdudeArgs()
|
||||
{
|
||||
QStringList args = avrArgs;
|
||||
if (!avrPort.isEmpty())
|
||||
args << "-P" << avrPort;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
args << "-C" << QFileInfo(QApplication::applicationDirPath() + "/../Resources/avrdude.conf").absoluteFilePath();
|
||||
#endif
|
||||
return args;
|
||||
}
|
||||
|
||||
void burnConfigDialog::getSettings()
|
||||
{
|
||||
avrLoc = g.avrdudeLocation();
|
||||
sambaLoc = g.sambaLocation();
|
||||
dfuLoc = g.dfuLocation();
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
if ( avrLoc.isEmpty())
|
||||
avrLoc = QFileInfo("avrdude.exe").absoluteFilePath();
|
||||
if ( sambaLoc.isEmpty())
|
||||
sambaLoc = QFileInfo("sam-ba.exe").absoluteFilePath();
|
||||
if ( dfuLoc.isEmpty())
|
||||
dfuLoc = QFileInfo("dfu-util.exe").absoluteFilePath();
|
||||
#elif defined __APPLE__
|
||||
if ( avrLoc.isEmpty())
|
||||
avrLoc = QFileInfo(QApplication::applicationDirPath() + "/../Resources/avrdude").absoluteFilePath();
|
||||
if ( sambaLoc.isEmpty())
|
||||
sambaLoc = "/usr/local/bin/sam-ba";
|
||||
if ( dfuLoc.isEmpty())
|
||||
dfuLoc = QFileInfo(QApplication::applicationDirPath() + "/../Resources/dfu-util").absoluteFilePath();
|
||||
#elif defined __FreeBSD__
|
||||
if (avrLoc.isEmpty())
|
||||
avrLoc = "/usr/local/bin/avrdude";
|
||||
if (dfuLoc.isEmpty())
|
||||
dfuLoc = "/usr/local/bin/dfu-util";
|
||||
#else
|
||||
if ( avrLoc.isEmpty())
|
||||
avrLoc = "/usr/bin/avrdude";
|
||||
if ( sambaLoc.isEmpty())
|
||||
sambaLoc = "/usr/bin/sam-ba";
|
||||
if ( dfuLoc.isEmpty())
|
||||
|
@ -152,45 +94,22 @@ void burnConfigDialog::getSettings()
|
|||
#endif
|
||||
|
||||
dfuArgs = g.dfuArguments().split(" ", QString::SkipEmptyParts);
|
||||
avrArgs = g.avrArguments().split(" ", QString::SkipEmptyParts);
|
||||
avrProgrammer = g.programmer();
|
||||
avrPort = g.avrPort();
|
||||
avrMCU = g.mcu();
|
||||
armMCU = g.armMcu();
|
||||
sambaPort = g.sambaPort();
|
||||
|
||||
ui->avrdude_location->setText(getAVRDUDE());
|
||||
ui->avrArgs->setText(avrArgs.join(" "));
|
||||
|
||||
ui->samba_location->setText(getSAMBA());
|
||||
ui->samba_port->setText(getSambaPort());
|
||||
|
||||
ui->dfu_location->setText(getDFU());
|
||||
ui->dfuArgs->setText(getDFUArgs().join(" "));
|
||||
|
||||
int idx1 = ui->avrdude_programmer->findText(getProgrammer());
|
||||
int idx2 = ui->avrdude_port->findText(getPort());
|
||||
int idx3 = ui->avrdude_mcu->findText(getMCU());
|
||||
int idx4 = ui->arm_mcu->findText(getArmMCU());
|
||||
if(idx1>=0) ui->avrdude_programmer->setCurrentIndex(idx1);
|
||||
if(idx2>=0) ui->avrdude_port->setCurrentIndex(idx2);
|
||||
if(idx3>=0) ui->avrdude_mcu->setCurrentIndex(idx3);
|
||||
if(idx4>=0) ui->arm_mcu->setCurrentIndex(idx4);
|
||||
QFile file;
|
||||
if (file.exists(avrLoc)) {
|
||||
ui->pushButton_3->setEnabled(true);
|
||||
} else {
|
||||
ui->pushButton_3->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void burnConfigDialog::putSettings()
|
||||
{
|
||||
g.avrdudeLocation( avrLoc );
|
||||
g.programmer( avrProgrammer);
|
||||
g.mcu( avrMCU );
|
||||
g.avrPort( avrPort );
|
||||
g.avrArguments( avrArgs.join(" ") );
|
||||
g.sambaLocation( sambaLoc );
|
||||
g.sambaPort( sambaPort );
|
||||
g.armMcu( armMCU );
|
||||
|
@ -198,73 +117,6 @@ void burnConfigDialog::putSettings()
|
|||
g.dfuArguments( dfuArgs.join(" ") );
|
||||
}
|
||||
|
||||
void burnConfigDialog::populateProgrammers()
|
||||
{
|
||||
QString fileName = QFileInfo(avrLoc).canonicalPath() + "/avrdude.conf"; //for windows
|
||||
if(!QFileInfo(fileName).exists()) fileName = "/etc/avrdude.conf"; //for linux
|
||||
if(!QFileInfo(fileName).exists()) fileName = "/etc/avrdude/avrdude.conf"; //for linux
|
||||
if(!QFileInfo(fileName).exists()) return; // not found avrdude.conf - returning
|
||||
|
||||
QFile file(fileName);
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return;
|
||||
|
||||
QStringList items;
|
||||
QString line = "";
|
||||
QString prevline = "";
|
||||
QTextStream in(&file);
|
||||
while (!in.atEnd())
|
||||
{
|
||||
prevline = line;
|
||||
line = in.readLine();
|
||||
|
||||
if(prevline.left(10).toLower()=="programmer")
|
||||
items << line.section('"',1,1);
|
||||
}
|
||||
file.close();
|
||||
|
||||
items.sort();
|
||||
|
||||
QString avrProgrammer_temp = avrProgrammer;
|
||||
ui->avrdude_programmer->clear();
|
||||
ui->avrdude_programmer->addItems(items);
|
||||
int idx1 = ui->avrdude_programmer->findText(avrProgrammer_temp);
|
||||
if(idx1>=0) ui->avrdude_programmer->setCurrentIndex(idx1);
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrdude_programmer_currentIndexChanged(QString )
|
||||
{
|
||||
avrProgrammer = ui->avrdude_programmer->currentText();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrdude_mcu_currentIndexChanged(QString )
|
||||
{
|
||||
avrMCU = ui->avrdude_mcu->currentText();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrdude_location_editingFinished()
|
||||
{
|
||||
avrLoc = ui->avrdude_location->text();
|
||||
if (avrLoc.isEmpty()) {
|
||||
ui->pushButton_3->setDisabled(true);
|
||||
} else {
|
||||
QFile file;
|
||||
if (file.exists(avrLoc)) {
|
||||
ui->pushButton_3->setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrArgs_editingFinished()
|
||||
{
|
||||
avrArgs = ui->avrArgs->text().split(" ", QString::SkipEmptyParts);
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrdude_port_currentIndexChanged(QString )
|
||||
{
|
||||
avrPort = ui->avrdude_port->currentText();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_samba_location_editingFinished()
|
||||
{
|
||||
sambaLoc = ui->samba_location->text();
|
||||
|
@ -280,17 +132,6 @@ void burnConfigDialog::on_arm_mcu_currentIndexChanged(QString )
|
|||
armMCU = ui->arm_mcu->currentText();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_pushButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Location"),ui->avrdude_location->text());
|
||||
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
ui->avrdude_location->setText(fileName);
|
||||
avrLoc = fileName;
|
||||
}
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_sb_browse_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Location"),ui->samba_location->text());
|
||||
|
@ -322,27 +163,6 @@ void burnConfigDialog::on_dfuArgs_editingFinished()
|
|||
dfuArgs = ui->dfuArgs->text().split(" ", QString::SkipEmptyParts);
|
||||
}
|
||||
|
||||
void burnConfigDialog::listAvrdudeProgrammers()
|
||||
{
|
||||
ProgressDialog progressDialog(this, tr("List available programmers"), CompanionIcon("list.png"), true);
|
||||
FlashProcess flashProcess(ui->avrdude_location->text(), QStringList() << "-c?", progressDialog.progress());
|
||||
flashProcess.run();
|
||||
}
|
||||
|
||||
// TODO choose better name when no merge in progress....
|
||||
void burnConfigDialog::on_pushButton_3_clicked()
|
||||
{
|
||||
listAvrdudeProgrammers();
|
||||
}
|
||||
|
||||
// TODO choose better name when no merge in progress....
|
||||
void burnConfigDialog::on_pushButton_4_clicked()
|
||||
{
|
||||
ProgressDialog progressDialog(this, tr("Avrdude help"), CompanionIcon("configure.png"), true);
|
||||
FlashProcess flashProcess(ui->avrdude_location->text(), QStringList() << "-?", progressDialog.progress());
|
||||
flashProcess.run();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
|
||||
{
|
||||
Board::Type board = getCurrentBoard();
|
||||
|
@ -351,31 +171,20 @@ void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
|
|||
ui->label_dfu2->show();
|
||||
ui->dfuArgs->show();
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
else {
|
||||
ui->label_sb2->show();
|
||||
ui->arm_mcu->show();
|
||||
}
|
||||
else {
|
||||
ui->label_av3->show();
|
||||
ui->avrdude_mcu->show();
|
||||
QMessageBox::warning(this, CPN_STR_APP_NAME,
|
||||
tr("<b><u>WARNING!</u></b><br>Normally CPU type is automatically selected according to the chosen firmware.<br>If you change the CPU type the resulting eeprom could be inconsistent."),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (IS_STM32(board)) {
|
||||
ui->label_dfu2->hide();
|
||||
ui->dfuArgs->hide();
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
else {
|
||||
ui->label_sb2->hide();
|
||||
ui->arm_mcu->hide();
|
||||
}
|
||||
else {
|
||||
ui->label_av3->hide();
|
||||
ui->avrdude_mcu->hide();
|
||||
}
|
||||
}
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
|
|
@ -39,45 +39,25 @@ public:
|
|||
burnConfigDialog(QWidget *parent = 0);
|
||||
~burnConfigDialog();
|
||||
|
||||
QString getAVRDUDE() {return avrLoc;}
|
||||
QString getSAMBA() {return sambaLoc;}
|
||||
QString getDFU() {return dfuLoc;}
|
||||
QStringList getAvrdudeArgs();
|
||||
QStringList getDFUArgs() {return dfuArgs;}
|
||||
QString getProgrammer() {return avrProgrammer;}
|
||||
QString getMCU() {return avrMCU;}
|
||||
QString getArmMCU() {return armMCU;}
|
||||
QString getPort() {return avrPort;}
|
||||
QString getSambaPort() {return sambaPort;}
|
||||
|
||||
void listAvrdudeProgrammers();
|
||||
|
||||
private:
|
||||
Ui::burnConfigDialog *ui;
|
||||
|
||||
void populateProgrammers();
|
||||
|
||||
QString avrLoc;
|
||||
QString sambaLoc;
|
||||
QString dfuLoc;
|
||||
QStringList avrArgs;
|
||||
QString avrProgrammer;
|
||||
QString avrMCU;
|
||||
QString armMCU;
|
||||
QString avrPort;
|
||||
QString sambaPort;
|
||||
QStringList dfuArgs;
|
||||
|
||||
private slots:
|
||||
void shrink();
|
||||
void on_avrArgs_editingFinished();
|
||||
void on_pushButton_4_clicked();
|
||||
void on_pushButton_3_clicked();
|
||||
void on_pushButton_clicked();
|
||||
void on_avrdude_location_editingFinished();
|
||||
void on_avrdude_programmer_currentIndexChanged(QString );
|
||||
void on_avrdude_mcu_currentIndexChanged(QString );
|
||||
void on_avrdude_port_currentIndexChanged(QString );
|
||||
void on_samba_location_editingFinished();
|
||||
void on_samba_port_editingFinished();
|
||||
void on_arm_mcu_currentIndexChanged(QString );
|
||||
|
|
|
@ -45,615 +45,7 @@
|
|||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="9" column="2">
|
||||
<widget class="QLineEdit" name="dfu_location">
|
||||
<property name="toolTip">
|
||||
<string>Location of sam-ba executable</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The location of the AVRDUDE executable.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">dfu-util</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_dfu1">
|
||||
<property name="text">
|
||||
<string>DFU-Util Location</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="avrdude_location">
|
||||
<property name="toolTip">
|
||||
<string>Location of AVRDUDE executable</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The location of the AVRDUDE executable.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4" rowspan="2">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="whatsThis">
|
||||
<string>Use this button to browse and look for the AVRDUDE executable file.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_av2">
|
||||
<property name="text">
|
||||
<string>Programmer</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QComboBox" name="avrdude_programmer">
|
||||
<property name="whatsThis">
|
||||
<string>Programmer used for communicating with the controller.
|
||||
Please consult the programmer's documentation and the AVRDUDE documentation to select the appropriate programmer.</string>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAlphabetically</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">c2n232i</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dasa3</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dasa</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">siprog</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">ponyser</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">89isp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">frank-stk200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">blaster</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">ere-isp-avr</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">atisp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dapa</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">xil</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">futurlec</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">abcmini</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">picoweb</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">sp12</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">alf</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">bascom</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dt006</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">pony-stk200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">bsd</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">pavr</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_pdi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_dw</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_hvsp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_pp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_isp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_jtag</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2pdi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2avr32</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtagmkII_avr32</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2dw</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2isp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2fast</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2slow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtagmkII</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag1slow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtagmkI</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avr911</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avr109</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">butterfly</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">usbtiny</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">usbasp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avr910</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk600hvsp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk600pp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk600</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500hvsp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500pp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500v2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">mib510</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500v1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">buspirate</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrisp2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrispmkII</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrispv2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrisp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">arduino</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="whatsThis">
|
||||
<string>List all available programmers.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>List Available</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QLineEdit" name="avrArgs">
|
||||
<property name="toolTip">
|
||||
<string>Extra arguments that will be passed to AVRDUDE on every call</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Extra arguments used in AVRDUDE.
|
||||
This can be used for providing extra information to AVRDUDE.
|
||||
|
||||
Please only use this if you know what you are doing. There are no error checks and you could cripple your controller.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_av5">
|
||||
<property name="text">
|
||||
<string>Extra Arguments</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="whatsThis">
|
||||
<string>Show AVRDUDE help</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QComboBox" name="avrdude_port">
|
||||
<property name="whatsThis">
|
||||
<string>Communication port to the programmer.
|
||||
</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">usb</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com3</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com5</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com6</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com7</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com8</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com9</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com10</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com11</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com12</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com13</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com14</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com15</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">lpt1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">lpt2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">lpt3</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">lpt4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrdoper</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">/dev/ttyUSB0</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">/dev/ttyUSB1</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_av4">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_av1">
|
||||
<property name="text">
|
||||
<string>AVRDUDE Location</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_av3">
|
||||
<property name="text">
|
||||
<string>MCU</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QComboBox" name="avrdude_mcu">
|
||||
<property name="toolTip">
|
||||
<string>CPU of your TX</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>CPU present on your 9x radio
|
||||
Should be m64 for stock radios
|
||||
m2560 for v4.1 boards</string>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAlphabetically</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">m64</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">m128</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">m2560</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<item row="1" column="2">
|
||||
<widget class="QComboBox" name="arm_mcu">
|
||||
<property name="toolTip">
|
||||
<string>CPU of your TX</string>
|
||||
|
@ -678,7 +70,27 @@ m2560 for v4.1 boards</string>
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="3" column="2">
|
||||
<widget class="QLineEdit" name="dfu_location">
|
||||
<property name="toolTip">
|
||||
<string>Location of sam-ba executable</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The location of the AVRDUDE executable.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">dfu-util</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_dfu1">
|
||||
<property name="text">
|
||||
<string>DFU-Util Location</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_sb1">
|
||||
<property name="text">
|
||||
<string>SAM-BA Location</string>
|
||||
|
@ -688,7 +100,7 @@ m2560 for v4.1 boards</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="samba_location">
|
||||
<property name="toolTip">
|
||||
<string>Location of sam-ba executable</string>
|
||||
|
@ -701,7 +113,7 @@ m2560 for v4.1 boards</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_sb2">
|
||||
<property name="text">
|
||||
<string>ARM MCU</string>
|
||||
|
@ -711,7 +123,7 @@ m2560 for v4.1 boards</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_sb3">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
|
@ -721,7 +133,7 @@ m2560 for v4.1 boards</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<item row="2" column="2">
|
||||
<widget class="QLineEdit" name="samba_port">
|
||||
<property name="toolTip">
|
||||
<string>sam-ba serial port</string>
|
||||
|
@ -734,14 +146,14 @@ m2560 for v4.1 boards</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_dfu2">
|
||||
<property name="text">
|
||||
<string>Alternate device</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="2">
|
||||
<item row="4" column="2">
|
||||
<widget class="QLineEdit" name="dfuArgs">
|
||||
<property name="toolTip">
|
||||
<string>Extra arguments that will be passed to AVRDUDE on every call</string>
|
||||
|
@ -757,7 +169,7 @@ Please only use this if you know what you are doing. There are no error checks
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="sb_browse">
|
||||
<property name="whatsThis">
|
||||
<string>Use this button to browse and look for the AVRDUDE executable file.</string>
|
||||
|
@ -767,7 +179,7 @@ Please only use this if you know what you are doing. There are no error checks
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="4">
|
||||
<item row="3" column="4">
|
||||
<widget class="QPushButton" name="dfu_browse">
|
||||
<property name="whatsThis">
|
||||
<string>Use this button to browse and look for the AVRDUDE executable file.</string>
|
||||
|
@ -777,14 +189,14 @@ Please only use this if you know what you are doing. There are no error checks
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="2">
|
||||
<item row="5" column="2">
|
||||
<widget class="QCheckBox" name="advCtrChkB">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Use advanced controls</string>
|
||||
|
@ -809,14 +221,6 @@ Please only use this if you know what you are doing. There are no error checks
|
|||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>avrdude_location</tabstop>
|
||||
<tabstop>pushButton</tabstop>
|
||||
<tabstop>avrdude_programmer</tabstop>
|
||||
<tabstop>pushButton_3</tabstop>
|
||||
<tabstop>avrdude_mcu</tabstop>
|
||||
<tabstop>avrdude_port</tabstop>
|
||||
<tabstop>avrArgs</tabstop>
|
||||
<tabstop>pushButton_4</tabstop>
|
||||
<tabstop>samba_location</tabstop>
|
||||
<tabstop>sb_browse</tabstop>
|
||||
<tabstop>arm_mcu</tabstop>
|
||||
|
|
|
@ -19,8 +19,6 @@ set(firmwares_SRCS
|
|||
sensordata.cpp
|
||||
telem_data.cpp
|
||||
afhds3.cpp
|
||||
er9x/er9xeeprom.cpp
|
||||
er9x/er9xinterface.cpp
|
||||
ersky9x/ersky9xeeprom.cpp
|
||||
ersky9x/ersky9xinterface.cpp
|
||||
opentx/opentxeeprom.cpp
|
||||
|
|
|
@ -25,18 +25,13 @@
|
|||
// Update: These are now all only used within this class.
|
||||
// External access is only via getEEpromSize() and getFlashSize()
|
||||
|
||||
#define EESIZE_STOCK 2048
|
||||
#define EESIZE_M128 4096
|
||||
#define EESIZE_GRUVIN9X 4096
|
||||
#define EESIZE_TARANIS (32*1024)
|
||||
#define EESIZE_SKY9X (128*4096)
|
||||
#define EESIZE_9XRPRO (128*4096)
|
||||
#define EESIZE_MAX EESIZE_9XRPRO
|
||||
|
||||
// getFlashSize() (and these macros) is only used by radiointerface::getDfuArgs (perhaps can find a better way?)
|
||||
#define FSIZE_STOCK (64*1024)
|
||||
#define FSIZE_M128 (128*1024)
|
||||
#define FSIZE_GRUVIN9X (256*1024)
|
||||
|
||||
#define FSIZE_TARANIS (512*1024)
|
||||
#define FSIZE_SKY9X (256*1024)
|
||||
#define FSIZE_9XRPRO (512*1024)
|
||||
|
@ -82,12 +77,6 @@ uint32_t Boards::getFourCC(Type board)
|
|||
case BOARD_AR9X:
|
||||
case BOARD_9XRPRO:
|
||||
return 0x3278746F;
|
||||
case BOARD_MEGA2560:
|
||||
case BOARD_GRUVIN9X:
|
||||
return 0x3178746F;
|
||||
case BOARD_9X_M64:
|
||||
case BOARD_9X_M128:
|
||||
return 0;
|
||||
case BOARD_JUMPER_T12:
|
||||
return 0x3D78746F;
|
||||
case BOARD_JUMPER_T16:
|
||||
|
@ -104,13 +93,6 @@ uint32_t Boards::getFourCC(Type board)
|
|||
int Boards::getEEpromSize(Board::Type board)
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_9X_M64:
|
||||
return EESIZE_STOCK;
|
||||
case BOARD_9X_M128:
|
||||
return EESIZE_M128;
|
||||
case BOARD_MEGA2560:
|
||||
case BOARD_GRUVIN9X:
|
||||
return EESIZE_GRUVIN9X;
|
||||
case BOARD_SKY9X:
|
||||
return EESIZE_SKY9X;
|
||||
case BOARD_9XRPRO:
|
||||
|
@ -144,13 +126,6 @@ int Boards::getEEpromSize(Board::Type board)
|
|||
int Boards::getFlashSize(Type board)
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_9X_M64:
|
||||
return FSIZE_STOCK;
|
||||
case BOARD_9X_M128:
|
||||
return FSIZE_M128;
|
||||
case BOARD_MEGA2560:
|
||||
case BOARD_GRUVIN9X:
|
||||
return FSIZE_GRUVIN9X;
|
||||
case BOARD_SKY9X:
|
||||
return FSIZE_SKY9X;
|
||||
case BOARD_9XRPRO:
|
||||
|
@ -412,7 +387,7 @@ QString Boards::getAnalogInputName(Board::Type board, int index)
|
|||
|
||||
index -= getCapability(board, Board::Sticks);
|
||||
|
||||
if (IS_9X(board) || IS_2560(board) || IS_SKY9X(board)) {
|
||||
if (IS_SKY9X(board)) {
|
||||
const QString pots[] = {
|
||||
"P1",
|
||||
"P2",
|
||||
|
@ -496,14 +471,6 @@ bool Boards::isBoardCompatible(Type board1, Type board2)
|
|||
QString Boards::getBoardName(Board::Type board)
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_9X_M64:
|
||||
return "9X";
|
||||
case BOARD_9X_M128:
|
||||
return "9X128";
|
||||
case BOARD_GRUVIN9X:
|
||||
return "Gruvin9x";
|
||||
case BOARD_MEGA2560:
|
||||
return "MEGA2560";
|
||||
case BOARD_TARANIS_X7:
|
||||
return "Taranis X7/X7S";
|
||||
case BOARD_TARANIS_X7_ACCESS:
|
||||
|
|
|
@ -32,10 +32,6 @@ namespace Board {
|
|||
enum Type
|
||||
{
|
||||
BOARD_UNKNOWN = -1,
|
||||
BOARD_9X_M64 = 0,
|
||||
BOARD_9X_M128,
|
||||
BOARD_MEGA2560,
|
||||
BOARD_GRUVIN9X,
|
||||
BOARD_SKY9X,
|
||||
BOARD_9XRPRO,
|
||||
BOARD_AR9X,
|
||||
|
@ -191,26 +187,6 @@ class Boards
|
|||
// temporary aliases for transition period, use Boards class instead.
|
||||
#define getBoardCapability(b__, c__) Boards::getCapability(b__, c__)
|
||||
|
||||
inline bool IS_9X(Board::Type board)
|
||||
{
|
||||
return board == Board::BOARD_9X_M64 || board == Board::BOARD_9X_M128;
|
||||
}
|
||||
|
||||
inline bool IS_STOCK(Board::Type board)
|
||||
{
|
||||
return board == Board::BOARD_9X_M64;
|
||||
}
|
||||
|
||||
inline bool IS_M128(Board::Type board)
|
||||
{
|
||||
return board == Board::BOARD_9X_M128;
|
||||
}
|
||||
|
||||
inline bool IS_2560(Board::Type board)
|
||||
{
|
||||
return board == Board::BOARD_GRUVIN9X || board == Board::BOARD_MEGA2560;
|
||||
}
|
||||
|
||||
inline bool IS_SKY9X(Board::Type board)
|
||||
{
|
||||
return board == Board::BOARD_SKY9X || board == Board::BOARD_9XRPRO || board == Board::BOARD_AR9X;
|
||||
|
|
|
@ -112,13 +112,10 @@ void CustomFunctionData::populateResetParams(const ModelData * model, QComboBox
|
|||
{
|
||||
int val = 0;
|
||||
Firmware * firmware = Firmware::getCurrentVariant();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
b->addItem(tr("Timer1"), val++);
|
||||
b->addItem(tr("Timer2"), val++);
|
||||
if (IS_ARM(board)) {
|
||||
b->addItem( tr("Timer3"), val++);
|
||||
}
|
||||
b->addItem( tr("Timer3"), val++);
|
||||
b->addItem(tr("Flight"), val++);
|
||||
b->addItem(tr("Telemetry"), val++);
|
||||
int reCount = firmware->getCapability(RotaryEncoders);
|
||||
|
@ -132,7 +129,7 @@ void CustomFunctionData::populateResetParams(const ModelData * model, QComboBox
|
|||
if ((int)value < b->count()) {
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
if (model && IS_ARM(board)) {
|
||||
if (model) {
|
||||
for (unsigned i=0; i<CPN_MAX_SENSORS; ++i) {
|
||||
if (model->sensorData[i].isAvailable()) {
|
||||
RawSource item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i);
|
||||
|
@ -210,14 +207,8 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
|||
case FUNC_ADJUST_GVAR_INCDEC:
|
||||
float val;
|
||||
QString unit;
|
||||
if (IS_ARM(getCurrentBoard())) {
|
||||
val = param * model->gvarData[func - FuncAdjustGV1].multiplierGet();
|
||||
unit = model->gvarData[func - FuncAdjustGV1].unitToString();
|
||||
}
|
||||
else {
|
||||
val = param;
|
||||
unit = "";
|
||||
}
|
||||
val = param * model->gvarData[func - FuncAdjustGV1].multiplierGet();
|
||||
unit = model->gvarData[func - FuncAdjustGV1].unitToString();
|
||||
return QString("Increment: %1%2").arg(val).arg(unit);
|
||||
}
|
||||
}
|
||||
|
@ -233,7 +224,7 @@ QString CustomFunctionData::repeatToString() const
|
|||
return "";
|
||||
}
|
||||
else {
|
||||
unsigned int step = IS_ARM(getCurrentBoard()) ? 1 : 10;
|
||||
unsigned int step = 1;
|
||||
return tr("repeat(%1s)").arg(step*repeatParam);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,10 +75,7 @@ void EEPROMInterface::showEepromErrors(QWidget *parent, const QString &title, co
|
|||
|
||||
if (errors.test(UNSUPPORTED_NEWER_VERSION)) { errorsList << tr("- Eeprom is from a newer version of OpenTX"); }
|
||||
if (errors.test(NOT_OPENTX)) { errorsList << tr("- Eeprom is not from OpenTX"); }
|
||||
if (errors.test(NOT_TH9X)) { errorsList << tr("- Eeprom is not from Th9X"); }
|
||||
if (errors.test(NOT_GRUVIN9X)) { errorsList << tr("- Eeprom is not from Gruvin9X"); }
|
||||
if (errors.test(NOT_ERSKY9X)) { errorsList << tr("- Eeprom is not from ErSky9X"); }
|
||||
if (errors.test(NOT_ER9X)) { errorsList << tr("- Eeprom is not from Er9X"); }
|
||||
if (errors.test(WRONG_SIZE)) { errorsList << tr("- Eeprom size is invalid"); }
|
||||
if (errors.test(WRONG_FILE_SYSTEM)) { errorsList << tr("- Eeprom file system is invalid"); }
|
||||
if (errors.test(UNKNOWN_BOARD)) { errorsList << tr("- Eeprom is from a unknown board"); }
|
||||
|
|
|
@ -235,10 +235,7 @@ enum EepromLoadErrors {
|
|||
WRONG_SIZE,
|
||||
WRONG_FILE_SYSTEM,
|
||||
NOT_OPENTX,
|
||||
NOT_TH9X,
|
||||
NOT_GRUVIN9X,
|
||||
NOT_ERSKY9X,
|
||||
NOT_ER9X,
|
||||
UNKNOWN_BOARD,
|
||||
WRONG_BOARD,
|
||||
BACKUP_NOT_SUPPORTED,
|
||||
|
|
|
@ -110,9 +110,7 @@ GeneralSettings::GeneralSettings()
|
|||
backlightOffBright = 20;
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
speakerVolume = 12;
|
||||
}
|
||||
speakerVolume = 12;
|
||||
|
||||
if (IS_JUMPER_T16(board))
|
||||
strcpy(bluetoothName, "t16");
|
||||
|
|
|
@ -207,36 +207,25 @@ bool ModelData::isEmpty() const
|
|||
|
||||
void ModelData::setDefaultInputs(const GeneralSettings & settings)
|
||||
{
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_ARM(board)) {
|
||||
for (int i = 0; i < CPN_MAX_STICKS; i++) {
|
||||
ExpoData * expo = &expoData[i];
|
||||
expo->chn = i;
|
||||
expo->mode = INPUT_MODE_BOTH;
|
||||
expo->srcRaw = settings.getDefaultSource(i);
|
||||
expo->weight = 100;
|
||||
strncpy(inputNames[i], Helpers::removeAccents(expo->srcRaw.toString(this)).toLatin1().constData(), sizeof(inputNames[i]) - 1);
|
||||
}
|
||||
for (int i = 0; i < CPN_MAX_STICKS; i++) {
|
||||
ExpoData * expo = &expoData[i];
|
||||
expo->chn = i;
|
||||
expo->mode = INPUT_MODE_BOTH;
|
||||
expo->srcRaw = settings.getDefaultSource(i);
|
||||
expo->weight = 100;
|
||||
strncpy(inputNames[i], Helpers::removeAccents(expo->srcRaw.toString(this)).toLatin1().constData(), sizeof(inputNames[i]) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
void ModelData::setDefaultMixes(const GeneralSettings & settings)
|
||||
{
|
||||
Board::Type board = getCurrentBoard();
|
||||
if (IS_ARM(board)) {
|
||||
setDefaultInputs(settings);
|
||||
}
|
||||
setDefaultInputs(settings);
|
||||
|
||||
for (int i = 0; i < CPN_MAX_STICKS; i++) {
|
||||
MixData * mix = &mixData[i];
|
||||
mix->destCh = i + 1;
|
||||
mix->weight = 100;
|
||||
if (IS_ARM(board)) {
|
||||
mix->srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i);
|
||||
}
|
||||
else {
|
||||
mix->srcRaw = RawSource(SOURCE_TYPE_STICK, i);
|
||||
}
|
||||
mix->srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,13 +41,10 @@ class RadioDataConversionState;
|
|||
class RSSIAlarmData {
|
||||
public:
|
||||
RSSIAlarmData() { clear(); }
|
||||
unsigned int level[2]; // AVR Only
|
||||
int warning;
|
||||
int critical;
|
||||
bool disabled;
|
||||
void clear() {
|
||||
this->level[0] = 2;
|
||||
this->level[1] = 3;
|
||||
this->warning = 45;
|
||||
this->critical = 42;
|
||||
this->disabled = false;
|
||||
|
|
|
@ -721,13 +721,7 @@ class FlightModeField: public TransformedField {
|
|||
trim = 501 + phase.trimRef[i] - (phase.trimRef[i] > index ? 1 : 0);
|
||||
else
|
||||
trim = std::max(-500, std::min(500, phase.trim[i]));
|
||||
if (board == BOARD_9X_M64 || (board == BOARD_9X_M128 && version >= 215)) {
|
||||
trimBase[i] = trim >> 2;
|
||||
trimExt[i] = (trim & 0x03);
|
||||
}
|
||||
else {
|
||||
trimBase[i] = trim;
|
||||
}
|
||||
trimBase[i] = trim;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -751,11 +745,7 @@ class FlightModeField: public TransformedField {
|
|||
phase.trim[i] = 0;
|
||||
}
|
||||
else {
|
||||
int trim;
|
||||
if (board == BOARD_9X_M64 || (board == BOARD_9X_M128 && version >= 215))
|
||||
trim = ((trimBase[i]) << 2) + (trimExt[i] & 0x03);
|
||||
else
|
||||
trim = trimBase[i];
|
||||
int trim = trimBase[i];
|
||||
if (trim > 500) {
|
||||
phase.trimRef[i] = trim - 501;
|
||||
if (phase.trimRef[i] >= index)
|
||||
|
|
|
@ -37,9 +37,6 @@
|
|||
#define TARANIS_X9LITES_VARIANT 0x0801
|
||||
#define JUMPER_T12_VARIANT 0x4001
|
||||
|
||||
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
|
||||
#define SIMU_M128_VARIANTS (M128_VARIANT|SIMU_STOCK_VARIANTS)
|
||||
|
||||
class OpenTxGeneralData: public TransformedField {
|
||||
public:
|
||||
OpenTxGeneralData(GeneralSettings & generalData, Board::Type board, unsigned int version, unsigned int variant=0);
|
||||
|
|
|
@ -58,14 +58,6 @@ OpenTxEepromInterface::~OpenTxEepromInterface()
|
|||
const char * OpenTxEepromInterface::getName()
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_9X_M64:
|
||||
return "OpenTX for 9X board";
|
||||
case BOARD_9X_M128:
|
||||
return "OpenTX for M128 / 9X board";
|
||||
case BOARD_MEGA2560:
|
||||
return "OpenTX for MEGA2560 board";
|
||||
case BOARD_GRUVIN9X:
|
||||
return "OpenTX for Gruvin9x board / 9X";
|
||||
case BOARD_JUMPER_T12:
|
||||
return "OpenTX for Jumper T12";
|
||||
case BOARD_JUMPER_T16:
|
||||
|
@ -280,16 +272,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *
|
|||
|
||||
uint8_t OpenTxEepromInterface::getLastDataVersion(Board::Type board)
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_9X_M64:
|
||||
return 216;
|
||||
case BOARD_GRUVIN9X:
|
||||
case BOARD_MEGA2560:
|
||||
case BOARD_9X_M128:
|
||||
return 217;
|
||||
default:
|
||||
return 219;
|
||||
}
|
||||
return 219;
|
||||
}
|
||||
|
||||
void OpenTxEepromInterface::showErrors(const QString & title, const QStringList & errors)
|
||||
|
@ -325,10 +308,7 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
|
|||
|
||||
efile->EeFsCreate(eeprom, size, board, version);
|
||||
|
||||
if (board == BOARD_9X_M128) {
|
||||
variant |= M128_VARIANT;
|
||||
}
|
||||
else if (IS_TARANIS_X9E(board)) {
|
||||
if (IS_TARANIS_X9E(board)) {
|
||||
variant |= TARANIS_X9E_VARIANT;
|
||||
}
|
||||
else if (IS_TARANIS_X9LITES(board)) {
|
||||
|
@ -445,43 +425,26 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
case Models:
|
||||
if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
return 0;
|
||||
else if (IS_ARM(board))
|
||||
else
|
||||
return 60;
|
||||
else if (board == BOARD_9X_M128)
|
||||
return 30;
|
||||
else if (IS_2560(board))
|
||||
return 30;
|
||||
else
|
||||
return 16;
|
||||
case Imperial:
|
||||
if (IS_ARM(board))
|
||||
return 0;
|
||||
else
|
||||
return id.contains("imperial") ? 1 : 0;
|
||||
return 0;
|
||||
case ModelImage:
|
||||
return (board == BOARD_TARANIS_X9D || IS_TARANIS_PLUS(board) || board == BOARD_TARANIS_X9DP_2019 || IS_FAMILY_HORUS_OR_T16(board));
|
||||
case HasBeeper:
|
||||
return (!IS_ARM(board));
|
||||
return false;
|
||||
case HasPxxCountry:
|
||||
return 1;
|
||||
case HasGeneralUnits:
|
||||
if (IS_ARM(board))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return true;
|
||||
case HasNegAndSwitches:
|
||||
return IS_ARM(board);
|
||||
return true;
|
||||
case PPMExtCtrl:
|
||||
return 1;
|
||||
case PPMFrameLength:
|
||||
return 40;
|
||||
case FlightModes:
|
||||
if (IS_ARM(board))
|
||||
return 9;
|
||||
else if (IS_2560(board))
|
||||
return 6;
|
||||
else
|
||||
return 5;
|
||||
return 9;
|
||||
case FlightModesHaveFades:
|
||||
return 1;
|
||||
case Heli:
|
||||
|
@ -493,7 +456,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
if (IS_HORUS_OR_TARANIS(board))
|
||||
return id.contains("nogvars") ? 0 : 9;
|
||||
else if (id.contains("gvars"))
|
||||
return IS_ARM(board) ? 9 : 5;
|
||||
return 9;
|
||||
else
|
||||
return 0;
|
||||
case ModelName:
|
||||
|
@ -501,66 +464,48 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
case FlightModesName:
|
||||
return (IS_HORUS_OR_TARANIS(board) ? 10 : 6);
|
||||
case GvarsName:
|
||||
return (IS_9X(board) ? 0 : 3);
|
||||
return 3;
|
||||
case GvarsInCS:
|
||||
case HasFAIMode:
|
||||
return 1;
|
||||
case GvarsAreNamed:
|
||||
case GvarsFlightModes:
|
||||
return ((IS_ARM(board) || IS_2560(board)) ? 1 : 0);
|
||||
return 1;
|
||||
case Mixes:
|
||||
return (IS_ARM(board) ? 64 : 32);
|
||||
return 64;
|
||||
case OffsetWeight:
|
||||
return (IS_ARM(board) ? 500 : 245);
|
||||
return 500;
|
||||
case Timers:
|
||||
return (IS_ARM(board) ? 3 : 2);
|
||||
return 3;
|
||||
case TimersName:
|
||||
if (HAS_LARGE_LCD(board))
|
||||
return 8;
|
||||
else if (IS_ARM(board))
|
||||
else
|
||||
return 3;
|
||||
else
|
||||
return 0;
|
||||
case PermTimers:
|
||||
return (IS_2560(board) || IS_ARM(board));
|
||||
return true;
|
||||
case CustomFunctions:
|
||||
if (IS_ARM(board))
|
||||
return 64;
|
||||
else if (IS_2560(board) || board == BOARD_9X_M128)
|
||||
return 24;
|
||||
else
|
||||
return 16;
|
||||
return 64;
|
||||
case SafetyChannelCustomFunction:
|
||||
return id.contains("nooverridech") ? 0 : 1;
|
||||
case LogicalSwitches:
|
||||
if (IS_ARM(board))
|
||||
return 64;
|
||||
else
|
||||
return 12;
|
||||
return 64;
|
||||
case CustomAndSwitches:
|
||||
if (IS_ARM(board))
|
||||
return getCapability(LogicalSwitches);
|
||||
else
|
||||
return 15/*4bits*/- 9/*sw positions*/;
|
||||
return getCapability(LogicalSwitches);
|
||||
case LogicalSwitchesExt:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
return true;
|
||||
case RotaryEncoders:
|
||||
if (board == BOARD_GRUVIN9X)
|
||||
return 2;
|
||||
else if (IS_SKY9X(board))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
case Outputs:
|
||||
return (IS_ARM(board) ? 32 : 16);
|
||||
return 32;
|
||||
case NumCurvePoints:
|
||||
return (IS_ARM(board) ? 512 : 104);
|
||||
return 512;
|
||||
case VoicesAsNumbers:
|
||||
return (IS_ARM(board) ? 0 : 1);
|
||||
return 0;
|
||||
case VoicesMaxLength:
|
||||
return (IS_ARM(board) ? (IS_TARANIS_X9(board) ? 8 : 6) : 0);
|
||||
return (IS_TARANIS_X9(board) ? 8 : 6);
|
||||
case MultiLangVoice:
|
||||
return (IS_ARM(board) ? 1 : 0);
|
||||
return 1;
|
||||
case SoundPitch:
|
||||
return 1;
|
||||
case Haptic:
|
||||
|
@ -571,7 +516,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
else
|
||||
return 0;
|
||||
case MaxVolume:
|
||||
return (IS_ARM(board) ? 23 : 7);
|
||||
return 23;
|
||||
case MaxContrast:
|
||||
if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
|
||||
return 30;
|
||||
|
@ -583,7 +528,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
else
|
||||
return 10;
|
||||
case HasSoundMixer:
|
||||
return (IS_ARM(board) ? 1 : 0);
|
||||
return 1;
|
||||
case ExtraInputs:
|
||||
return 1;
|
||||
case TrimsRange:
|
||||
|
@ -593,29 +538,26 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
case Simulation:
|
||||
return 1;
|
||||
case NumCurves:
|
||||
return (HAS_LARGE_LCD(board) ? 32 : (IS_ARM(board) ? 16 : 8));
|
||||
return (HAS_LARGE_LCD(board) ? 32 : 16);
|
||||
case HasMixerNames:
|
||||
return (IS_ARM(board) ? (IS_TARANIS_X9(board) ? 8 : 6) : false);
|
||||
return (IS_TARANIS_X9(board) ? 8 : 6);
|
||||
case HasExpoNames:
|
||||
return (IS_ARM(board) ? (IS_TARANIS_X9(board) ? 8 : 6) : false);
|
||||
return (IS_TARANIS_X9(board) ? 8 : 6);
|
||||
case HasNoExpo:
|
||||
return (IS_HORUS_OR_TARANIS(board) ? false : true);
|
||||
case ChannelsName:
|
||||
return (IS_ARM(board) ? (HAS_LARGE_LCD(board) ? 6 : 4) : 0);
|
||||
return (HAS_LARGE_LCD(board) ? 6 : 4);
|
||||
case HasCvNames:
|
||||
return (IS_ARM(board) ? 1 : 0);
|
||||
return 1;
|
||||
case Telemetry:
|
||||
if (IS_2560(board) || IS_ARM(board) || id.contains("frsky") || id.contains("telemetrez"))
|
||||
return TM_HASTELEMETRY | TM_HASOFFSET | TM_HASWSHH;
|
||||
else
|
||||
return 0;
|
||||
return 1;
|
||||
case TelemetryBars:
|
||||
return 1;
|
||||
case TelemetryCustomScreens:
|
||||
if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
return 0;
|
||||
else
|
||||
return IS_ARM(board) ? 4 : 2;
|
||||
return 4;
|
||||
case TelemetryCustomScreensBars:
|
||||
return (getCapability(TelemetryCustomScreens) ? 4 : 0);
|
||||
case TelemetryCustomScreensLines:
|
||||
|
@ -627,7 +569,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
case TelemetryUnits:
|
||||
return 0;
|
||||
case TelemetryMaxMultiplier:
|
||||
return (IS_ARM(board) ? 32 : 8);
|
||||
return 32;
|
||||
case PPMCenter:
|
||||
return (IS_HORUS_OR_TARANIS(board) ? 500 : (id.contains("ppmca") ? 125 : 0));
|
||||
case PPMUnitMicroseconds:
|
||||
|
@ -639,11 +581,11 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
case HasVario:
|
||||
return 1;
|
||||
case HasVarioSink:
|
||||
return ((IS_2560(board) || IS_ARM(board)) ? true : false);
|
||||
return true;
|
||||
case HasFailsafe:
|
||||
return (IS_ARM(board) ? 32 : 0);
|
||||
return 32;
|
||||
case NumModules:
|
||||
return (IS_ARM(board) ? 2 : 1);
|
||||
return 2;
|
||||
case NumFirstUsableModule:
|
||||
return (IS_JUMPER_T12(board) ? 1 : 0);
|
||||
case HasModuleR9MFlex:
|
||||
|
@ -651,23 +593,23 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
case HasModuleR9MMini:
|
||||
return IS_TARANIS_XLITE(board) && !id.contains("stdr9m");
|
||||
case HasPPMStart:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
return true;
|
||||
case HastxCurrentCalibration:
|
||||
return (IS_SKY9X(board) ? true : false);
|
||||
case HasVolume:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
return true;
|
||||
case HasBrightness:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
return true;
|
||||
case PerModelTimers:
|
||||
return 1;
|
||||
case SlowScale:
|
||||
return (IS_ARM(board) ? 10 : 2);
|
||||
return 10;
|
||||
case SlowRange:
|
||||
return (IS_ARM(board) ? 250 : 15);
|
||||
return 250;
|
||||
case CSFunc:
|
||||
return 18;
|
||||
case HasSDLogs:
|
||||
return ((IS_2560(board) || IS_ARM(board)) ? true : false);
|
||||
return true;
|
||||
case LcdWidth:
|
||||
if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
return 480;
|
||||
|
@ -694,19 +636,19 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
case GetThrSwitch:
|
||||
return (IS_HORUS_OR_TARANIS(board) ? SWITCH_SF1 : SWITCH_THR);
|
||||
case HasDisplayText:
|
||||
return IS_ARM(board) ? 1 : 0;
|
||||
return 1;
|
||||
case HasTopLcd:
|
||||
return IS_TARANIS_X9E(board) ? 1 : 0;
|
||||
case GlobalFunctions:
|
||||
return IS_ARM(board) ? 64 : 0;
|
||||
return 64;
|
||||
case VirtualInputs:
|
||||
return IS_ARM(board) ? 32 : 0;
|
||||
return 32;
|
||||
case InputsLength:
|
||||
return HAS_LARGE_LCD(board) ? 4 : 3;
|
||||
case TrainerInputs:
|
||||
return IS_ARM(board) ? 16 : 8;
|
||||
return 16;
|
||||
case RtcTime:
|
||||
return IS_ARM(board) || IS_2560(board) ? 1 : 0;
|
||||
return 1;
|
||||
case LuaScripts:
|
||||
return IS_HORUS_OR_TARANIS(board) && id.contains("lua") ? 7 : 0;
|
||||
case LuaInputsPerScript:
|
||||
|
@ -715,17 +657,13 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
return IS_HORUS_OR_TARANIS(board) ? 6 : 0;
|
||||
case LimitsPer1000:
|
||||
case EnhancedCurves:
|
||||
return IS_ARM(board);
|
||||
return 1;
|
||||
case HasFasOffset:
|
||||
return (IS_STOCK(board) ? false : true);
|
||||
return true;
|
||||
case HasMahPersistent:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
return true;
|
||||
case SimulatorVariant:
|
||||
if (board == BOARD_9X_M64)
|
||||
return SIMU_STOCK_VARIANTS;
|
||||
else if (board == BOARD_9X_M128)
|
||||
return SIMU_M128_VARIANTS;
|
||||
else if (IS_TARANIS_X9E(board))
|
||||
if (IS_TARANIS_X9E(board))
|
||||
return TARANIS_X9E_VARIANT;
|
||||
else if (IS_TARANIS_X9LITES(board))
|
||||
return TARANIS_X9LITES_VARIANT;
|
||||
|
@ -744,7 +682,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
|||
case MavlinkTelemetry:
|
||||
return id.contains("mavlink") ? 1 : 0;
|
||||
case SportTelemetry:
|
||||
return IS_ARM(board) ? 1 : 0;
|
||||
return 1;
|
||||
case HasInputDiff:
|
||||
case HasMixerExpo:
|
||||
return (IS_HORUS_OR_TARANIS(board) ? true : false);
|
||||
|
@ -777,10 +715,8 @@ QTime OpenTxFirmware::getMaxTimerStart()
|
|||
{
|
||||
if (IS_HORUS_OR_TARANIS(board))
|
||||
return QTime(23, 59, 59);
|
||||
else if (IS_ARM(board))
|
||||
return QTime(8, 59, 59);
|
||||
else
|
||||
return QTime(0, 59, 59);
|
||||
return QTime(8, 59, 59);
|
||||
}
|
||||
|
||||
bool OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
|
||||
|
@ -947,14 +883,9 @@ EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
|
|||
// M128 revert because too much RAM used!
|
||||
case 216:
|
||||
// A lot of things (first github release)
|
||||
if (IS_2560(board) || IS_M128(board)) {
|
||||
return OLD_VERSION;
|
||||
}
|
||||
case 217:
|
||||
// 3 logical switches removed on M128 / gruvin9x boards
|
||||
if (IS_ARM(board)) {
|
||||
return OLD_VERSION;
|
||||
}
|
||||
case 218:
|
||||
// ACCESS
|
||||
// switches add for X7/X10/X12S
|
||||
|
@ -974,21 +905,7 @@ EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
|
|||
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
|
||||
{
|
||||
bool variantError = false;
|
||||
if (board == BOARD_9X_M128 && !(variant & M128_VARIANT)) {
|
||||
if (version == 212) {
|
||||
uint8_t tmp[1000];
|
||||
for (int i = 1; i < 31; i++) {
|
||||
efile->openRd(i);
|
||||
int sz = efile->readRlc2(tmp, sizeof(tmp));
|
||||
if (sz == 849) {
|
||||
qWarning() << " warning: M128 variant not set (but model size seems ok)";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
variantError = true;
|
||||
}
|
||||
else if (IS_TARANIS_X9E(board)) {
|
||||
if (IS_TARANIS_X9E(board)) {
|
||||
if (variant != TARANIS_X9E_VARIANT) {
|
||||
variantError = true;
|
||||
}
|
||||
|
@ -1080,9 +997,6 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, const uint
|
|||
case 0x32:
|
||||
backupBoard = BOARD_SKY9X;
|
||||
break;
|
||||
case 0x31:
|
||||
backupBoard = BOARD_GRUVIN9X;
|
||||
break;
|
||||
default:
|
||||
dbg << " unknown board";
|
||||
errors.set(UNKNOWN_BOARD);
|
||||
|
@ -1379,14 +1293,6 @@ void registerOpenTxFirmwares()
|
|||
addOpenTxArm9xOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
// These are kept only for import purposes, marked as deprecated to hide from UI.
|
||||
registerOpenTxFirmware(new OpenTxFirmware("opentx-9xr", Firmware::tr("Turnigy 9XR"), BOARD_9X_M64), true);
|
||||
registerOpenTxFirmware(new OpenTxFirmware("opentx-9xr128", Firmware::tr("Turnigy 9XR with m128 chip"), BOARD_9X_M128), true);
|
||||
registerOpenTxFirmware(new OpenTxFirmware("opentx-9x", Firmware::tr("9X with stock board"), BOARD_9X_M64), true);
|
||||
registerOpenTxFirmware(new OpenTxFirmware("opentx-9x128", Firmware::tr("9X with stock board and m128 chip"), BOARD_9X_M128), true);
|
||||
registerOpenTxFirmware(new OpenTxFirmware("opentx-gruvin9x", Firmware::tr("9X with Gruvin9x board"), BOARD_GRUVIN9X), true);
|
||||
registerOpenTxFirmware(new OpenTxFirmware("opentx-mega2560", Firmware::tr("DIY MEGA2560 radio"), BOARD_MEGA2560), true);
|
||||
|
||||
Firmware::setDefaultVariant(Firmware::getFirmwareForId("opentx-x9d+"));
|
||||
Firmware::setCurrentVariant(Firmware::getDefaultVariant());
|
||||
}
|
||||
|
|
|
@ -32,10 +32,7 @@
|
|||
|
||||
float RawSourceRange::getValue(int value)
|
||||
{
|
||||
if (IS_ARM(getCurrentBoard()))
|
||||
return float(value) * step;
|
||||
else
|
||||
return min + float(value) * step;
|
||||
return float(value) * step;
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,11 +45,10 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
|
|||
RawSourceRange result;
|
||||
|
||||
Firmware * firmware = Firmware::getCurrentVariant();
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
switch (type) {
|
||||
case SOURCE_TYPE_TELEMETRY:
|
||||
if (IS_ARM(board)) {
|
||||
{
|
||||
div_t qr = div(index, 3);
|
||||
const SensorData & sensor = model->sensorData[qr.quot];
|
||||
if (sensor.prec == 2)
|
||||
|
@ -65,192 +61,8 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
|
|||
result.max = +30000 * result.step;
|
||||
result.decimals = sensor.prec;
|
||||
result.unit = sensor.unitString();
|
||||
break;
|
||||
}
|
||||
else {
|
||||
result.offset = -DBL_MAX;
|
||||
|
||||
switch (index) {
|
||||
case TELEMETRY_SOURCE_TX_BATT:
|
||||
result.step = 0.1;
|
||||
result.decimals = 1;
|
||||
result.max = 25.5;
|
||||
result.unit = tr("V");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_TX_TIME:
|
||||
result.step = 60;
|
||||
result.max = 24 * 60 * result.step - 60; // 23:59:00 with 1-minute resolution
|
||||
result.unit = tr("s");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_TIMER1:
|
||||
case TELEMETRY_SOURCE_TIMER2:
|
||||
case TELEMETRY_SOURCE_TIMER3:
|
||||
result.step = 5;
|
||||
result.max = 255 * result.step;
|
||||
result.unit = tr("s");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_RSSI_TX:
|
||||
case TELEMETRY_SOURCE_RSSI_RX:
|
||||
result.max = 100;
|
||||
result.offset = 128;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_A1_MIN:
|
||||
case TELEMETRY_SOURCE_A2_MIN:
|
||||
case TELEMETRY_SOURCE_A3_MIN:
|
||||
case TELEMETRY_SOURCE_A4_MIN:
|
||||
if (model) result = model->frsky.channels[index-TELEMETRY_SOURCE_A1_MIN].getRange();
|
||||
break;
|
||||
case TELEMETRY_SOURCE_A1:
|
||||
case TELEMETRY_SOURCE_A2:
|
||||
case TELEMETRY_SOURCE_A3:
|
||||
case TELEMETRY_SOURCE_A4:
|
||||
if (model) result = model->frsky.channels[index-TELEMETRY_SOURCE_A1].getRange();
|
||||
break;
|
||||
case TELEMETRY_SOURCE_ALT:
|
||||
case TELEMETRY_SOURCE_ALT_MIN:
|
||||
case TELEMETRY_SOURCE_ALT_MAX:
|
||||
case TELEMETRY_SOURCE_GPS_ALT:
|
||||
result.step = 8;
|
||||
result.min = -500;
|
||||
result.max = 1540;
|
||||
if (firmware->getCapability(Imperial) || settings.imperial) {
|
||||
result.step = (result.step * 105) / 32;
|
||||
result.min = (result.min * 105) / 32;
|
||||
result.max = (result.max * 105) / 32;
|
||||
result.unit = tr("ft");
|
||||
}
|
||||
else {
|
||||
result.unit = tr("m");
|
||||
}
|
||||
break;
|
||||
case TELEMETRY_SOURCE_T1:
|
||||
case TELEMETRY_SOURCE_T1_MAX:
|
||||
case TELEMETRY_SOURCE_T2:
|
||||
case TELEMETRY_SOURCE_T2_MAX:
|
||||
result.min = -30;
|
||||
result.max = 225;
|
||||
result.unit = tr("°C");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_HDG:
|
||||
result.step = 2;
|
||||
result.max = 360;
|
||||
result.offset = 256;
|
||||
result.unit = tr("°");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_RPM:
|
||||
case TELEMETRY_SOURCE_RPM_MAX:
|
||||
result.step = 50;
|
||||
result.max = 12750;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_FUEL:
|
||||
result.max = 100;
|
||||
result.unit = tr("%");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_ASPEED:
|
||||
case TELEMETRY_SOURCE_ASPEED_MAX:
|
||||
result.decimals = 1;
|
||||
result.step = 2.0;
|
||||
result.max = (2*255);
|
||||
if (firmware->getCapability(Imperial) || settings.imperial) {
|
||||
result.step *= 1.150779;
|
||||
result.max *= 1.150779;
|
||||
result.unit = tr("mph");
|
||||
}
|
||||
else {
|
||||
result.step *= 1.852;
|
||||
result.max *= 1.852;
|
||||
result.unit = tr("km/h");
|
||||
}
|
||||
break;
|
||||
case TELEMETRY_SOURCE_SPEED:
|
||||
case TELEMETRY_SOURCE_SPEED_MAX:
|
||||
result.step = 2;
|
||||
result.max = (2*255);
|
||||
if (firmware->getCapability(Imperial) || settings.imperial) {
|
||||
result.step *= 1.150779;
|
||||
result.max *= 1.150779;
|
||||
result.unit = tr("mph");
|
||||
}
|
||||
else {
|
||||
result.step *= 1.852;
|
||||
result.max *= 1.852;
|
||||
result.unit = tr("km/h");
|
||||
}
|
||||
break;
|
||||
case TELEMETRY_SOURCE_VERTICAL_SPEED:
|
||||
result.step = 0.1;
|
||||
result.min = -12.5;
|
||||
result.max = 13.0;
|
||||
result.decimals = 1;
|
||||
result.unit = tr("m/s");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_DTE:
|
||||
result.max = 30000;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_DIST:
|
||||
case TELEMETRY_SOURCE_DIST_MAX:
|
||||
result.step = 8;
|
||||
result.max = 2040;
|
||||
result.unit = tr("m");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CELL:
|
||||
case TELEMETRY_SOURCE_CELL_MIN:
|
||||
result.step = 0.02;
|
||||
result.max = 5.1;
|
||||
result.decimals = 2;
|
||||
result.unit = tr("V");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CELLS_SUM:
|
||||
case TELEMETRY_SOURCE_CELLS_MIN:
|
||||
case TELEMETRY_SOURCE_VFAS:
|
||||
case TELEMETRY_SOURCE_VFAS_MIN:
|
||||
result.step = 0.1;
|
||||
result.max = 25.5;
|
||||
result.decimals = 1;
|
||||
result.unit = tr("V");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CURRENT:
|
||||
case TELEMETRY_SOURCE_CURRENT_MAX:
|
||||
result.step = 0.5;
|
||||
result.max = 127.5;
|
||||
result.decimals = 1;
|
||||
result.unit = tr("A");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CONSUMPTION:
|
||||
result.step = 100;
|
||||
result.max = 25500;
|
||||
result.unit = tr("mAh");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_POWER:
|
||||
case TELEMETRY_SOURCE_POWER_MAX:
|
||||
result.step = 5;
|
||||
result.max = 1275;
|
||||
result.unit = tr("W");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_ACCX:
|
||||
case TELEMETRY_SOURCE_ACCY:
|
||||
case TELEMETRY_SOURCE_ACCZ:
|
||||
result.step = 0.01;
|
||||
result.decimals = 2;
|
||||
result.max = 2.55;
|
||||
result.min = 0;
|
||||
result.unit = tr("g");
|
||||
break;
|
||||
default:
|
||||
result.max = 125;
|
||||
break;
|
||||
}
|
||||
|
||||
if (result.offset == -DBL_MAX) {
|
||||
result.offset = result.max - (127*result.step);
|
||||
}
|
||||
|
||||
if (flags & (RANGE_DELTA_FUNCTION | RANGE_ABS_FUNCTION)) {
|
||||
result.offset = 0;
|
||||
result.min = result.step * -127;
|
||||
result.max = result.step * 127;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SOURCE_TYPE_LUA_OUTPUT:
|
||||
result.max = 30000;
|
||||
|
@ -414,7 +226,7 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
|
|||
return CHECK_IN_ARRAY(special, index);
|
||||
|
||||
case SOURCE_TYPE_TELEMETRY:
|
||||
if (IS_ARM(board)) {
|
||||
{
|
||||
div_t qr = div(index, 3);
|
||||
if (model)
|
||||
result = model->sensorData[qr.quot].nameToString(qr.quot);
|
||||
|
@ -424,9 +236,6 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
|
|||
result += (qr.rem == 1 ? "-" : "+");
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return CHECK_IN_ARRAY(telemetry, index);
|
||||
}
|
||||
|
||||
case SOURCE_TYPE_GVAR:
|
||||
if (model)
|
||||
|
@ -486,13 +295,7 @@ bool RawSource::isSlider(int * sliderIndex, Board::Type board) const
|
|||
|
||||
bool RawSource::isTimeBased(Board::Type board) const
|
||||
{
|
||||
if (board == Board::BOARD_UNKNOWN)
|
||||
board = getCurrentBoard();
|
||||
|
||||
if (IS_ARM(board))
|
||||
return (type == SOURCE_TYPE_SPECIAL && index > 0);
|
||||
else
|
||||
return (type==SOURCE_TYPE_TELEMETRY && (index==TELEMETRY_SOURCE_TX_TIME || index==TELEMETRY_SOURCE_TIMER1 || index==TELEMETRY_SOURCE_TIMER2 || index==TELEMETRY_SOURCE_TIMER3));
|
||||
return (type == SOURCE_TYPE_SPECIAL && index > 0);
|
||||
}
|
||||
|
||||
bool RawSource::isAvailable(const ModelData * const model, const GeneralSettings * const gs, Board::Type board) const
|
||||
|
@ -516,20 +319,9 @@ bool RawSource::isAvailable(const ModelData * const model, const GeneralSettings
|
|||
return false;
|
||||
|
||||
if (type == SOURCE_TYPE_TELEMETRY) {
|
||||
if (IS_ARM(board) && !model->sensorData[div(index, 3).quot].isAvailable()) {
|
||||
if (!model->sensorData[div(index, 3).quot].isAvailable()) {
|
||||
return false;
|
||||
}
|
||||
else if (!IS_ARM(board)) {
|
||||
Firmware * fw = getCurrentFirmware();
|
||||
if (type == (int)TELEMETRY_SOURCE_TX_TIME && !fw->getCapability(RtcTime))
|
||||
return false;
|
||||
|
||||
if (type == (int)TELEMETRY_SOURCE_RAS && !fw->getCapability(SportTelemetry))
|
||||
return false;
|
||||
|
||||
if (type == (int)TELEMETRY_SOURCE_TIMER3 && fw->getCapability(Timers) < 3)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -159,10 +159,6 @@ enum TelemetrySource {
|
|||
TELEMETRY_SOURCE_RESERVE = -1
|
||||
};
|
||||
|
||||
#define TM_HASTELEMETRY 0x01
|
||||
#define TM_HASOFFSET 0x02
|
||||
#define TM_HASWSHH 0x04
|
||||
|
||||
enum RawSourceType {
|
||||
SOURCE_TYPE_NONE,
|
||||
SOURCE_TYPE_VIRTUAL_INPUT,
|
||||
|
|
|
@ -48,9 +48,6 @@ RawSourceRange FrSkyChannelData::getRange() const
|
|||
void FrSkyScreenData::clear()
|
||||
{
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(FrSkyScreenData));
|
||||
if (!IS_ARM(getCurrentBoard())) {
|
||||
type = TELEMETRY_SCREEN_NUMBERS;
|
||||
}
|
||||
}
|
||||
|
||||
void FrSkyData::clear()
|
||||
|
|
|
@ -56,9 +56,7 @@ GeneralEdit::GeneralEdit(QWidget * parent, RadioData & radioData, Firmware * fir
|
|||
}
|
||||
|
||||
addTab(new GeneralSetupPanel(this, generalSettings, firmware), tr("Setup"));
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
addTab(new CustomFunctionsPanel(this, NULL, generalSettings, firmware), tr("Global Functions"));
|
||||
}
|
||||
addTab(new CustomFunctionsPanel(this, NULL, generalSettings, firmware), tr("Global Functions"));
|
||||
addTab(new TrainerPanel(this, generalSettings, firmware), tr("Trainer"));
|
||||
addTab(new HardwarePanel(this, generalSettings, firmware), tr("Hardware"));
|
||||
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Calibration"));
|
||||
|
|
|
@ -234,12 +234,7 @@ ui(new Ui::GeneralSetup)
|
|||
ui->memwarnChkB->setChecked(!generalSettings.disableMemoryWarning); // Default is zero=checked
|
||||
ui->alarmwarnChkB->setChecked(!generalSettings.disableAlarmWarning); // Default is zero=checked
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->rssiPowerOffWarnChkB->setChecked(!generalSettings.disableRssiPoweroffAlarm); // Default is zero=checked
|
||||
}
|
||||
else {
|
||||
ui->rssiPowerOffWarnChkB->hide();
|
||||
}
|
||||
ui->rssiPowerOffWarnChkB->setChecked(!generalSettings.disableRssiPoweroffAlarm); // Default is zero=checked
|
||||
|
||||
if (IS_FAMILY_HORUS_OR_T16(firmware->getBoard())) {
|
||||
ui->splashScreenChkB->hide();
|
||||
|
@ -302,13 +297,7 @@ ui(new Ui::GeneralSetup)
|
|||
ui->backlightColor2_label->hide();
|
||||
}
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->switchesDelay->setValue(10*(generalSettings.switchesDelay+15));
|
||||
}
|
||||
else {
|
||||
ui->switchesDelay->hide();
|
||||
ui->switchesDelayLabel->hide();
|
||||
}
|
||||
ui->switchesDelay->setValue(10*(generalSettings.switchesDelay+15));
|
||||
ui->blAlarm_ChkB->setChecked(generalSettings.flashBeep);
|
||||
|
||||
if (!firmware->getCapability(HasBatMeterRange)) {
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "apppreferencesdialog.h"
|
||||
#include "fwpreferencesdialog.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "fusesdialog.h"
|
||||
#include "downloaddialog.h"
|
||||
#include "printdialog.h"
|
||||
#include "version.h"
|
||||
|
@ -939,10 +938,8 @@ void MainWindow::readEeprom()
|
|||
QString tempFile;
|
||||
if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
tempFile = generateProcessUniqueTempFileName("temp.otx");
|
||||
else if (IS_ARM(board))
|
||||
tempFile = generateProcessUniqueTempFileName("temp.bin");
|
||||
else
|
||||
tempFile = generateProcessUniqueTempFileName("temp.hex");
|
||||
tempFile = generateProcessUniqueTempFileName("temp.bin");
|
||||
|
||||
qDebug() << "MainWindow::readEeprom(): using temp file: " << tempFile;
|
||||
|
||||
|
@ -1029,14 +1026,6 @@ void MainWindow::burnConfig()
|
|||
void MainWindow::burnList()
|
||||
{
|
||||
burnConfigDialog bcd(this);
|
||||
bcd.listAvrdudeProgrammers();
|
||||
}
|
||||
|
||||
void MainWindow::burnFuses()
|
||||
{
|
||||
FusesDialog *fd = new FusesDialog(this);
|
||||
fd->exec();
|
||||
delete fd;
|
||||
}
|
||||
|
||||
void MainWindow::compare()
|
||||
|
@ -1232,8 +1221,6 @@ void MainWindow::retranslateUi(bool showMsg)
|
|||
trAct(changelogAct, tr("Release notes..."), tr("Show release notes"));
|
||||
trAct(compareAct, tr("Compare Models..."), tr("Compare models"));
|
||||
trAct(editSplashAct, tr("Edit Radio Splash Image..."), tr("Edit the splash image of your Radio"));
|
||||
trAct(burnListAct, tr("List programmers..."), tr("List available programmers"));
|
||||
trAct(burnFusesAct, tr("Fuses..."), tr("Show fuses dialog"));
|
||||
trAct(readFlashAct, tr("Read Firmware from Radio"), tr("Read firmware from Radio"));
|
||||
trAct(writeFlashAct, tr("Write Firmware to Radio"), tr("Write firmware to Radio"));
|
||||
trAct(sdsyncAct, tr("Synchronize SD"), tr("SD card synchronization"));
|
||||
|
@ -1295,7 +1282,6 @@ void MainWindow::createActions()
|
|||
|
||||
editSplashAct = addAct("paintbrush.png", SLOT(customizeSplash()));
|
||||
burnListAct = addAct("list.png", SLOT(burnList()));
|
||||
burnFusesAct = addAct("fuses.png", SLOT(burnFuses()));
|
||||
readFlashAct = addAct("read_flash.png", SLOT(readFlash()));
|
||||
writeFlashAct = addAct("write_flash.png", SLOT(writeFlash()));
|
||||
writeEepromAct = addAct("write_eeprom.png", SLOT(writeEeprom()));
|
||||
|
@ -1400,10 +1386,6 @@ void MainWindow::createMenus()
|
|||
burnMenu->addAction(readFlashAct);
|
||||
burnMenu->addSeparator();
|
||||
burnMenu->addSeparator();
|
||||
if (!IS_ARM(getCurrentBoard())) {
|
||||
burnMenu->addAction(burnFusesAct);
|
||||
burnMenu->addAction(burnListAct);
|
||||
}
|
||||
|
||||
windowMenu = menuBar()->addMenu("");
|
||||
windowMenu->addAction(actTabbedWindows);
|
||||
|
|
|
@ -111,7 +111,6 @@ class MainWindow : public QMainWindow
|
|||
void readBackup();
|
||||
void burnConfig();
|
||||
void burnList();
|
||||
void burnFuses();
|
||||
void contributors();
|
||||
void sdsync();
|
||||
void changelog();
|
||||
|
@ -210,7 +209,6 @@ class MainWindow : public QMainWindow
|
|||
QAction *readEepromAct;
|
||||
QAction *burnConfigAct;
|
||||
QAction *burnListAct;
|
||||
QAction *burnFusesAct;
|
||||
QAction *writeFlashAct;
|
||||
QAction *readFlashAct;
|
||||
QAction *writeBUToRadioAct;
|
||||
|
|
|
@ -42,7 +42,6 @@ set(modeledit_UIS
|
|||
setup_timer.ui
|
||||
setup_module.ui
|
||||
flightmode.ui
|
||||
telemetry_analog.ui
|
||||
telemetry_customscreen.ui
|
||||
telemetry_sensor.ui
|
||||
)
|
||||
|
|
|
@ -45,7 +45,7 @@ LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout * tableLayout, int row
|
|||
spinbox->setSuffix("%");
|
||||
}
|
||||
|
||||
if (IS_ARM(board) || deflt == 0 /*it's the offset*/) {
|
||||
if (deflt == 0 /*it's the offset*/) {
|
||||
spinbox->setDecimals(1);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -29,7 +29,7 @@ RepeatComboBox::RepeatComboBox(QWidget *parent, int & repeatParam):
|
|||
QComboBox(parent),
|
||||
repeatParam(repeatParam)
|
||||
{
|
||||
unsigned int step = IS_ARM(getCurrentBoard()) ? 1 : 10;
|
||||
unsigned int step = 1;
|
||||
int value = repeatParam/step;
|
||||
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
|
||||
|
@ -58,7 +58,7 @@ void RepeatComboBox::onIndexChanged(int index)
|
|||
|
||||
void RepeatComboBox::update()
|
||||
{
|
||||
unsigned int step = IS_ARM(getCurrentBoard()) ? 1 : 10;
|
||||
unsigned int step = 1;
|
||||
int value = repeatParam/step;
|
||||
if (step == 1) {
|
||||
value++;
|
||||
|
@ -422,29 +422,20 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
|||
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())) {
|
||||
fswtchParam[i]->setDecimals(model->gvarData[gvidx].prec);
|
||||
fswtchParam[i]->setSingleStep(model->gvarData[gvidx].multiplierGet());
|
||||
fswtchParam[i]->setSuffix(model->gvarData[gvidx].unitToString());
|
||||
if (cfn.adjustMode==FUNC_ADJUST_GVAR_INCDEC) {
|
||||
double rng = abs(model->gvarData[gvidx].getMax() - model->gvarData[gvidx].getMin());
|
||||
rng *= model->gvarData[gvidx].multiplierGet();
|
||||
fswtchParam[i]->setMinimum(-rng);
|
||||
fswtchParam[i]->setMaximum(rng);
|
||||
}
|
||||
else {
|
||||
fswtchParam[i]->setMinimum(model->gvarData[gvidx].getMinPrec());
|
||||
fswtchParam[i]->setMaximum(model->gvarData[gvidx].getMaxPrec());
|
||||
}
|
||||
fswtchParam[i]->setValue(cfn.param * model->gvarData[gvidx].multiplierGet());
|
||||
fswtchParam[i]->setDecimals(model->gvarData[gvidx].prec);
|
||||
fswtchParam[i]->setSingleStep(model->gvarData[gvidx].multiplierGet());
|
||||
fswtchParam[i]->setSuffix(model->gvarData[gvidx].unitToString());
|
||||
if (cfn.adjustMode==FUNC_ADJUST_GVAR_INCDEC) {
|
||||
double rng = abs(model->gvarData[gvidx].getMax() - model->gvarData[gvidx].getMin());
|
||||
rng *= model->gvarData[gvidx].multiplierGet();
|
||||
fswtchParam[i]->setMinimum(-rng);
|
||||
fswtchParam[i]->setMaximum(rng);
|
||||
}
|
||||
else {
|
||||
fswtchParam[i]->setDecimals(0);
|
||||
fswtchParam[i]->setSingleStep(1);
|
||||
fswtchParam[i]->setMinimum(-125);
|
||||
fswtchParam[i]->setMaximum(125);
|
||||
fswtchParam[i]->setValue(cfn.param);
|
||||
fswtchParam[i]->setMinimum(model->gvarData[gvidx].getMinPrec());
|
||||
fswtchParam[i]->setMaximum(model->gvarData[gvidx].getMaxPrec());
|
||||
}
|
||||
fswtchParam[i]->setValue(cfn.param * model->gvarData[gvidx].multiplierGet());
|
||||
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM;
|
||||
}
|
||||
else {
|
||||
|
@ -679,7 +670,6 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
|
|||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
|
||||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
|
||||
((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) ||
|
||||
((i==FuncSetTimer1 || i==FuncSetTimer2) && !IS_ARM(firmware->getBoard())) ||
|
||||
((i==FuncSetTimer3) && firmware->getCapability(Timers) < 3) ||
|
||||
((i==FuncScreenshot) && !IS_HORUS_OR_TARANIS(firmware->getBoard())) ||
|
||||
((i>=FuncRangeCheckInternalModule && i<=FuncBindExternalModule) && (!model || !firmware->getCapability(DangerousFunctions))) ||
|
||||
|
|
|
@ -46,18 +46,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
|||
setWindowTitle(tr("Edit %1").arg(RawSource(srcType, ed->chn).toString(&model, &generalSettings)));
|
||||
QRegExp rx(CHAR_FOR_NAMES_REGEX);
|
||||
|
||||
if (IS_ARM(getCurrentBoard())) {
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, model, 100, -100, 100);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, ed->offset, model, 0, -100, 100);
|
||||
}
|
||||
else {
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, model, 100, 0, 100);
|
||||
gvOffsetGroup = NULL;
|
||||
ui->offsetLabel->hide();
|
||||
ui->offsetGV->hide();
|
||||
ui->offsetSB->hide();
|
||||
ui->offsetCB->hide();
|
||||
}
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, model, 100, -100, 100);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, ed->offset, model, 0, -100, 100);
|
||||
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, model,
|
||||
firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
|
||||
|
|
|
@ -479,10 +479,6 @@ void LogicalSwitchesPanel::populateFunctionCB(QComboBox *b)
|
|||
int func = order[i];
|
||||
if (func == LS_FN_NEQUAL || func == LS_FN_EGREATER || func == LS_FN_ELESS)
|
||||
continue;
|
||||
if (!IS_ARM(firmware->getBoard())) {
|
||||
if (func == LS_FN_VEQUAL || func == LS_FN_EDGE)
|
||||
continue;
|
||||
}
|
||||
b->addItem(LogicalSwitchData(func).funcToString(), func);
|
||||
}
|
||||
b->setMaxVisibleItems(10);
|
||||
|
@ -490,27 +486,7 @@ void LogicalSwitchesPanel::populateFunctionCB(QComboBox *b)
|
|||
|
||||
void LogicalSwitchesPanel::populateAndSwitchCB(QComboBox *b)
|
||||
{
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
b->setModel(rawSwitchItemModel);
|
||||
}
|
||||
else {
|
||||
RawSwitch item;
|
||||
|
||||
b->clear();
|
||||
|
||||
item = RawSwitch(SWITCH_TYPE_NONE);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
|
||||
for (int i=1; i <= Boards::getCapability(firmware->getBoard(), Board::SwitchPositions); i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
}
|
||||
|
||||
for (int i=1; i<=6; i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
}
|
||||
}
|
||||
b->setModel(rawSwitchItemModel);
|
||||
b->setVisible(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
|
|||
s1.report("LS");
|
||||
addTab(new CustomFunctionsPanel(this, &radioData.models[modelId], radioData.generalSettings, firmware), tr("Special Functions"));
|
||||
s1.report("CF");
|
||||
if (firmware->getCapability(Telemetry) & TM_HASTELEMETRY)
|
||||
if (firmware->getCapability(Telemetry))
|
||||
addTab(new TelemetryPanel(this, radioData.models[modelId], radioData.generalSettings, firmware), tr("Telemetry"));
|
||||
|
||||
onTabIndexChanged(ui->tabWidget->currentIndex()); // make sure to trigger update on default tab panel
|
||||
|
|
|
@ -36,7 +36,6 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
|
|||
timer(timer),
|
||||
ui(new Ui::Timer)
|
||||
{
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
|
@ -65,10 +64,8 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
|
|||
ui->countdownBeep->setField(timer.countdownBeep, this);
|
||||
ui->countdownBeep->addItem(tr("Silent"), TimerData::COUNTDOWN_SILENT);
|
||||
ui->countdownBeep->addItem(tr("Beeps"), TimerData::COUNTDOWN_BEEPS);
|
||||
if (IS_ARM(board) || IS_2560(board)) {
|
||||
ui->countdownBeep->addItem(tr("Voice"), TimerData::COUNTDOWN_VOICE);
|
||||
ui->countdownBeep->addItem(tr("Haptic"), TimerData::COUNTDOWN_HAPTIC);
|
||||
}
|
||||
ui->countdownBeep->addItem(tr("Voice"), TimerData::COUNTDOWN_VOICE);
|
||||
ui->countdownBeep->addItem(tr("Haptic"), TimerData::COUNTDOWN_HAPTIC);
|
||||
|
||||
ui->value->setMaximumTime(firmware->getMaxTimerStart());
|
||||
|
||||
|
@ -1205,13 +1202,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
|
|||
ui->potWarningMode->hide();
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
ui->trimsDisplay->setField(model.trimsDisplay, this);
|
||||
}
|
||||
else {
|
||||
ui->labelTrimsDisplay->hide();
|
||||
ui->trimsDisplay->hide();
|
||||
}
|
||||
ui->trimsDisplay->setField(model.trimsDisplay, this);
|
||||
|
||||
for (int i = firmware->getCapability(NumFirstUsableModule); i < firmware->getCapability(NumModules); i++) {
|
||||
modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, firmware, i);
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
#include "telemetry.h"
|
||||
#include "ui_telemetry.h"
|
||||
#include "ui_telemetry_analog.h"
|
||||
#include "ui_telemetry_customscreen.h"
|
||||
#include "ui_telemetry_sensor.h"
|
||||
#include "helpers.h"
|
||||
|
@ -29,291 +28,6 @@
|
|||
|
||||
#include <TimerEdit>
|
||||
|
||||
TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
ui(new Ui::TelemetryAnalog),
|
||||
analog(analog),
|
||||
lock(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
float ratio = analog.getRatio();
|
||||
|
||||
if (analog.type==0 || analog.type==1 || analog.type==2) {
|
||||
ui->RatioSB->setDecimals(1);
|
||||
ui->RatioSB->setMaximum(25.5*firmware->getCapability(TelemetryMaxMultiplier));
|
||||
}
|
||||
else {
|
||||
ui->RatioSB->setDecimals(0);
|
||||
ui->RatioSB->setMaximum(255*firmware->getCapability(TelemetryMaxMultiplier));
|
||||
}
|
||||
ui->RatioSB->setValue(ratio);
|
||||
|
||||
update();
|
||||
|
||||
ui->UnitCB->setCurrentIndex(analog.type);
|
||||
ui->alarm1LevelCB->setCurrentIndex(analog.alarms[0].level);
|
||||
ui->alarm1GreaterCB->setCurrentIndex(analog.alarms[0].greater);
|
||||
ui->alarm2LevelCB->setCurrentIndex(analog.alarms[1].level);
|
||||
ui->alarm2GreaterCB->setCurrentIndex(analog.alarms[1].greater);
|
||||
|
||||
if (!(firmware->getCapability(Telemetry) & TM_HASOFFSET)) {
|
||||
ui->CalibSB->hide();
|
||||
ui->CalibLabel->hide();
|
||||
}
|
||||
else {
|
||||
ui->label_Max->setText(tr("Range"));
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
}
|
||||
|
||||
void TelemetryAnalog::update()
|
||||
{
|
||||
float ratio = analog.getRatio();
|
||||
float step = ratio / 255;
|
||||
float mini = (ratio * analog.offset) / 255;
|
||||
float maxi = mini + ratio;
|
||||
|
||||
ui->alarm1ValueSB->setDecimals(2);
|
||||
ui->alarm1ValueSB->setSingleStep(step);
|
||||
ui->alarm1ValueSB->setMinimum(mini);
|
||||
ui->alarm1ValueSB->setMaximum(maxi);
|
||||
ui->alarm1ValueSB->setValue(mini + step*analog.alarms[0].value);
|
||||
|
||||
ui->alarm2ValueSB->setDecimals(2);
|
||||
ui->alarm2ValueSB->setSingleStep(step);
|
||||
ui->alarm2ValueSB->setMinimum(mini);
|
||||
ui->alarm2ValueSB->setMaximum(maxi);
|
||||
ui->alarm2ValueSB->setValue(mini + step*analog.alarms[1].value);
|
||||
|
||||
ui->CalibSB->setDecimals(2);
|
||||
ui->CalibSB->setMaximum(step*127);
|
||||
ui->CalibSB->setMinimum(-step*128);
|
||||
ui->CalibSB->setSingleStep(step);
|
||||
ui->CalibSB->setValue(mini);
|
||||
}
|
||||
|
||||
static int findmult(float value, float base)
|
||||
{
|
||||
int vvalue = value*10;
|
||||
int vbase = base*10;
|
||||
vvalue--;
|
||||
|
||||
int mult = 0;
|
||||
for (int i=8; i>=0; i--) {
|
||||
if (vvalue/vbase >= (1<<i)) {
|
||||
mult = i+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return mult;
|
||||
}
|
||||
|
||||
void TelemetryAnalog::on_UnitCB_currentIndexChanged(int index)
|
||||
{
|
||||
float ratio = analog.getRatio();
|
||||
analog.type = index;
|
||||
switch (index) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
ui->RatioSB->setDecimals(1);
|
||||
ui->RatioSB->setMaximum(25.5*firmware->getCapability(TelemetryMaxMultiplier));
|
||||
break;
|
||||
default:
|
||||
ui->RatioSB->setDecimals(0);
|
||||
ui->RatioSB->setMaximum(255*firmware->getCapability(TelemetryMaxMultiplier));
|
||||
break;
|
||||
}
|
||||
ui->RatioSB->setValue(ratio);
|
||||
update();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryAnalog::on_RatioSB_valueChanged()
|
||||
{
|
||||
if (!lock) {
|
||||
if (analog.type==0 || analog.type==1 || analog.type==2) {
|
||||
analog.multiplier = findmult(ui->RatioSB->value(), 25.5);
|
||||
float singlestep =(1<<analog.multiplier)/10.0;
|
||||
lock=true;
|
||||
ui->RatioSB->setSingleStep(singlestep);
|
||||
ui->RatioSB->setValue(round(ui->RatioSB->value()/singlestep)*singlestep);
|
||||
lock=false;
|
||||
}
|
||||
else {
|
||||
analog.multiplier = findmult(ui->RatioSB->value(), 255);
|
||||
float singlestep = (1<<analog.multiplier);
|
||||
lock = true;
|
||||
ui->RatioSB->setSingleStep(singlestep);
|
||||
ui->RatioSB->setValue(round(ui->RatioSB->value()/singlestep)*singlestep);
|
||||
lock = false;
|
||||
}
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryAnalog::on_RatioSB_editingFinished()
|
||||
{
|
||||
if (!lock) {
|
||||
float ratio, calib, alarm1value,alarm2value;
|
||||
|
||||
if (analog.type==0 || analog.type==1 || analog.type==2) {
|
||||
analog.multiplier = findmult(ui->RatioSB->value(), 25.5);
|
||||
ui->CalibSB->setSingleStep((1<<analog.multiplier)/10.0);
|
||||
ui->alarm1ValueSB->setSingleStep((1<<analog.multiplier)/10.0);
|
||||
ui->alarm2ValueSB->setSingleStep((1<<analog.multiplier)/10.0);
|
||||
analog.ratio = ((int)(round(ui->RatioSB->value()*10))/(1 <<analog.multiplier));
|
||||
}
|
||||
else {
|
||||
analog.multiplier = findmult(ui->RatioSB->value(), 255);
|
||||
ui->CalibSB->setSingleStep(1<<analog.multiplier);
|
||||
ui->alarm1ValueSB->setSingleStep(1<<analog.multiplier);
|
||||
ui->alarm2ValueSB->setSingleStep(1<<analog.multiplier);
|
||||
analog.ratio = (ui->RatioSB->value()/(1 << analog.multiplier));
|
||||
}
|
||||
ui->CalibSB->setMaximum((ui->RatioSB->value()*127)/255);
|
||||
ui->CalibSB->setMinimum((ui->RatioSB->value()*-128)/255);
|
||||
ui->alarm1ValueSB->setMaximum(ui->RatioSB->value());
|
||||
ui->alarm2ValueSB->setMaximum(ui->RatioSB->value());
|
||||
repaint();
|
||||
ratio=analog.ratio * (1 << analog.multiplier);
|
||||
calib=ui->CalibSB->value();
|
||||
alarm1value=ui->alarm1ValueSB->value();
|
||||
alarm2value=ui->alarm2ValueSB->value();
|
||||
if (analog.type==0) {
|
||||
calib*=10;
|
||||
alarm1value*=10;
|
||||
alarm2value*=10;
|
||||
}
|
||||
if (calib>0) {
|
||||
if (calib>((ratio*127)/255)) {
|
||||
analog.offset=127;
|
||||
}
|
||||
else {
|
||||
analog.offset=round(calib*255/ratio);
|
||||
}
|
||||
}
|
||||
if (calib<0) {
|
||||
if (calib<((ratio*-128)/255)) {
|
||||
analog.offset=-128;
|
||||
}
|
||||
else {
|
||||
analog.offset=round(calib*255/ratio);
|
||||
}
|
||||
}
|
||||
analog.alarms[0].value=round((alarm1value*255-analog.offset*(analog.ratio<<analog.multiplier))/(analog.ratio<<analog.multiplier));
|
||||
analog.alarms[1].value=round((alarm2value*255-analog.offset*(analog.ratio<<analog.multiplier))/(analog.ratio<<analog.multiplier));
|
||||
update();
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryAnalog::on_CalibSB_editingFinished()
|
||||
{
|
||||
float ratio = analog.getRatio();
|
||||
float calib,alarm1value,alarm2value;
|
||||
|
||||
if (ratio!=0) {
|
||||
analog.offset = round((255*ui->CalibSB->value()/ratio));
|
||||
calib=ratio*analog.offset/255.0;
|
||||
alarm1value=ui->alarm1ValueSB->value();
|
||||
alarm2value=ui->alarm2ValueSB->value();
|
||||
if (alarm1value<calib) {
|
||||
alarm1value=calib;
|
||||
}
|
||||
else if (alarm1value>(ratio+calib)) {
|
||||
alarm1value=ratio+calib;
|
||||
}
|
||||
if (alarm2value<calib) {
|
||||
alarm2value=calib;
|
||||
}
|
||||
else if (alarm2value>(ratio+calib)) {
|
||||
alarm2value=ratio+calib;
|
||||
}
|
||||
analog.alarms[0].value=round(((alarm1value-calib)*255)/ratio);
|
||||
analog.alarms[1].value=round(((alarm2value-calib)*255)/ratio);
|
||||
}
|
||||
else {
|
||||
analog.offset=0;
|
||||
analog.alarms[0].value=0;
|
||||
analog.alarms[1].value=0;
|
||||
}
|
||||
update();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryAnalog::on_alarm1LevelCB_currentIndexChanged(int index)
|
||||
{
|
||||
analog.alarms[0].level = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
void TelemetryAnalog::on_alarm1GreaterCB_currentIndexChanged(int index)
|
||||
{
|
||||
analog.alarms[0].greater = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryAnalog::on_alarm1ValueSB_editingFinished()
|
||||
{
|
||||
float ratio = analog.getRatio();
|
||||
float calib, alarm1value;
|
||||
|
||||
calib=analog.offset;
|
||||
alarm1value=ui->alarm1ValueSB->value();
|
||||
|
||||
if (alarm1value<((calib*ratio)/255)) {
|
||||
analog.alarms[0].value=0;
|
||||
}
|
||||
else if (alarm1value>(ratio+(calib*ratio)/255)) {
|
||||
analog.alarms[0].value=255;
|
||||
}
|
||||
else {
|
||||
analog.alarms[0].value = round((alarm1value-((calib*ratio)/255))/ratio*255);
|
||||
}
|
||||
update();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryAnalog::on_alarm2LevelCB_currentIndexChanged(int index)
|
||||
{
|
||||
analog.alarms[1].level = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryAnalog::on_alarm2GreaterCB_currentIndexChanged(int index)
|
||||
{
|
||||
analog.alarms[1].greater = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryAnalog::on_alarm2ValueSB_editingFinished()
|
||||
{
|
||||
float calib, alarm2value;
|
||||
float ratio = analog.getRatio();
|
||||
calib = analog.offset;
|
||||
alarm2value = ui->alarm2ValueSB->value();
|
||||
if (alarm2value<((calib*ratio)/255)) {
|
||||
analog.alarms[1].value=0;
|
||||
}
|
||||
else if (alarm2value>(ratio+(calib*ratio)/255)) {
|
||||
analog.alarms[1].value=255;
|
||||
}
|
||||
else {
|
||||
analog.alarms[1].value = round((alarm2value-((calib*ratio)/255))/ratio*255);
|
||||
}
|
||||
update();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
TelemetryAnalog::~TelemetryAnalog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/******************************************************/
|
||||
|
||||
|
@ -377,8 +91,7 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
|
|||
disableMouseScrolling();
|
||||
|
||||
lock = true;
|
||||
if (IS_ARM(firmware->getBoard()))
|
||||
ui->screenType->addItem(tr("None"), TELEMETRY_SCREEN_NONE);
|
||||
ui->screenType->addItem(tr("None"), TELEMETRY_SCREEN_NONE);
|
||||
ui->screenType->addItem(tr("Numbers"), TELEMETRY_SCREEN_NUMBERS);
|
||||
ui->screenType->addItem(tr("Bars"), TELEMETRY_SCREEN_BARS);
|
||||
if (IS_TARANIS(firmware->getBoard()))
|
||||
|
@ -439,14 +152,8 @@ void TelemetryCustomScreen::updateBar(int line)
|
|||
|
||||
if (source.type != SOURCE_TYPE_NONE) {
|
||||
RawSourceRange range = source.getRange(model, generalSettings);
|
||||
if (!IS_ARM(getCurrentBoard())) {
|
||||
int max = round((range.max - range.min) / range.step);
|
||||
if (int(255-screen.body.bars[line].barMax) > max) {
|
||||
screen.body.bars[line].barMax = 255 - max;
|
||||
}
|
||||
}
|
||||
float minVal = range.getValue(screen.body.bars[line].barMin);
|
||||
float maxVal = IS_ARM(getCurrentBoard()) ? screen.body.bars[line].barMax : 255 - screen.body.bars[line].barMax;
|
||||
float maxVal = screen.body.bars[line].barMax;
|
||||
maxVal = range.getValue(maxVal);
|
||||
|
||||
if (source.isTimeBased()) {
|
||||
|
@ -552,10 +259,7 @@ void TelemetryCustomScreen::barMinChanged(double value)
|
|||
{
|
||||
if (!lock) {
|
||||
int line = sender()->property("index").toInt();
|
||||
if (IS_ARM(getCurrentBoard()))
|
||||
screen.body.bars[line].barMin = round(value / minSB[line]->singleStep());
|
||||
else
|
||||
screen.body.bars[line].barMin = round((value-minSB[line]->minimum()) / minSB[line]->singleStep());
|
||||
screen.body.bars[line].barMin = round(value / minSB[line]->singleStep());
|
||||
// TODO set min (maxSB)
|
||||
emit modified();
|
||||
}
|
||||
|
@ -565,10 +269,7 @@ void TelemetryCustomScreen::barMaxChanged(double value)
|
|||
{
|
||||
if (!lock) {
|
||||
int line = sender()->property("index").toInt();
|
||||
if (IS_ARM(getCurrentBoard()))
|
||||
screen.body.bars[line].barMax = round((value) / maxSB[line]->singleStep());
|
||||
else
|
||||
screen.body.bars[line].barMax = 255 - round((value-minSB[line]->minimum()) / maxSB[line]->singleStep());
|
||||
screen.body.bars[line].barMax = round((value) / maxSB[line]->singleStep());
|
||||
// TODO set max (minSB)
|
||||
emit modified();
|
||||
}
|
||||
|
@ -583,10 +284,7 @@ void TelemetryCustomScreen::barTimeChanged()
|
|||
if (!te)
|
||||
return;
|
||||
|
||||
if (IS_ARM(getCurrentBoard()))
|
||||
valRef = round(te->timeInSeconds() / te->singleStep());
|
||||
else
|
||||
valRef = round((te->timeInSeconds() - te->minimumTime()) / te->singleStep());
|
||||
valRef = round(te->timeInSeconds() / te->singleStep());
|
||||
|
||||
emit modified();
|
||||
}
|
||||
|
@ -946,29 +644,17 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
|||
model.frsky.usrProto = 1;
|
||||
}
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->varioSource->setField(model.frsky.varioSource, this);
|
||||
ui->varioCenterSilent->setField(model.frsky.varioCenterSilent, this);
|
||||
ui->A1GB->hide();
|
||||
ui->A2GB->hide();
|
||||
for (unsigned i= 0; i < CPN_MAX_SENSORS; ++i) {
|
||||
TelemetrySensorPanel * panel = new TelemetrySensorPanel(this, model.sensorData[i], i, model, generalSettings, firmware);
|
||||
ui->sensorsLayout->addWidget(panel);
|
||||
sensorPanels[i] = panel;
|
||||
connect(panel, SIGNAL(dataModified()), this, SLOT(update()));
|
||||
connect(panel, SIGNAL(modified()), this, SLOT(onModified()));
|
||||
connect(panel, SIGNAL(clearAllSensors()), this, SLOT(on_clearAllSensors()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->sensorsGB->hide();
|
||||
ui->altimetryGB->hide();
|
||||
analogs[0] = new TelemetryAnalog(this, model.frsky.channels[0], model, generalSettings, firmware);
|
||||
ui->A1Layout->addWidget(analogs[0]);
|
||||
connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified()));
|
||||
analogs[1] = new TelemetryAnalog(this, model.frsky.channels[1], model, generalSettings, firmware);
|
||||
ui->A2Layout->addWidget(analogs[1]);
|
||||
connect(analogs[1], SIGNAL(modified()), this, SLOT(onModified()));
|
||||
ui->varioSource->setField(model.frsky.varioSource, this);
|
||||
ui->varioCenterSilent->setField(model.frsky.varioCenterSilent, this);
|
||||
ui->A1GB->hide();
|
||||
ui->A2GB->hide();
|
||||
for (unsigned i= 0; i < CPN_MAX_SENSORS; ++i) {
|
||||
TelemetrySensorPanel * panel = new TelemetrySensorPanel(this, model.sensorData[i], i, model, generalSettings, firmware);
|
||||
ui->sensorsLayout->addWidget(panel);
|
||||
sensorPanels[i] = panel;
|
||||
connect(panel, SIGNAL(dataModified()), this, SLOT(update()));
|
||||
connect(panel, SIGNAL(modified()), this, SLOT(onModified()));
|
||||
connect(panel, SIGNAL(clearAllSensors()), this, SLOT(on_clearAllSensors()));
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9(firmware->getBoard())) {
|
||||
|
@ -1017,10 +703,8 @@ void TelemetryPanel::update()
|
|||
populateTelemetrySourcesComboBox(ui->varioSource, model, false);
|
||||
}
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
for (unsigned i=0; i<CPN_MAX_SENSORS; ++i) {
|
||||
sensorPanels[i]->update();
|
||||
}
|
||||
for (unsigned i=0; i<CPN_MAX_SENSORS; ++i) {
|
||||
sensorPanels[i]->update();
|
||||
}
|
||||
|
||||
emit updated();
|
||||
|
@ -1032,52 +716,29 @@ void TelemetryPanel::setup()
|
|||
|
||||
lock = true;
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->telemetryProtocol->addItem(tr("FrSky S.PORT"), 0);
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D"), 1);
|
||||
if (IS_9XRPRO(firmware->getBoard()) ||
|
||||
(IS_TARANIS(firmware->getBoard()) && generalSettings.auxSerialMode == 2)) {
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
|
||||
}
|
||||
ui->telemetryProtocol->setCurrentIndex(model->telemetryProtocol);
|
||||
ui->ignoreSensorIds->setField(model->frsky.ignoreSensorIds, this);
|
||||
ui->disableTelemetryAlarms->setField(model->rssiAlarms.disabled);
|
||||
}
|
||||
else {
|
||||
ui->telemetryProtocolLabel->hide();
|
||||
ui->telemetryProtocol->hide();
|
||||
ui->ignoreSensorIds->hide();
|
||||
ui->disableTelemetryAlarms->hide();
|
||||
ui->telemetryProtocol->addItem(tr("FrSky S.PORT"), 0);
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D"), 1);
|
||||
if (IS_9XRPRO(firmware->getBoard()) ||
|
||||
(IS_TARANIS(firmware->getBoard()) && generalSettings.auxSerialMode == 2)) {
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
|
||||
}
|
||||
ui->telemetryProtocol->setCurrentIndex(model->telemetryProtocol);
|
||||
ui->ignoreSensorIds->setField(model->frsky.ignoreSensorIds, this);
|
||||
ui->disableTelemetryAlarms->setField(model->rssiAlarms.disabled);
|
||||
|
||||
ui->rssiAlarmWarningSB->setValue(model->rssiAlarms.warning);
|
||||
ui->rssiAlarmCriticalSB->setValue(model->rssiAlarms.critical);
|
||||
if (!IS_ARM(firmware->getBoard())) {
|
||||
ui->rssiSourceLabel->hide();
|
||||
ui->rssiSourceCB->hide();
|
||||
ui->rssiAlarmWarningCB->setCurrentIndex(model->rssiAlarms.level[0]);
|
||||
ui->rssiAlarmCriticalCB->setCurrentIndex(model->rssiAlarms.level[1]);
|
||||
}
|
||||
else {
|
||||
ui->rssiSourceLabel->show();
|
||||
ui->rssiSourceLabel->setText(tr("Source"));
|
||||
ui->rssiSourceCB->setField(model->rssiSource, this);
|
||||
ui->rssiSourceCB->show();
|
||||
populateTelemetrySourcesComboBox(ui->rssiSourceCB, model, false);
|
||||
|
||||
ui->rssiAlarmWarningCB->hide();
|
||||
ui->rssiAlarmCriticalCB->hide();
|
||||
ui->rssiAlarmWarningLabel->setText(tr("Low Alarm"));
|
||||
ui->rssiAlarmCriticalLabel->setText(tr("Critical Alarm"));
|
||||
}
|
||||
ui->rssiSourceLabel->show();
|
||||
ui->rssiSourceLabel->setText(tr("Source"));
|
||||
ui->rssiSourceCB->setField(model->rssiSource, this);
|
||||
ui->rssiSourceCB->show();
|
||||
populateTelemetrySourcesComboBox(ui->rssiSourceCB, model, false);
|
||||
|
||||
/*if (IS_ARM(firmware->getBoard())) {
|
||||
for (int i=0; i<CPN_MAX_SENSORS; ++i) {
|
||||
TelemetrySensorPanel * panel = new TelemetrySensorPanel(this, model->, model, generalSettings, firmware);
|
||||
ui->sensorsLayout->addWidget(panel);
|
||||
sensorPanels[i] = panel;
|
||||
}
|
||||
}*/
|
||||
ui->rssiAlarmWarningCB->hide();
|
||||
ui->rssiAlarmCriticalCB->hide();
|
||||
ui->rssiAlarmWarningLabel->setText(tr("Low Alarm"));
|
||||
ui->rssiAlarmCriticalLabel->setText(tr("Critical Alarm"));
|
||||
|
||||
int varioCap = firmware->getCapability(HasVario);
|
||||
if (!varioCap) {
|
||||
|
@ -1109,7 +770,7 @@ void TelemetryPanel::setup()
|
|||
ui->altimetryGB->setVisible(firmware->getCapability(HasVario)),
|
||||
ui->frskyProtoCB->setDisabled(firmware->getCapability(NoTelemetryProtocol));
|
||||
|
||||
if (firmware->getCapability(Telemetry) & TM_HASWSHH) {
|
||||
if (firmware->getCapability(Telemetry)) {
|
||||
ui->frskyProtoCB->addItem(tr("Winged Shadow How High"));
|
||||
}
|
||||
else {
|
||||
|
@ -1117,38 +778,6 @@ void TelemetryPanel::setup()
|
|||
}
|
||||
|
||||
ui->variousGB->hide();
|
||||
if (!IS_ARM(firmware->getBoard())) {
|
||||
if (!(firmware->getCapability(HasFasOffset)) && !(firmware_id.contains("fasoffset"))) {
|
||||
ui->fasOffset_label->hide();
|
||||
ui->fasOffset_DSB->hide();
|
||||
}
|
||||
else {
|
||||
ui->fasOffset_DSB->setValue(model->frsky.fasOffset/10.0);
|
||||
ui->variousGB->show();
|
||||
}
|
||||
|
||||
if (!(firmware->getCapability(HasMahPersistent))) {
|
||||
ui->mahCount_label->hide();
|
||||
ui->mahCount_SB->hide();
|
||||
ui->mahCount_ChkB->hide();
|
||||
}
|
||||
else {
|
||||
if (model->frsky.mAhPersistent) {
|
||||
ui->mahCount_ChkB->setChecked(true);
|
||||
ui->mahCount_SB->setValue(model->frsky.storedMah);
|
||||
}
|
||||
else {
|
||||
ui->mahCount_SB->setDisabled(true);
|
||||
}
|
||||
ui->variousGB->show();
|
||||
}
|
||||
|
||||
ui->frskyProtoCB->setCurrentIndex(model->frsky.usrProto);
|
||||
ui->bladesCount->setValue(model->frsky.blades);
|
||||
populateVarioSource();
|
||||
populateVoltsSource();
|
||||
populateCurrentSource();
|
||||
}
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
@ -1170,10 +799,8 @@ void TelemetryPanel::populateVoltsSource()
|
|||
cb->setField(model->frsky.voltsSource, this);
|
||||
cb->addItem(tr("A1"), TELEMETRY_VOLTS_SOURCE_A1);
|
||||
cb->addItem(tr("A2"), TELEMETRY_VOLTS_SOURCE_A2);
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
cb->addItem(tr("A3"), TELEMETRY_VOLTS_SOURCE_A3);
|
||||
cb->addItem(tr("A4"), TELEMETRY_VOLTS_SOURCE_A4);
|
||||
}
|
||||
cb->addItem(tr("A3"), TELEMETRY_VOLTS_SOURCE_A3);
|
||||
cb->addItem(tr("A4"), TELEMETRY_VOLTS_SOURCE_A4);
|
||||
cb->addItem(tr("FAS"), TELEMETRY_VOLTS_SOURCE_FAS);
|
||||
cb->addItem(tr("Cells"), TELEMETRY_VOLTS_SOURCE_CELLS);
|
||||
}
|
||||
|
@ -1185,10 +812,8 @@ void TelemetryPanel::populateCurrentSource()
|
|||
cb->addItem(tr("---"), TELEMETRY_CURRENT_SOURCE_NONE);
|
||||
cb->addItem(tr("A1"), TELEMETRY_CURRENT_SOURCE_A1);
|
||||
cb->addItem(tr("A2"), TELEMETRY_CURRENT_SOURCE_A2);
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
cb->addItem(tr("A3"), TELEMETRY_CURRENT_SOURCE_A3);
|
||||
cb->addItem(tr("A4"), TELEMETRY_CURRENT_SOURCE_A4);
|
||||
}
|
||||
cb->addItem(tr("A3"), TELEMETRY_CURRENT_SOURCE_A3);
|
||||
cb->addItem(tr("A4"), TELEMETRY_CURRENT_SOURCE_A4);
|
||||
cb->addItem(tr("FAS"), TELEMETRY_CURRENT_SOURCE_FAS);
|
||||
}
|
||||
|
||||
|
@ -1223,18 +848,6 @@ void TelemetryPanel::on_frskyProtoCB_currentIndexChanged(int index)
|
|||
}
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_rssiAlarmWarningCB_currentIndexChanged(int index)
|
||||
{
|
||||
model->rssiAlarms.level[0] = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_rssiAlarmCriticalCB_currentIndexChanged(int index)
|
||||
{
|
||||
model->rssiAlarms.level[1] = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_rssiAlarmWarningSB_editingFinished()
|
||||
{
|
||||
model->rssiAlarms.warning= ui->rssiAlarmWarningSB->value();
|
||||
|
|
|
@ -31,45 +31,11 @@ class RawSourceFilterItemModel;
|
|||
class TimerEdit;
|
||||
|
||||
namespace Ui {
|
||||
class TelemetryAnalog;
|
||||
class TelemetryCustomScreen;
|
||||
class TelemetrySensor;
|
||||
class Telemetry;
|
||||
}
|
||||
|
||||
class TelemetryAnalog: public ModelPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend class TelemetryPanel;
|
||||
|
||||
public:
|
||||
TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
virtual ~TelemetryAnalog();
|
||||
|
||||
signals:
|
||||
void modified();
|
||||
|
||||
private slots:
|
||||
void on_UnitCB_currentIndexChanged(int index);
|
||||
void on_RatioSB_editingFinished();
|
||||
void on_RatioSB_valueChanged();
|
||||
void on_CalibSB_editingFinished();
|
||||
void on_alarm1LevelCB_currentIndexChanged(int index);
|
||||
void on_alarm1GreaterCB_currentIndexChanged(int index);
|
||||
void on_alarm1ValueSB_editingFinished();
|
||||
void on_alarm2LevelCB_currentIndexChanged(int index);
|
||||
void on_alarm2GreaterCB_currentIndexChanged(int index);
|
||||
void on_alarm2ValueSB_editingFinished();
|
||||
|
||||
private:
|
||||
Ui::TelemetryAnalog *ui;
|
||||
FrSkyChannelData & analog;
|
||||
bool lock;
|
||||
|
||||
void update();
|
||||
};
|
||||
|
||||
class TelemetryCustomScreen: public ModelPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -155,8 +121,6 @@ class TelemetryPanel : public ModelPanel
|
|||
void onModified();
|
||||
void on_frskyProtoCB_currentIndexChanged(int index);
|
||||
void on_bladesCount_editingFinished();
|
||||
void on_rssiAlarmWarningCB_currentIndexChanged(int index);
|
||||
void on_rssiAlarmCriticalCB_currentIndexChanged(int index);
|
||||
void on_rssiAlarmWarningSB_editingFinished();
|
||||
void on_rssiAlarmCriticalSB_editingFinished();
|
||||
void on_varioLimitMin_DSB_editingFinished();
|
||||
|
@ -170,7 +134,6 @@ class TelemetryPanel : public ModelPanel
|
|||
|
||||
private:
|
||||
Ui::Telemetry *ui;
|
||||
TelemetryAnalog * analogs[4];
|
||||
TelemetryCustomScreen * telemetryCustomScreens[4];
|
||||
TelemetrySensorPanel * sensorPanels[CPN_MAX_SENSORS];
|
||||
|
||||
|
|
|
@ -973,8 +973,7 @@ QString ModelPrinter::printSettingsTrim()
|
|||
{
|
||||
QStringList str;
|
||||
str << printLabelValue(tr("Step"), printTrimIncrementMode());
|
||||
if (IS_ARM(firmware->getBoard()))
|
||||
str << printLabelValue(tr("Display"), printTrimsDisplayMode());
|
||||
str << printLabelValue(tr("Display"), printTrimsDisplayMode());
|
||||
str << printLabelValue(tr("Extended"), printBoolean(model.extendedTrims, BOOLEAN_YESNO));
|
||||
return str.join(" ");
|
||||
}
|
||||
|
|
|
@ -292,7 +292,7 @@ QString MultiModelPrinter::print(QTextDocument * document)
|
|||
if (firmware->getCapability(GlobalFunctions))
|
||||
str.append(printGlobalFunctions());
|
||||
str.append(printSpecialFunctions());
|
||||
if (firmware->getCapability(Telemetry) & TM_HASTELEMETRY) {
|
||||
if (firmware->getCapability(Telemetry)) {
|
||||
str.append(printTelemetry());
|
||||
str.append(printSensors());
|
||||
if (firmware->getCapability(TelemetryCustomScreens)) {
|
||||
|
@ -751,32 +751,19 @@ QString MultiModelPrinter::printTelemetry()
|
|||
MultiColumns columns(modelPrinterMap.size());
|
||||
columns.appendSectionTableStart();
|
||||
|
||||
// Analogs on non ARM boards
|
||||
if (!IS_ARM(firmware->getBoard())) {
|
||||
columns.appendRowHeader(QStringList() << tr("Analogs") << tr("Unit") << tr("Scale") << tr("Offset"));
|
||||
for (int i=0; i<2; i++) {
|
||||
columns.appendRowStart(QString("A%1").arg(i+1), 20);
|
||||
COMPARECELLWIDTH(FrSkyChannelData::unitString(model->frsky.channels[i].type), 20);
|
||||
COMPARECELLWIDTH(QString::number((model->frsky.channels[i].ratio / (model->frsky.channels[i].type==0 ? 10.0 : 1)), 10, (model->frsky.channels[i].type==0 ? 1 : 0)), 20);
|
||||
COMPARECELLWIDTH(QString::number((model->frsky.channels[i].offset*(model->frsky.channels[i].ratio / (model->frsky.channels[i].type==0 ?10.0 : 1)))/255, 10, (model->frsky.channels[i].type==0 ? 1 : 0)), 40);
|
||||
columns.appendRowEnd();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Protocol
|
||||
columns.appendRowStart(tr("Protocol"), 20);
|
||||
COMPARECELL(modelPrinter->printTelemetryProtocol(model->telemetryProtocol));
|
||||
columns.appendRowEnd();
|
||||
}
|
||||
// Protocol
|
||||
columns.appendRowStart(tr("Protocol"), 20);
|
||||
COMPARECELL(modelPrinter->printTelemetryProtocol(model->telemetryProtocol));
|
||||
columns.appendRowEnd();
|
||||
|
||||
// RSSI alarms
|
||||
{
|
||||
columns.appendRowStart(tr("RSSI Alarms"), 20);
|
||||
columns.appendCellStart(80);
|
||||
COMPARESTRING("", (IS_ARM(getCurrentBoard()) ? tr("Low") : FrSkyAlarmData::alarmLevelName(model->rssiAlarms.level[0])), false);
|
||||
COMPARESTRING("", tr("Low"), false);
|
||||
columns.append(": ");
|
||||
COMPARESTRING("", QString("< %1").arg(QString::number(model->rssiAlarms.warning, 10)), true);
|
||||
COMPARESTRING("", (IS_ARM(getCurrentBoard()) ? tr("Critical") : FrSkyAlarmData::alarmLevelName(model->rssiAlarms.level[1])), false);
|
||||
COMPARESTRING("", tr("Critical"), false);
|
||||
columns.append(": ");
|
||||
COMPARESTRING("", QString("< %1").arg(QString::number(model->rssiAlarms.critical, 10)), true);
|
||||
COMPARESTRING(tr("Telemetry audio"), modelPrinter->printRssiAlarmsDisabled(model->rssiAlarms.disabled), false);
|
||||
|
@ -818,39 +805,9 @@ QString MultiModelPrinter::printTelemetry()
|
|||
columns.appendRowEnd();
|
||||
}
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ROWLABELCOMPARECELL("Multi sensors", 0, modelPrinter->printIgnoreSensorIds(!model->frsky.ignoreSensorIds), 0);
|
||||
}
|
||||
ROWLABELCOMPARECELL("Multi sensors", 0, modelPrinter->printIgnoreSensorIds(!model->frsky.ignoreSensorIds), 0);
|
||||
|
||||
// Various
|
||||
if (!IS_ARM(firmware->getBoard())) {
|
||||
columns.appendRowHeader(QStringList() << tr("Various"));
|
||||
if (!firmware->getCapability(NoTelemetryProtocol)) {
|
||||
columns.appendRowStart("", 20);
|
||||
LABELCOMPARECELL(tr("Serial protocol"), modelPrinter->printTelemetrySource(model->frsky.voltsSource), 80);
|
||||
columns.appendRowEnd();
|
||||
}
|
||||
columns.appendRowStart("", 20);
|
||||
columns.appendCellStart(80);
|
||||
QString firmware_id = g.profile[g.id()].fwType();
|
||||
if (firmware->getCapability(HasFasOffset) && firmware_id.contains("fasoffset")) {
|
||||
COMPARESTRING(tr("FAS offset"), QString("%1 A").arg(model->frsky.fasOffset/10.0), true);
|
||||
}
|
||||
if (firmware->getCapability(HasMahPersistent)) {
|
||||
COMPARESTRING(tr("mAh count"), QString("%1 mAh").arg(model->frsky.storedMah), true);
|
||||
COMPARESTRING(tr("Persistent mAh"), modelPrinter->printMahPersistent(model->frsky.mAhPersistent), false);
|
||||
}
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart("", 20);
|
||||
columns.appendCellStart(80);
|
||||
COMPARESTRING(tr("Volts source"), modelPrinter->printVoltsSource(model->frsky.voltsSource), true);
|
||||
COMPARESTRING(tr("Current source"), modelPrinter->printCurrentSource(model->frsky.currentSource), false);
|
||||
columns.appendCellEnd();
|
||||
columns.appendRowEnd();
|
||||
columns.appendRowStart("", 20);
|
||||
LABELCOMPARECELL(tr("Blades"), model->frsky.blades, 80);
|
||||
columns.appendRowEnd();
|
||||
}
|
||||
columns.appendTableEnd();
|
||||
str.append(columns.print());
|
||||
return str;
|
||||
|
|
|
@ -36,43 +36,8 @@ QString getRadioInterfaceCmd()
|
|||
if (IS_STM32(board)) {
|
||||
return bcd.getDFU();
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
else
|
||||
return bcd.getSAMBA();
|
||||
}
|
||||
else {
|
||||
return bcd.getAVRDUDE();
|
||||
}
|
||||
}
|
||||
|
||||
QStringList getAvrdudeArgs(const QString & cmd, const QString & filename)
|
||||
{
|
||||
QStringList args;
|
||||
burnConfigDialog bcd;
|
||||
QString programmer = bcd.getProgrammer();
|
||||
QString mcu = bcd.getMCU();
|
||||
Board::Type board = getCurrentBoard();
|
||||
|
||||
args << "-c" << programmer << "-p";
|
||||
if (IS_2560(board))
|
||||
args << "m2560";
|
||||
else if (board == Board::BOARD_9X_M128)
|
||||
args << "m128";
|
||||
else
|
||||
args << mcu;
|
||||
|
||||
args << bcd.getAvrdudeArgs();
|
||||
|
||||
QString fullcmd = cmd + filename;
|
||||
if (QFileInfo(filename).suffix().toUpper() == "HEX")
|
||||
fullcmd += ":i";
|
||||
else if (QFileInfo(filename).suffix().toUpper()=="BIN")
|
||||
fullcmd += ":r";
|
||||
else
|
||||
fullcmd += ":a";
|
||||
|
||||
args << "-U" << fullcmd;
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
QStringList getDfuArgs(const QString & cmd, const QString & filename)
|
||||
|
@ -119,11 +84,8 @@ QStringList getReadEEpromCmd(const QString & filename)
|
|||
if (IS_STM32(eepromInterface->getBoard())) {
|
||||
// impossible
|
||||
}
|
||||
else if (IS_SKY9X(eepromInterface->getBoard())) {
|
||||
result = getSambaArgs(QString("SERIALFLASH::Init 0\n") + "receive_file {SerialFlash AT25} \"" + filename + "\" 0x0 0x80000 0\n");
|
||||
}
|
||||
else {
|
||||
result = getAvrdudeArgs("eeprom:r:", filename);
|
||||
result = getSambaArgs(QString("SERIALFLASH::Init 0\n") + "receive_file {SerialFlash AT25} \"" + filename + "\" 0x0 0x80000 0\n");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -135,11 +97,8 @@ QStringList getWriteEEpromCmd(const QString & filename)
|
|||
// impossible
|
||||
return QStringList();
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
return getSambaArgs(QString("SERIALFLASH::Init 0\n") + "send_file {SerialFlash AT25} \"" + filename + "\" 0x0 0\n");
|
||||
}
|
||||
else {
|
||||
return getAvrdudeArgs("eeprom:w:", filename);
|
||||
return getSambaArgs(QString("SERIALFLASH::Init 0\n") + "send_file {SerialFlash AT25} \"" + filename + "\" 0x0 0\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -152,11 +111,8 @@ QStringList getWriteFirmwareArgs(const QString & filename)
|
|||
else if (board == Board::BOARD_SKY9X) {
|
||||
return getSambaArgs(QString("send_file {Flash} \"") + filename + "\" 0x400000 0\n" + "FLASH::ScriptGPNMV 2\n");
|
||||
}
|
||||
else if (board == Board::BOARD_9XRPRO || board == Board::BOARD_AR9X) {
|
||||
return getSambaArgs(QString("send_file {Flash} \"") + filename + "\" 0x400000 0\n" + "FLASH::ScriptGPNMV 2\n");
|
||||
}
|
||||
else {
|
||||
return getAvrdudeArgs("flash:w:", filename);
|
||||
return getSambaArgs(QString("send_file {Flash} \"") + filename + "\" 0x400000 0\n" + "FLASH::ScriptGPNMV 2\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,87 +125,8 @@ QStringList getReadFirmwareArgs(const QString & filename)
|
|||
else if (board == Board::BOARD_SKY9X) {
|
||||
return getSambaArgs(QString("receive_file {Flash} \"") + filename + "\" 0x400000 0x40000 0\n");
|
||||
}
|
||||
else if (board == Board::BOARD_9XRPRO) {
|
||||
return getSambaArgs(QString("receive_file {Flash} \"") + filename + "\" 0x400000 0x80000 0\n");
|
||||
}
|
||||
else {
|
||||
return getAvrdudeArgs("flash:r:", filename);
|
||||
}
|
||||
}
|
||||
|
||||
void readAvrdudeFuses(ProgressWidget * progress)
|
||||
{
|
||||
burnConfigDialog bcd;
|
||||
QStringList args;
|
||||
args << "-c" << bcd.getProgrammer() << "-p" << bcd.getMCU() << bcd.getAvrdudeArgs() << "-U" << "lfuse:r:-:i" << "-U" << "hfuse:r:-:i" << "-U" << "efuse:r:-:i";
|
||||
FlashProcess flashProcess(bcd.getAVRDUDE(), args, progress);
|
||||
flashProcess.run();
|
||||
}
|
||||
|
||||
void resetAvrdudeFuses(bool eepromProtect, ProgressWidget * progress)
|
||||
{
|
||||
//fuses
|
||||
//avrdude -c usbasp -p m64 -U lfuse:w:<0x0E>:m
|
||||
//avrdude -c usbasp -p m64 -U hfuse:w:<0x89>:m 0x81 for eeprom protection
|
||||
//avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m
|
||||
|
||||
burnConfigDialog bcd;
|
||||
QMessageBox::StandardButton ret = QMessageBox::No;
|
||||
ret = QMessageBox::warning(NULL, CPN_STR_APP_NAME,
|
||||
QCoreApplication::translate("RadioInterface",
|
||||
"<b><u>WARNING!</u></b>" \
|
||||
"<br>This will reset the fuses of %1 to the factory settings.<br>"
|
||||
"Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>"
|
||||
"Are you sure you want to continue?").arg(bcd.getMCU()),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret == QMessageBox::Yes) {
|
||||
QStringList args = bcd.getAvrdudeArgs();
|
||||
QStringList str;
|
||||
if (bcd.getMCU() == "m2560") {
|
||||
args << "-B8";
|
||||
QString erStr = eepromProtect ? "hfuse:w:0x51:m" : "hfuse:w:0x59:m";
|
||||
str << "-U" << "lfuse:w:0xD7:m" << "-U" << erStr << "-U" << "efuse:w:0xFC:m";
|
||||
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
|
||||
}
|
||||
else {
|
||||
QString lfuses;
|
||||
QString tempFile = generateProcessUniqueTempFileName("ftemp.bin");
|
||||
QStringList argread;
|
||||
argread << "-c" << bcd.getProgrammer() << "-p" << bcd.getMCU() << args <<"-U" << "lfuse:r:"+tempFile+":r";
|
||||
FlashProcess flashProcess(bcd.getAVRDUDE(), argread, progress);
|
||||
flashProcess.run();
|
||||
QFile file(tempFile);
|
||||
if (file.exists() && file.size()==1) {
|
||||
file.open(QIODevice::ReadOnly);
|
||||
char bin_flash[1];
|
||||
file.read(bin_flash, 1);
|
||||
if (bin_flash[0]==0x0E) {
|
||||
lfuses = "lfuse:w:0x0E:m";
|
||||
}
|
||||
else {
|
||||
lfuses = "lfuse:w:0x3F:m";
|
||||
}
|
||||
file.close();
|
||||
qunlink(tempFile);
|
||||
}
|
||||
else {
|
||||
lfuses = "lfuse:w:0x3F:m";
|
||||
}
|
||||
|
||||
QString erStr = eepromProtect ? "hfuse:w:0xC1:m" : "hfuse:w:0xC9:m";
|
||||
str << "-U" << lfuses << "-U" << erStr << "-U" << "efuse:w:0xFF:m";
|
||||
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
|
||||
}
|
||||
|
||||
QStringList arguments;
|
||||
if (bcd.getMCU() == "m2560") {
|
||||
arguments << "-c" << bcd.getProgrammer() << "-p" << bcd.getMCU() << args << "-u" << str;
|
||||
}
|
||||
else {
|
||||
arguments << "-c" << bcd.getProgrammer() << "-p" << bcd.getMCU() << args << "-B" << "100" << "-u" << str;
|
||||
}
|
||||
FlashProcess flashProcess(bcd.getAVRDUDE(), arguments, progress);
|
||||
flashProcess.run();
|
||||
return getSambaArgs(QString("receive_file {Flash} \"") + filename + "\" 0x400000 0x80000 0\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -264,13 +141,11 @@ bool readFirmware(const QString & filename, ProgressWidget * progress)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (IS_ARM(getCurrentBoard())) {
|
||||
QString path = findMassstoragePath("FIRMWARE.BIN");
|
||||
if (!path.isEmpty()) {
|
||||
qDebug() << "readFirmware: reading" << path << "into" << filename;
|
||||
CopyProcess copyProcess(path, filename, progress);
|
||||
result = copyProcess.run();
|
||||
}
|
||||
QString path = findMassstoragePath("FIRMWARE.BIN");
|
||||
if (!path.isEmpty()) {
|
||||
qDebug() << "readFirmware: reading" << path << "into" << filename;
|
||||
CopyProcess copyProcess(path, filename, progress);
|
||||
result = copyProcess.run();
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
|
@ -288,13 +163,11 @@ bool readFirmware(const QString & filename, ProgressWidget * progress)
|
|||
|
||||
bool writeFirmware(const QString & filename, ProgressWidget * progress)
|
||||
{
|
||||
if (IS_ARM(getCurrentBoard())) {
|
||||
QString path = findMassstoragePath("FIRMWARE.BIN");
|
||||
if (!path.isEmpty()) {
|
||||
qDebug() << "writeFirmware: writing" << path << "from" << filename;
|
||||
CopyProcess copyProcess(filename, path, progress);
|
||||
return copyProcess.run();
|
||||
}
|
||||
QString path = findMassstoragePath("FIRMWARE.BIN");
|
||||
if (!path.isEmpty()) {
|
||||
qDebug() << "writeFirmware: writing" << path << "from" << filename;
|
||||
CopyProcess copyProcess(filename, path, progress);
|
||||
return copyProcess.run();
|
||||
}
|
||||
|
||||
qDebug() << "writeFirmware: writing" << filename << "with" << getRadioInterfaceCmd() << getWriteFirmwareArgs(filename);
|
||||
|
@ -339,26 +212,25 @@ bool readEeprom(const QString & filename, ProgressWidget * progress)
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (IS_ARM(board)) {
|
||||
QString path = findMassstoragePath("EEPROM.BIN");
|
||||
if (path.isEmpty()) {
|
||||
// On previous OpenTX we called the EEPROM file "TARANIS.BIN" :(
|
||||
path = findMassstoragePath("TARANIS.BIN");
|
||||
}
|
||||
if (path.isEmpty()) {
|
||||
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||
path = findMassstoragePath("ERSKY9X.BIN");
|
||||
}
|
||||
if (path.isEmpty()) {
|
||||
RadioNotFoundDialog dialog(progress);
|
||||
dialog.exec();
|
||||
return false;
|
||||
}
|
||||
CopyProcess copyProcess(path, filename, progress);
|
||||
if (!copyProcess.run()) {
|
||||
return false;
|
||||
}
|
||||
QString path = findMassstoragePath("EEPROM.BIN");
|
||||
if (path.isEmpty()) {
|
||||
// On previous OpenTX we called the EEPROM file "TARANIS.BIN" :(
|
||||
path = findMassstoragePath("TARANIS.BIN");
|
||||
}
|
||||
if (path.isEmpty()) {
|
||||
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||
path = findMassstoragePath("ERSKY9X.BIN");
|
||||
}
|
||||
if (path.isEmpty()) {
|
||||
RadioNotFoundDialog dialog(progress);
|
||||
dialog.exec();
|
||||
return false;
|
||||
}
|
||||
CopyProcess copyProcess(path, filename, progress);
|
||||
if (!copyProcess.run()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!IS_STM32(board)) {
|
||||
FlashProcess flashProcess(getRadioInterfaceCmd(), getReadEEpromCmd(filename), progress);
|
||||
|
@ -375,20 +247,18 @@ bool writeEeprom(const QString & filename, ProgressWidget * progress)
|
|||
{
|
||||
Board::Type board = getCurrentBoard();
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
QString path = findMassstoragePath("EEPROM.BIN");
|
||||
if (path.isEmpty()) {
|
||||
// On previous OpenTX we called the EEPROM file "TARANIS.BIN" :(
|
||||
path = findMassstoragePath("TARANIS.BIN");
|
||||
}
|
||||
if (path.isEmpty()) {
|
||||
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||
path = findMassstoragePath("ERSKY9X.BIN");
|
||||
}
|
||||
if (!path.isEmpty()) {
|
||||
CopyProcess copyProcess(filename, path, progress);
|
||||
return copyProcess.run();
|
||||
}
|
||||
QString path = findMassstoragePath("EEPROM.BIN");
|
||||
if (path.isEmpty()) {
|
||||
// On previous OpenTX we called the EEPROM file "TARANIS.BIN" :(
|
||||
path = findMassstoragePath("TARANIS.BIN");
|
||||
}
|
||||
if (path.isEmpty()) {
|
||||
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||
path = findMassstoragePath("ERSKY9X.BIN");
|
||||
}
|
||||
if (!path.isEmpty()) {
|
||||
CopyProcess copyProcess(filename, path, progress);
|
||||
return copyProcess.run();
|
||||
}
|
||||
|
||||
if (!IS_TARANIS(board)) {
|
||||
|
@ -396,10 +266,8 @@ bool writeEeprom(const QString & filename, ProgressWidget * progress)
|
|||
return flashProcess.run();
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
RadioNotFoundDialog dialog(progress);
|
||||
dialog.exec();
|
||||
}
|
||||
RadioNotFoundDialog dialog(progress);
|
||||
dialog.exec();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -30,13 +30,9 @@ QString getRadioInterfaceCmd();
|
|||
|
||||
QString findMassstoragePath(const QString &filename, bool onlyPath = false);
|
||||
|
||||
QStringList getAvrdudeArgs(const QString &cmd, const QString &filename);
|
||||
QStringList getSambaArgs(const QString &tcl);
|
||||
QStringList getDfuArgs(const QString &cmd, const QString &filename);
|
||||
|
||||
void readAvrdudeFuses(ProgressWidget *progress);
|
||||
void resetAvrdudeFuses(bool eepromProtect, ProgressWidget *progress);
|
||||
|
||||
QStringList getReadEEpromCmd(const QString &filename);
|
||||
QStringList getWriteEEpromCmd(const QString &filename);
|
||||
QStringList getReadFirmwareArgs(const QString &filename);
|
||||
|
|
|
@ -64,7 +64,7 @@ void RleFile::EeFsCreate(uint8_t *eeprom, int size, Board::Type board, unsigned
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
else {
|
||||
eeFsArm = (EeFsArm *)eeprom;
|
||||
eeFsVersion = 5;
|
||||
eeFsSize = 8+4*62;
|
||||
|
@ -84,36 +84,6 @@ void RleFile::EeFsCreate(uint8_t *eeprom, int size, Board::Type board, unsigned
|
|||
eeFsArm->freeList = eeFsFirstBlock;
|
||||
// EeFsFlush();
|
||||
}
|
||||
else {
|
||||
eeFs = (EeFs *)eeprom;
|
||||
eeFsVersion = (IS_2560(board) || board==Board::BOARD_9X_M128) ? 5 : 4;
|
||||
eeFsBlockSize = 16;
|
||||
eeFsLinkSize = 1;
|
||||
|
||||
if (eeFsVersion == 5) {
|
||||
eeFsSize = 4+3*36;
|
||||
eeFsFirstBlock = 1;
|
||||
eeFsBlocksOffset = 112 - 16;
|
||||
eeFsBlocksMax = 1 + (4096-112)/16;
|
||||
}
|
||||
else {
|
||||
eeFsSize = 4+3*20;
|
||||
eeFsFirstBlock = 4;
|
||||
eeFsBlocksOffset = 0;
|
||||
eeFsBlocksMax = 2048/16;
|
||||
}
|
||||
|
||||
memset(eeprom, 0, size);
|
||||
eeFs->version = eeFsVersion;
|
||||
eeFs->mySize = eeFsSize;
|
||||
eeFs->freeList = 0;
|
||||
eeFs->bs = eeFsBlockSize;
|
||||
for (unsigned int i=eeFsFirstBlock; i<eeFsBlocksMax-1; i++)
|
||||
EeFsSetLink(i, i+1);
|
||||
EeFsSetLink(eeFsBlocksMax-1, 0);
|
||||
eeFs->freeList = eeFsFirstBlock;
|
||||
// EeFsFlush();
|
||||
}
|
||||
}
|
||||
|
||||
PACK(struct EepromFileHeader
|
||||
|
@ -146,7 +116,7 @@ bool RleFile::EeFsOpen(uint8_t *eeprom, int size, Board::Type board)
|
|||
searchFat();
|
||||
return 1;
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
else {
|
||||
eeFsArm = (EeFsArm *)eeprom;
|
||||
eeFsVersion = eeFsArm->version;
|
||||
eeFsSize = 8+4*62;
|
||||
|
@ -157,29 +127,6 @@ bool RleFile::EeFsOpen(uint8_t *eeprom, int size, Board::Type board)
|
|||
eeFsBlocksMax = 1 + (Boards::getEEpromSize(board)-eeFsSize) / eeFsBlockSize;
|
||||
return eeFsArm->mySize == eeFsSize;
|
||||
}
|
||||
else {
|
||||
eeFs = (EeFs *)eeprom;
|
||||
eeFsVersion = eeFs->version;
|
||||
eeFsBlockSize = 16;
|
||||
eeFsLinkSize = 1;
|
||||
if (eeFsVersion == 5) {
|
||||
eeFsSize = 4+3*36;
|
||||
eeFsFirstBlock = 1;
|
||||
eeFsBlocksOffset = 112 - 16;
|
||||
eeFsBlocksMax = 1 + (4096-112)/16;
|
||||
}
|
||||
else if (eeFsVersion == 4) {
|
||||
eeFsSize = 4+3*20;
|
||||
eeFsFirstBlock = 4;
|
||||
eeFsBlocksOffset = 0;
|
||||
eeFsBlocksMax = 2048/16;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return eeFs->mySize == eeFsSize;
|
||||
}
|
||||
}
|
||||
|
||||
void RleFile::eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size)
|
||||
|
@ -206,25 +153,16 @@ void RleFile::EeFsWrite(unsigned int blk, unsigned int ofs, uint8_t val)
|
|||
|
||||
unsigned int RleFile::EeFsGetLink(unsigned int blk)
|
||||
{
|
||||
if (IS_ARM(board)) {
|
||||
int16_t ret;
|
||||
eeprom_read_block((uint8_t *)&ret, blk*eeFsBlockSize+eeFsBlocksOffset, eeFsLinkSize);
|
||||
return ret;
|
||||
}
|
||||
else {
|
||||
return EeFsRead(blk, 0);
|
||||
}
|
||||
int16_t ret;
|
||||
eeprom_read_block((uint8_t *)&ret, blk*eeFsBlockSize+eeFsBlocksOffset, eeFsLinkSize);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RleFile::EeFsSetLink(unsigned int blk, unsigned int val)
|
||||
{
|
||||
if (IS_ARM(board)) {
|
||||
int16_t s_link = val;
|
||||
eeprom_write_block((uint8_t *)&s_link, (blk*eeFsBlockSize)+eeFsBlocksOffset, eeFsLinkSize);
|
||||
}
|
||||
else {
|
||||
EeFsWrite(blk, 0, val);
|
||||
}
|
||||
int16_t s_link = val;
|
||||
eeprom_write_block((uint8_t *)&s_link, (blk*eeFsBlockSize)+eeFsBlocksOffset, eeFsLinkSize);
|
||||
|
||||
}
|
||||
|
||||
uint8_t RleFile::EeFsGetDat(unsigned int blk, unsigned int ofs)
|
||||
|
@ -244,10 +182,7 @@ unsigned int RleFile::EeFsGetFree()
|
|||
|
||||
unsigned int ret = 0;
|
||||
unsigned int i;
|
||||
if (IS_ARM(board))
|
||||
i = eeFsArm->freeList;
|
||||
else
|
||||
i = eeFs->freeList;
|
||||
i = eeFsArm->freeList;
|
||||
|
||||
while (i) {
|
||||
ret += eeFsBlockSize-eeFsLinkSize;
|
||||
|
@ -266,14 +201,8 @@ void RleFile::EeFsFree(unsigned int blk)
|
|||
|
||||
unsigned int i = blk;
|
||||
while (EeFsGetLink(i)) i = EeFsGetLink(i);
|
||||
if (IS_ARM(board)) {
|
||||
EeFsSetLink(i, eeFsArm->freeList);
|
||||
eeFsArm->freeList = blk; //chain in front
|
||||
}
|
||||
else {
|
||||
EeFsSetLink(i, eeFs->freeList);
|
||||
eeFs->freeList = blk; //chain in front
|
||||
}
|
||||
EeFsSetLink(i, eeFsArm->freeList);
|
||||
eeFsArm->freeList = blk; //chain in front
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -283,12 +212,9 @@ unsigned int RleFile::EeFsAlloc()
|
|||
{
|
||||
if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
return 0;
|
||||
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
|
||||
unsigned int ret = eeFsArm->freeList;
|
||||
if (ret) {
|
||||
if (IS_ARM(board))
|
||||
eeFsArm->freeList = EeFsGetLink(ret);
|
||||
else
|
||||
eeFs->freeList = EeFsGetLink(ret);
|
||||
eeFsArm->freeList = EeFsGetLink(ret);
|
||||
EeFsSetLink(ret, 0);
|
||||
}
|
||||
return ret;
|
||||
|
@ -299,7 +225,7 @@ unsigned int RleFile::size(unsigned int id)
|
|||
if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
return 0;
|
||||
else
|
||||
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
|
||||
return eeFsArm->files[id].size;
|
||||
}
|
||||
|
||||
unsigned int RleFile::openRd(unsigned int i_fileId)
|
||||
|
@ -327,15 +253,12 @@ unsigned int RleFile::openRd(unsigned int i_fileId)
|
|||
else {
|
||||
m_fileId = i_fileId;
|
||||
m_pos = 0;
|
||||
m_currBlk = (IS_ARM(board) ? eeFsArm->files[m_fileId].startBlk : eeFs->files[m_fileId].startBlk);
|
||||
m_currBlk = eeFsArm->files[m_fileId].startBlk;
|
||||
m_ofs = 0;
|
||||
m_zeroes = 0;
|
||||
m_bRlc = 0;
|
||||
m_err = ERR_NONE; //error reasons
|
||||
if (IS_ARM(board))
|
||||
return eeFsArm->files[m_fileId].typ;
|
||||
else
|
||||
return eeFs->files[m_fileId].typ;
|
||||
return eeFsArm->files[m_fileId].typ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,14 +267,14 @@ unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
|
|||
if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
return 0;
|
||||
|
||||
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
|
||||
unsigned int len = eeFsArm->files[m_fileId].size;
|
||||
len -= m_pos;
|
||||
if (i_len > len) i_len = len;
|
||||
len = i_len;
|
||||
while(len) {
|
||||
if (!m_currBlk) break;
|
||||
*buf++ = EeFsGetDat(m_currBlk, m_ofs++);
|
||||
if (m_ofs >= (eeFsBlockSize-(IS_ARM(board)? 2 : 1))) {
|
||||
if (m_ofs >= (eeFsBlockSize - 2)) {
|
||||
m_ofs = 0;
|
||||
m_currBlk = EeFsGetLink(m_currBlk);
|
||||
}
|
||||
|
@ -492,10 +415,7 @@ unsigned int RleFile::write(const uint8_t *buf, unsigned int i_len)
|
|||
unsigned int len = i_len;
|
||||
if (!m_currBlk && m_pos==0)
|
||||
{
|
||||
if (IS_ARM(board))
|
||||
eeFsArm->files[m_fileId].startBlk = m_currBlk = EeFsAlloc();
|
||||
else
|
||||
eeFs->files[m_fileId].startBlk = m_currBlk = EeFsAlloc();
|
||||
eeFsArm->files[m_fileId].startBlk = m_currBlk = EeFsAlloc();
|
||||
}
|
||||
while (len)
|
||||
{
|
||||
|
@ -527,23 +447,15 @@ unsigned int RleFile::write(const uint8_t *buf, unsigned int i_len)
|
|||
void RleFile::create(unsigned int i_fileId, unsigned int typ)
|
||||
{
|
||||
openRd(i_fileId); //internal use
|
||||
if (IS_ARM(board)) {
|
||||
eeFsArm->files[i_fileId].typ = typ;
|
||||
eeFsArm->files[i_fileId].size = 0;
|
||||
}
|
||||
else {
|
||||
eeFs->files[i_fileId].typ = typ;
|
||||
eeFs->files[i_fileId].size = 0;
|
||||
}
|
||||
eeFsArm->files[i_fileId].typ = typ;
|
||||
eeFsArm->files[i_fileId].size = 0;
|
||||
|
||||
}
|
||||
|
||||
void RleFile::closeTrunc()
|
||||
{
|
||||
unsigned int fri=0;
|
||||
if (IS_ARM(board))
|
||||
eeFsArm->files[m_fileId].size = m_pos;
|
||||
else
|
||||
eeFs->files[m_fileId].size = m_pos;
|
||||
eeFsArm->files[m_fileId].size = m_pos;
|
||||
if (m_currBlk && ( fri = EeFsGetLink(m_currBlk))) EeFsSetLink(m_currBlk, 0);
|
||||
if(fri) EeFsFree( fri ); //chain in
|
||||
}
|
||||
|
|
|
@ -61,27 +61,28 @@ void WizMix::maxMixSwitch(char *name, MixData &mix, int channel, int sw, int wei
|
|||
void WizMix::addMix(ModelData &model, Input input, int weight, int channel, int & mixIndex)
|
||||
{
|
||||
if (input != NO_INPUT) {
|
||||
bool isHorusOrTaranis = IS_ARM(getCurrentBoard());
|
||||
if (input >= RUDDER_INPUT && input <= AILERONS_INPUT) {
|
||||
MixData & mix = model.mixData[mixIndex++];
|
||||
mix.destCh = channel+1;
|
||||
if (isHorusOrTaranis){
|
||||
if (IS_SKY9X(getCurrentBoard())) {
|
||||
mix.srcRaw = RawSource(SOURCE_TYPE_STICK, input-1);
|
||||
}
|
||||
else {
|
||||
int channel = settings.getDefaultChannel(input-1);
|
||||
mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, channel);
|
||||
}
|
||||
else
|
||||
mix.srcRaw = RawSource(SOURCE_TYPE_STICK, input-1);
|
||||
|
||||
mix.weight = weight;
|
||||
}
|
||||
else if (input==FLAPS_INPUT){
|
||||
// There ought to be some kind of constants for switches somewhere...
|
||||
maxMixSwitch((char *)"Flaps Up", model.mixData[mixIndex++], channel+1, isHorusOrTaranis ? SWITCH_SA0 :-SWITCH_ELE , weight); //Taranis-Horus SA-UP, 9X ELE-UP
|
||||
maxMixSwitch((char *)"Flaps Dn", model.mixData[mixIndex++], channel+1, isHorusOrTaranis ? SWITCH_SA2 : SWITCH_ELE , -weight); //Taranis-Horus SA-DOWN, 9X ELE-DOWN
|
||||
maxMixSwitch((char *)"Flaps Up", model.mixData[mixIndex++], channel+1, IS_SKY9X(getCurrentBoard()) ? -SWITCH_ELE : SWITCH_SA0, weight); //Taranis-Horus SA-UP, 9X ELE-UP
|
||||
maxMixSwitch((char *)"Flaps Dn", model.mixData[mixIndex++], channel+1, IS_SKY9X(getCurrentBoard()) ? SWITCH_ELE : SWITCH_SA2, -weight); //Taranis-Horus SA-DOWN, 9X ELE-DOWN
|
||||
|
||||
}
|
||||
else if (input==AIRBRAKES_INPUT){
|
||||
maxMixSwitch((char *)"AirbkOff", model.mixData[mixIndex++], channel+1, isHorusOrTaranis ? SWITCH_SE0 :-SWITCH_RUD , -weight); //Taranis-Horus SE-UP, 9X RUD-UP
|
||||
maxMixSwitch((char *)"AirbkOn", model.mixData[mixIndex++], channel+1, isHorusOrTaranis ? SWITCH_SE2 : SWITCH_RUD , weight); //Tatanis-Horus SE-DOWN, 9X RUD-DOWN
|
||||
maxMixSwitch((char *)"AirbkOff", model.mixData[mixIndex++], channel+1, IS_SKY9X(getCurrentBoard()) ? -SWITCH_RUD : SWITCH_SE0, -weight); //Taranis-Horus SE-UP, 9X RUD-UP
|
||||
maxMixSwitch((char *)"AirbkOn", model.mixData[mixIndex++], channel+1, IS_SKY9X(getCurrentBoard()) ? SWITCH_RUD : SWITCH_SE2, weight); //Tatanis-Horus SE-DOWN, 9X RUD-DOWN
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +121,7 @@ WizMix::operator ModelData()
|
|||
mix.srcRaw = SOURCE_TYPE_MAX;
|
||||
mix.weight = -100;
|
||||
mix.swtch.type = SWITCH_TYPE_SWITCH;
|
||||
mix.swtch.index = IS_ARM(getCurrentBoard()) ? SWITCH_SF0 : SWITCH_THR;
|
||||
mix.swtch.index = IS_SKY9X(getCurrentBoard()) ? SWITCH_THR : SWITCH_SF0;
|
||||
mix.mltpx = MLTPX_REP;
|
||||
memset(mix.name, 0, sizeof(mix.name));
|
||||
strncpy(mix.name, "Cut", MIXDATA_NAME_LEN);
|
||||
|
|
|
@ -15,9 +15,6 @@ STM32_OPTIONS = -DLUA=YES
|
|||
build:
|
||||
mkdir $(BUILDDIR);
|
||||
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=9X ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=GRUVIN9X ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=MEGA2560 ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=SKY9X ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=9XRPRO ../ ; make libsimulator
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ const uint8_t * FrskyDeviceFirmwareUpdate::readFullDuplexFrame(ModuleFifo & fifo
|
|||
|
||||
const uint8_t * FrskyDeviceFirmwareUpdate::readHalfDuplexFrame(uint32_t timeout)
|
||||
{
|
||||
for (int i=timeout; i>=0; i--) {
|
||||
for (int i = timeout; i >= 0; i--) {
|
||||
uint8_t byte ;
|
||||
while (telemetryGetByte(&byte)) {
|
||||
if (pushFrskyTelemetryData(byte)) {
|
||||
|
|
|
@ -613,10 +613,8 @@ class OpenTxSimulatorFactory: public SimulatorFactory
|
|||
return Board::BOARD_TARANIS_X9LITES;
|
||||
#elif defined(PCBX9LITE)
|
||||
return Board::BOARD_TARANIS_X9LITE;
|
||||
#elif defined(PCBTARANIS)
|
||||
return Board::BOARD_TARANIS_X9D;
|
||||
#else
|
||||
return Board::BOARD_9X_M64;
|
||||
return Board::BOARD_TARANIS_X9D;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue