Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6114245229 | |||
| e76880cf26 | |||
| f30dfa3365 | |||
| f4aa92ec20 | |||
| 2640ca9fea | |||
| f6a1420ce3 | |||
| 6c0f65411a | |||
| a7f1ace55b | |||
| b8dedd7940 | |||
| 2703118c56 | |||
| 8bfc7a497a | |||
| 87870c24a5 | |||
| 7610fb43d5 | |||
| 0263784e65 | |||
| 6f74624371 | |||
| 1c721b3817 | |||
| 67d97046bb | |||
| 19d9e6ab19 | |||
| 5d9883d47f | |||
| bb5f1d7d79 | |||
| 30087b4a3a | |||
| 61aa01b9b3 | |||
| 16e06cff70 | |||
| 2073a1f033 | |||
| 563b817b46 | |||
| 8b540a66f6 | |||
| b0b7657756 | |||
| 74d22b623f | |||
| bee01d9999 | |||
| d2055edf62 | |||
| c926ac557b | |||
| 3e2092e32f | |||
| 21054ffc54 | |||
| 350ece0b60 | |||
| 01a103f2e6 | |||
| 2e8e439d27 | |||
| 98e6a3dc21 | |||
| 3b324d076a | |||
| 91c922d5fb | |||
| eac918c2da | |||
| b5f9c0ec84 | |||
| d1f54b099b | |||
| 7b98ad55c0 | |||
| d2cb7cb3dd | |||
| be190b8bb1 | |||
| 4b2c02b2c5 | |||
| 142d3fee1a | |||
| 6a5e938ead | |||
| 2d9ae108ff | |||
| bae84e4e8c | |||
| f4944eefdb | |||
| 5d598cc6a1 | |||
| 945808d69b | |||
| dbe512e45a | |||
| 11efb5121e | |||
| f6274f38aa | |||
| cd1f20b8a0 | |||
| e61b931ddb |
@@ -589,3 +589,16 @@ Raimo Ruotsalainen
|
||||
Brian Harris
|
||||
Sebastian Blüml
|
||||
Efisio Maxia
|
||||
Jeff Theobald
|
||||
Anthony Rizzo
|
||||
Rodney Huddleston
|
||||
Dietmar Drees
|
||||
Jürgen Monden
|
||||
David Morgan
|
||||
Andrew Fernie
|
||||
Michel Baily
|
||||
Donald Burke
|
||||
Ronald Donker
|
||||
Fredie Singh
|
||||
Patrizio Simoncini (monthly)
|
||||
Harald Gabler
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
<h2>Version 2.0.10</h2>
|
||||
<h2>Version 2.0.12 / 2014-09-15</h2>
|
||||
<ul>
|
||||
<li>Typos & Translations updated</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.11 / 2014-09-10</h2>
|
||||
<ul>
|
||||
<li>Limits EEPROM export was broken (all boards except Taranis)</li>
|
||||
<li>Fix issue when a GVAR was used as Offset</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.10 / 2014-09-08</h2>
|
||||
<ul>
|
||||
<li>Taranis is now the default board in General Settings</li>
|
||||
<li>GVARS allowed in Limits min/max/offset</li>
|
||||
<li>Limits displayed in us when ppmus option selected
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.8</h2>
|
||||
<h2>Version 2.0.8 / 2014-07-23</h2>
|
||||
<ul>
|
||||
<li>Compare dialog bugfixes</li>
|
||||
<li>Curve index correctly resetted when type changed</li>
|
||||
|
||||
@@ -2,7 +2,7 @@ PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "0" )
|
||||
SET( C9X_VERSION_REVISION "10" )
|
||||
SET( C9X_VERSION_REVISION "12" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
|
||||
@@ -301,7 +301,7 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
|
||||
break;
|
||||
|
||||
default:
|
||||
result.max = (model.extendedLimits ? 125 : 100);
|
||||
result.max = model.getChannelsMax(true);
|
||||
result.min = -result.max;
|
||||
break;
|
||||
}
|
||||
@@ -460,7 +460,7 @@ QString RawSwitch::toString()
|
||||
};
|
||||
|
||||
static const QString timerModes[] = {
|
||||
QObject::tr("OFF"), QObject::tr("ABS"),
|
||||
QObject::tr("OFF"), QObject::tr("ON"),
|
||||
QObject::tr("THs"), QObject::tr("TH%"), QObject::tr("THt")
|
||||
};
|
||||
|
||||
@@ -723,7 +723,7 @@ void FuncSwData::clear()
|
||||
QString FuncSwData::funcToString()
|
||||
{
|
||||
ModelData model;
|
||||
if (func >= FuncSafetyCh1 && func <= FuncSafetyCh32)
|
||||
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
|
||||
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
|
||||
else if (func == FuncTrainer)
|
||||
return QObject::tr("Trainer");
|
||||
@@ -1309,9 +1309,9 @@ ModelData ModelData::removeGlobalVars()
|
||||
return result;
|
||||
}
|
||||
|
||||
int ModelData::getChannelsMax()
|
||||
int ModelData::getChannelsMax(bool forceExtendedLimits) const
|
||||
{
|
||||
if (extendedLimits)
|
||||
if (forceExtendedLimits || extendedLimits)
|
||||
return IS_TARANIS(GetCurrentFirmware()->getBoard()) ? 150 : 125;
|
||||
else
|
||||
return 100;
|
||||
|
||||
@@ -727,8 +727,8 @@ class LogicalSwitchData { // Logical Switches data
|
||||
};
|
||||
|
||||
enum AssignFunc {
|
||||
FuncSafetyCh1 = 0,
|
||||
FuncSafetyCh32 = FuncSafetyCh1+C9X_NUM_CHNOUT-1,
|
||||
FuncOverrideCH1 = 0,
|
||||
FuncOverrideCH32 = FuncOverrideCH1+C9X_NUM_CHNOUT-1,
|
||||
FuncTrainer,
|
||||
FuncTrainerRUD,
|
||||
FuncTrainerELE,
|
||||
@@ -757,7 +757,7 @@ enum AssignFunc {
|
||||
|
||||
class FuncSwData { // Function Switches data
|
||||
public:
|
||||
FuncSwData(AssignFunc func=FuncSafetyCh1) { clear(); this->func = func; }
|
||||
FuncSwData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; }
|
||||
RawSwitch swtch;
|
||||
AssignFunc func;
|
||||
int param;
|
||||
@@ -1045,7 +1045,7 @@ class ModelData {
|
||||
void clearMixes();
|
||||
void clearInputs();
|
||||
|
||||
int getChannelsMax();
|
||||
int getChannelsMax(bool forceExtendedLimits=false) const;
|
||||
|
||||
protected:
|
||||
void removeGlobalVar(int & var);
|
||||
|
||||
@@ -576,7 +576,7 @@ t_Open9xArmFuncSwData_v208::operator FuncSwData ()
|
||||
FuncSwData c9x;
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
c9x.func = (AssignFunc)(func);
|
||||
if (c9x.func <= FuncSafetyCh32) {
|
||||
if (c9x.func <= FuncOverrideCH32) {
|
||||
c9x.enabled=param & 0x01;
|
||||
c9x.param = (param>>1)<<1;
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ inline int geteepromsize() {
|
||||
#include "radio/src/lua/src/lstate.c"
|
||||
#include "radio/src/lua/src/lstring.c"
|
||||
#include "radio/src/lua/src/ltable.c"
|
||||
#include "radio/src/lua/src/lrotable.c"
|
||||
#include "radio/src/lua/src/ltm.c"
|
||||
#include "radio/src/lua/src/lundump.c"
|
||||
#include "radio/src/lua/src/lvm.c"
|
||||
@@ -156,6 +157,7 @@ inline int geteepromsize() {
|
||||
#include "radio/src/lua/src/lbaselib.c"
|
||||
#include "radio/src/lua/src/linit.c"
|
||||
#include "radio/src/lua/src/lmathlib.c"
|
||||
#include "radio/src/lua/src/lbitlib.c"
|
||||
#include "radio/src/lua/src/loadlib.c"
|
||||
#include "radio/src/lua/src/lauxlib.c"
|
||||
#include "radio/src/lua/src/ltablib.c"
|
||||
|
||||
@@ -1039,6 +1039,8 @@ class MixField: public TransformedField {
|
||||
mix.curve = CurveReference(CurveReference::CURVE_REF_DIFF, smallGvarToC9x(_curveParam));
|
||||
else if (_curveParam > 6)
|
||||
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam-6);
|
||||
else if (_curveParam < 0)
|
||||
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam);
|
||||
else
|
||||
mix.curve = CurveReference(CurveReference::CURVE_REF_FUNC, _curveParam);
|
||||
}
|
||||
@@ -1098,7 +1100,7 @@ class InputField: public TransformedField {
|
||||
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
|
||||
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
|
||||
internalField.Append(new ZCharField<8>(expo.name));
|
||||
internalField.Append(new SignedField<8>(expo.offset, "Offset"));
|
||||
internalField.Append(new SignedField<8>(_offset, "Offset"));
|
||||
internalField.Append(new CurveReferenceField(expo.curve, board, version));
|
||||
internalField.Append(new SpareBitsField<8>());
|
||||
}
|
||||
@@ -1153,6 +1155,10 @@ class InputField: public TransformedField {
|
||||
{
|
||||
_weight = smallGvarToEEPROM(expo.weight);
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
_offset = smallGvarToEEPROM(expo.offset);
|
||||
}
|
||||
|
||||
if (!IS_TARANIS(board) || version < 216) {
|
||||
if (expo.curve.type==CurveReference::CURVE_REF_FUNC && expo.curve.value) {
|
||||
_curveMode = true;
|
||||
@@ -1184,6 +1190,10 @@ class InputField: public TransformedField {
|
||||
|
||||
expo.weight = smallGvarToC9x(_weight);
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
expo.offset = smallGvarToC9x(_offset);
|
||||
}
|
||||
|
||||
if (!IS_TARANIS(board) || version < 216) {
|
||||
if (!_curveMode)
|
||||
expo.curve = CurveReference(CurveReference::CURVE_REF_EXPO, smallGvarToC9x(_curveParam));
|
||||
@@ -1201,6 +1211,7 @@ class InputField: public TransformedField {
|
||||
unsigned int version;
|
||||
bool _curveMode;
|
||||
int _weight;
|
||||
int _offset;
|
||||
int _curveParam;
|
||||
};
|
||||
|
||||
@@ -1857,10 +1868,10 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
else
|
||||
_active = (fn.enabled ? 1 : 0);
|
||||
|
||||
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
if (version >= 216) {
|
||||
*((uint16_t *)_param) = fn.param;
|
||||
*((uint8_t *)(_param+3)) = fn.func - FuncSafetyCh1;
|
||||
*((uint8_t *)(_param+3)) = fn.func - FuncOverrideCH1;
|
||||
}
|
||||
else {
|
||||
*((uint32_t *)_param) = fn.param;
|
||||
@@ -1939,7 +1950,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
value = *((uint32_t *)_param);
|
||||
}
|
||||
|
||||
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
fn.func = AssignFunc(fn.func + index);
|
||||
fn.param = (int8_t)value;
|
||||
}
|
||||
@@ -2044,9 +2055,9 @@ class AvrCustomFunctionField: public TransformedField {
|
||||
_param = fn.param;
|
||||
_active = (fn.enabled ? 1 : 0);
|
||||
|
||||
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
if (version >= 216)
|
||||
_union_param = fn.func - FuncSafetyCh1;
|
||||
_union_param = fn.func - FuncOverrideCH1;
|
||||
else if (version >= 213)
|
||||
_active += ((fn.func % 4) << 1);
|
||||
}
|
||||
@@ -2104,7 +2115,7 @@ class AvrCustomFunctionField: public TransformedField {
|
||||
fn.enabled = (_active & 0x01);
|
||||
}
|
||||
|
||||
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
if (version >= 216)
|
||||
fn.func = AssignFunc(fn.func + _union_param);
|
||||
else if (version >= 213)
|
||||
|
||||
@@ -186,14 +186,14 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox
|
||||
}
|
||||
|
||||
if (sb) {
|
||||
sb->setMinimum(step*mini);
|
||||
sb->setMaximum(step*maxi);
|
||||
sb->setValue(step*val);
|
||||
sb->setMinimum(mini);
|
||||
sb->setMaximum(maxi);
|
||||
sb->setValue(val);
|
||||
}
|
||||
else {
|
||||
dsb->setMinimum(step*mini);
|
||||
dsb->setMaximum(step*maxi);
|
||||
dsb->setValue(step*val);
|
||||
dsb->setMinimum(mini*step);
|
||||
dsb->setMaximum(maxi*step);
|
||||
dsb->setValue(val*step);
|
||||
}
|
||||
|
||||
connect(weightSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
@@ -217,7 +217,7 @@ void GVarGroup::valuesChanged()
|
||||
if (weightGV->isChecked())
|
||||
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
|
||||
else if (sb)
|
||||
weight = sb->value()/step;
|
||||
weight = sb->value();
|
||||
else
|
||||
weight = dsb->value()/step;
|
||||
}
|
||||
@@ -1022,7 +1022,6 @@ QString index2version(int index)
|
||||
|
||||
int qunlink(const QString & fileName)
|
||||
{
|
||||
qDebug() << "unlinking "<< fileName;
|
||||
QByteArray ba = fileName.toLatin1();
|
||||
return unlink(ba.constData());
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class GVarGroup: public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1, bool allowGVars=true);
|
||||
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
|
||||
|
||||
protected slots:
|
||||
void gvarCBChanged(int);
|
||||
|
||||
@@ -11,17 +11,17 @@ LimitsGroup::LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout,
|
||||
firmware(firmware),
|
||||
spinbox(new QDoubleSpinBox()),
|
||||
value(value),
|
||||
step(1.0)
|
||||
displayStep(0.1)
|
||||
{
|
||||
|
||||
bool allowGVars = false;
|
||||
int internalStep = 1;
|
||||
|
||||
spinbox->setProperty("index", row);
|
||||
spinbox->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
spinbox->setAccelerated(true);
|
||||
|
||||
if (firmware->getCapability(PPMUnitMicroseconds)) {
|
||||
step = 5.12;
|
||||
displayStep = 0.512;
|
||||
spinbox->setDecimals(1);
|
||||
spinbox->setSuffix("us");
|
||||
}
|
||||
@@ -31,15 +31,14 @@ LimitsGroup::LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout,
|
||||
}
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard()) || deflt == 0 /*it's the offset*/) {
|
||||
min *= 10;
|
||||
max *= 10;
|
||||
deflt *= 10;
|
||||
step /= 10;
|
||||
spinbox->setDecimals(1);
|
||||
allowGVars = true;
|
||||
}
|
||||
|
||||
spinbox->setSingleStep(step);
|
||||
else {
|
||||
internalStep *= 10;
|
||||
}
|
||||
|
||||
spinbox->setSingleStep(displayStep*internalStep);
|
||||
|
||||
QHBoxLayout * horizontalLayout = new QHBoxLayout();
|
||||
QCheckBox * gv = new QCheckBox(QObject::tr("GV"));
|
||||
@@ -48,7 +47,7 @@ LimitsGroup::LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout,
|
||||
horizontalLayout->addWidget(cb);
|
||||
horizontalLayout->addWidget(spinbox);
|
||||
gridLayout->addLayout(horizontalLayout, row, col, 1, 1);
|
||||
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, step, allowGVars);
|
||||
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
|
||||
}
|
||||
|
||||
LimitsGroup::~LimitsGroup()
|
||||
@@ -58,17 +57,14 @@ LimitsGroup::~LimitsGroup()
|
||||
|
||||
void LimitsGroup::updateMinMax(int max)
|
||||
{
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
max *= 10;
|
||||
}
|
||||
if (spinbox->maximum() == 0) {
|
||||
spinbox->setMinimum(-step*max);
|
||||
spinbox->setMinimum(-max*displayStep);
|
||||
if (value < -max) {
|
||||
value = -max;
|
||||
}
|
||||
}
|
||||
if (spinbox->minimum() == 0) {
|
||||
spinbox->setMaximum(step*max);
|
||||
spinbox->setMaximum(max*displayStep);
|
||||
if (value > max) {
|
||||
value = max;
|
||||
}
|
||||
@@ -120,13 +116,13 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
}
|
||||
|
||||
// Channel offset
|
||||
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].offset, -100, 100, 0);
|
||||
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].offset, -1000, 1000, 0);
|
||||
|
||||
// Channel min
|
||||
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].min, -model.getChannelsMax(), 0, -100);
|
||||
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
|
||||
|
||||
// Channel max
|
||||
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].max, 0, model.getChannelsMax(), 100);
|
||||
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
|
||||
|
||||
// Channel inversion
|
||||
QComboBox * invCB = new QComboBox(this);
|
||||
@@ -211,7 +207,7 @@ void Channels::refreshExtendedLimits()
|
||||
int channelMax = model.getChannelsMax();
|
||||
|
||||
foreach(LimitsGroup *group, limitsGroups) {
|
||||
group->updateMinMax(channelMax);
|
||||
group->updateMinMax(10*channelMax);
|
||||
}
|
||||
|
||||
emit modified();
|
||||
|
||||
@@ -19,7 +19,7 @@ class LimitsGroup
|
||||
QDoubleSpinBox * spinbox;
|
||||
GVarGroup * gvarGroup;
|
||||
int & value;
|
||||
double step;
|
||||
double displayStep;
|
||||
};
|
||||
|
||||
class Channels : public ModelPanel
|
||||
|
||||
@@ -318,11 +318,12 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
|
||||
int index = fswtchFunc[i]->currentIndex();
|
||||
|
||||
if (index>=FuncSafetyCh1 && index<=FuncSafetyCh32) {
|
||||
if (index>=FuncOverrideCH1 && index<=FuncOverrideCH32) {
|
||||
int channelsMax = model.getChannelsMax(true);
|
||||
fswtchParam[i]->setDecimals(0);
|
||||
fswtchParam[i]->setSingleStep(1);
|
||||
fswtchParam[i]->setMinimum(-125);
|
||||
fswtchParam[i]->setMaximum(125);
|
||||
fswtchParam[i]->setMinimum(-channelsMax);
|
||||
fswtchParam[i]->setMaximum(channelsMax);
|
||||
if (modified) {
|
||||
model.funcSw[i].param = fswtchParam[i]->value();
|
||||
}
|
||||
@@ -590,7 +591,7 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
|
||||
b->clear();
|
||||
for (unsigned int i=0; i<FuncCount; i++) {
|
||||
b->addItem(FuncSwData(AssignFunc(i)).funcToString());
|
||||
if (((i>=FuncSafetyCh1 && i<=FuncSafetyCh32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
|
||||
if (((i>=FuncOverrideCH1 && i<=FuncOverrideCH32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
|
||||
((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
|
||||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
|
||||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
|
||||
|
||||
@@ -11,6 +11,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
selectedSwitch(0)
|
||||
{
|
||||
int channelsMax = model.getChannelsMax(true);
|
||||
|
||||
QGridLayout * gridLayout = new QGridLayout(this);
|
||||
|
||||
int col = 1;
|
||||
@@ -48,8 +50,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
gridLayout->addWidget(cswitchSource1[i], i+1, 2);
|
||||
cswitchSource1[i]->setVisible(false);
|
||||
cswitchValue[i] = new QDoubleSpinBox(this);
|
||||
cswitchValue[i]->setMaximum(125);
|
||||
cswitchValue[i]->setMinimum(-125);
|
||||
cswitchValue[i]->setMaximum(channelsMax);
|
||||
cswitchValue[i]->setMinimum(-channelsMax);
|
||||
cswitchValue[i]->setAccelerated(true);
|
||||
cswitchValue[i]->setDecimals(0);
|
||||
cswitchValue[i]->setProperty("index", i);
|
||||
@@ -66,8 +68,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
cswitchSource2[i]->setVisible(false);
|
||||
cswitchOffset[i] = new QDoubleSpinBox(this);
|
||||
cswitchOffset[i]->setProperty("index",i);
|
||||
cswitchOffset[i]->setMaximum(125);
|
||||
cswitchOffset[i]->setMinimum(-125);
|
||||
cswitchOffset[i]->setMaximum(channelsMax);
|
||||
cswitchOffset[i]->setMinimum(-channelsMax);
|
||||
cswitchOffset[i]->setAccelerated(true);
|
||||
cswitchOffset[i]->setDecimals(0);
|
||||
connect(cswitchOffset[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
|
||||
@@ -75,8 +77,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
v2Layout->addWidget(cswitchOffset[i]);
|
||||
cswitchOffset2[i] = new QDoubleSpinBox(this);
|
||||
cswitchOffset2[i]->setProperty("index",i);
|
||||
cswitchOffset2[i]->setMaximum(125);
|
||||
cswitchOffset2[i]->setMinimum(-125);
|
||||
cswitchOffset2[i]->setMaximum(channelsMax);
|
||||
cswitchOffset2[i]->setMinimum(-channelsMax);
|
||||
cswitchOffset2[i]->setAccelerated(true);
|
||||
cswitchOffset2[i]->setDecimals(0);
|
||||
connect(cswitchOffset2[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
|
||||
@@ -239,7 +241,7 @@ void LogicalSwitchesPanel::edited()
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.1);
|
||||
break;
|
||||
case LS_FAMILY_STAY:
|
||||
cswitchOffset2[i]->setSpecialValueText(tr("(no release)"));
|
||||
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
|
||||
if (sender() == cswitchOffset[i]) {
|
||||
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
|
||||
@@ -249,7 +251,7 @@ void LogicalSwitchesPanel::edited()
|
||||
}
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value()-0.1);
|
||||
if (model.customSw[i].val3 == 0) {
|
||||
cswitchOffset2[i]->setSuffix("(infinite)");
|
||||
cswitchOffset2[i]->setSuffix("(release)");
|
||||
}
|
||||
else {
|
||||
cswitchOffset2[i]->setSuffix("");
|
||||
@@ -334,9 +336,9 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings, LogicalSwitchesContext);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value()-0.1);
|
||||
cswitchOffset2[i]->setSpecialValueText(tr("(no release)"));
|
||||
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
|
||||
if (model.customSw[i].val3 == 0) {
|
||||
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
|
||||
cswitchOffset2[i]->setSuffix(tr("(release)"));
|
||||
}
|
||||
else {
|
||||
cswitchOffset2[i]->setSuffix("");
|
||||
|
||||
+1186
-1339
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+147
-120
@@ -1,220 +1,247 @@
|
||||
<h2>Version 2.0.10 / 2014-09-08</h2>
|
||||
[All]
|
||||
<h2>Version 2.0.12 / 2014-09-16</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Duration and AND fixed on Sticky and Edge logical switches
|
||||
<li>LTR patch (modified) applied to the Lua code. Saves around 8-10k RAM</li>
|
||||
<li>Lua hardening again!</li>
|
||||
<li>bit32 lib added to the Lua interpreter</li>
|
||||
<li>Audio tones distorsion (just after playing a wav file)</li>
|
||||
<li>ABS changed to ON in Timers modes</li>
|
||||
<li>S2 and S3 pots inverted on Taranis+</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.11 / 2014-09-10</h2>
|
||||
[9XR-PRO]
|
||||
<ul>
|
||||
<li>Audio broken (since we changed the ARM GCC compiler)</li>
|
||||
</ul>
|
||||
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>CCPM issue on Helis when cross trims used
|
||||
<li>Taranis+ LCD color range and brightness adjusted
|
||||
<li>Taranis+ SWR removed
|
||||
<li>Lua small enhancements (TIMEHOUR constant, GVARS over 500)
|
||||
<li>Lua hardening, use of newlib-nano (optimizes RAM usage)
|
||||
<li>Incoming telemetry rejected if RSSI=0
|
||||
<li>Assign Bitmap impossible if filename length too big
|
||||
<li>
|
||||
<li>Switch warning didn't allow access to SG</li>
|
||||
<li>Pot warning would show S3 when the cursor wasn't on the Pot Warning line</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.10 / 2014-09-08</h2>
|
||||
[All]
|
||||
<ul>
|
||||
<li>Duration and AND fixed on Sticky and Edge logical switches</li>
|
||||
</ul>
|
||||
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>CCPM issue on Helis when cross trims used</li>
|
||||
<li>Taranis+ LCD color range and brightness adjusted</li>
|
||||
<li>Taranis+ SWR removed</li>
|
||||
<li>Lua small enhancements (TIMEHOUR constant, GVARS over 500)</li>
|
||||
<li>Lua hardening, use of newlib-nano (optimizes RAM usage)</li>
|
||||
<li>Incoming telemetry rejected if RSSI=0</li>
|
||||
<li>Assign Bitmap impossible if filename length too big</li>
|
||||
</ul>
|
||||
|
||||
[9XR-PRO]
|
||||
<ul>
|
||||
<li>Telemetry enabled
|
||||
<li>Telemetry enabled</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.8 / 2014-07-23</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Curve wrongly displayed when used in an Input with a positive offset
|
||||
<li>Telemetry Channels are now accessible through Lua
|
||||
<li>New string Lua fields added for accessing sources
|
||||
<li>Trims now applied on Inputs when used in Logical Switches
|
||||
<li>Option "nojoystick" added
|
||||
<li>Curve wrongly displayed when used in an Input with a positive offset</li>
|
||||
<li>Telemetry Channels are now accessible through Lua</li>
|
||||
<li>New string Lua fields added for accessing sources</li>
|
||||
<li>Trims now applied on Inputs when used in Logical Switches</li>
|
||||
<li>Option "nojoystick" added</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.7 / 2014-07-15</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Instant Trim problem when using a negative curve
|
||||
<li>Instant Trim problem when using a negative curve</li>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>SafetyCH function was missing on the compilation server
|
||||
<li>SafetyCH function was missing on the compilation server</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.6 / 2014-07-13</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Telemetry Type field is hidden when only S.PORT is available
|
||||
<li>Permanent timers may be not resetted on Flight Reset
|
||||
<li>Instant Trim bugfix
|
||||
<li>No sound on trim press when trim option disabled
|
||||
<li>[Page] / [Page Long] allowed to change Telemetry screen
|
||||
<li>XXL font added for Lua telemetry screens
|
||||
<li>
|
||||
<li>Telemetry Type field is hidden when only S.PORT is available</li>
|
||||
<li>Permanent timers may be not resetted on Flight Reset</li>
|
||||
<li>Instant Trim bugfix</li>
|
||||
<li>No sound on trim press when trim option disabled</li>
|
||||
<li>[Page] / [Page Long] allowed to change Telemetry screen</li>
|
||||
<li>XXL font added for Lua telemetry screens</li>
|
||||
</ul>
|
||||
|
||||
[9XR-PRO / Sky9x]
|
||||
<ul>
|
||||
<li>RTC time was not stored correctly
|
||||
<li>PPM polarity fix
|
||||
<li>RTC time was not stored correctly</li>
|
||||
<li>PPM polarity fix</li>
|
||||
</ul>
|
||||
|
||||
[Gruvin9x, 9X128, 9XR128]
|
||||
<ul>
|
||||
<li>12 logical switches instead of 15 (the extra ones were not accessible in custom functions)
|
||||
<li>12 logical switches instead of 15 (the extra ones were not accessible in custom functions)</li>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>Logical switches were not resetted on Model load
|
||||
<li>SafetyCH function can be hidden (depending on Companion options)
|
||||
<li>MPH to km/h conversion improved
|
||||
<li>Logical switches were not resetted on Model load</li>
|
||||
<li>SafetyCH function can be hidden (depending on Companion options)</li>
|
||||
<li>MPH to km/h conversion improved</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.5 / 2014-06-26</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Add Flight Mode indication to the mixer/inputs screens
|
||||
<li>Joystick emulation fixed
|
||||
<li>Fixed float number display in Lua
|
||||
<li>Fixed telemetry screens page order (Lua, custom, voltage, GPS)
|
||||
<li>Fixed unability to disable switch warning for SG
|
||||
<li>Lua bugfixes in getCustomFunction/setCustomFunction and getLogicalSwitch/setLogicalSwitch
|
||||
<li>Add Flight Mode indication to the mixer/inputs screens</li>
|
||||
<li>Joystick emulation fixed</li>
|
||||
<li>Fixed float number display in Lua</li>
|
||||
<li>Fixed telemetry screens page order (Lua, custom, voltage, GPS)</li>
|
||||
<li>Fixed unability to disable switch warning for SG</li>
|
||||
<li>Lua bugfixes in getCustomFunction/setCustomFunction and getLogicalSwitch/setLogicalSwitch</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.4 / 2014-06-24</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Lua Telemetry custom screens added
|
||||
<li>Lua wrong memory used indication
|
||||
<li>Telemetry on the serial port in the battery bay
|
||||
<li>
|
||||
<li>Lua Telemetry custom screens added</li>
|
||||
<li>Lua wrong memory used indication</li>
|
||||
<li>Telemetry on the serial port in the battery bay</li>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>Air Speed added in Logs
|
||||
<li>|d|>x bug fix
|
||||
<li>Air Speed added in Logs</li>
|
||||
<li>|d|>x bug fix</li>
|
||||
<li>Timers played even if 00:00
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.3 / 2014-06-17</h2>
|
||||
<ul>
|
||||
<li>Bugfix on Reset Flight function (possible freeze of the menus)
|
||||
<li>Imperial units bug (on altitude)
|
||||
<li>FIRMWARE.BIN and EEPROM.BIN are not anymore marked as system files
|
||||
<li>Bugfix on Reset Flight function (possible freeze of the menus)</li>
|
||||
<li>Imperial units bug (on altitude)</li>
|
||||
<li>FIRMWARE.BIN and EEPROM.BIN are not anymore marked as system files</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.2 / 2014-06-12</h2>
|
||||
<ul>
|
||||
<li>RxBatt removed (merged with A1 as before)
|
||||
<li>Bootloader accessible through the 2 trims (as 2.0.0)
|
||||
<li>Delay on switches middle position only applied to Play functions
|
||||
<li>Delay for Play functions is configurable (0-300ms)
|
||||
<li>SWR, A3 and A4 now recorded in SD logs
|
||||
<li>Persistent mAh was not correctly stored in EEPROM
|
||||
<li>A lot of small bug fixes
|
||||
<li>RxBatt removed (merged with A1 as before)</li>
|
||||
<li>Bootloader accessible through the 2 trims (as 2.0.0)</li>
|
||||
<li>Delay on switches middle position only applied to Play functions</li>
|
||||
<li>Delay for Play functions is configurable (0-300ms)</li>
|
||||
<li>SWR, A3 and A4 now recorded in SD logs</li>
|
||||
<li>Persistent mAh was not correctly stored in EEPROM</li>
|
||||
<li>A lot of small bug fixes</li>
|
||||
</ul>
|
||||
|
||||
<h2>OpenTX 2.0.1 / 2014-02-05</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>S.PORT / D protocol choice added in TELEMETRY menu
|
||||
<li>Heli mixer fix (stick modes 2/3/4)
|
||||
<li>Multipos switch fix
|
||||
<li>Italian translations updated
|
||||
<li>French translations fixes
|
||||
<li>Multis Wizard added
|
||||
<li>Bootloader now needs only one trim pressed
|
||||
<li>S3 warning hidden (no S3 on Taranis)
|
||||
<li>Persistent mAh was broken
|
||||
<li>S.PORT / D protocol choice added in TELEMETRY menu</li>
|
||||
<li>Heli mixer fix (stick modes 2/3/4)</li>
|
||||
<li>Multipos switch fix</li>
|
||||
<li>Italian translations updated</li>
|
||||
<li>French translations fixes</li>
|
||||
<li>Multis Wizard added</li>
|
||||
<li>Bootloader now needs only one trim pressed</li>
|
||||
<li>S3 warning hidden (no S3 on Taranis)</li>
|
||||
<li>Persistent mAh was broken</li>
|
||||
</ul>
|
||||
|
||||
[Stock]
|
||||
<ul>
|
||||
<li>Fix for LS used as source
|
||||
<li>Fix for LS used as source</li>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>Fix on d>=x logical switches
|
||||
<li>Fix on d>=x logical switches</li>
|
||||
</ul>
|
||||
|
||||
<h2>OpenTX 2.0.0 / 2014-06-02</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Inputs layer with support for all physical inputs and telemetry
|
||||
<li>Lua interpreter for runtime scripts and one-time configuration assistants
|
||||
<li>GVARs useable for offsets and limits
|
||||
<li>GVAR modification popup on home screen can be enabled/disabled for each GVAR
|
||||
<li>Output curve assignable to each servo on the SERVOS page
|
||||
<li>32 curves instead of 16, with smoothing, and any number of points between 2 and 17
|
||||
<li>Pot position memory for the 4 pots, with startup warning
|
||||
<li>Copy/paste/insert/delete of custom function lines
|
||||
<li>Altitude can be displayed in the top bar
|
||||
<li>FrSky Taranis will run at 120MHz instead of 60MHz
|
||||
<li>New trim system (a mode's trims can be relative to that of another mode's)
|
||||
<li>SPORT data form internal module available on the UART connector in the battery compartment in the Taranis
|
||||
<li>Support for 6-position pots, with individual positions available in the switch selection list
|
||||
<li>Taranis will be useable as a standard PC joystick through USB, 8 analogs and 8 buttons mapped to CH1-8 and 9-16 respectively
|
||||
<li>Inputs layer with support for all physical inputs and telemetry</li>
|
||||
<li>Lua interpreter for runtime scripts and one-time configuration assistants</li>
|
||||
<li>GVARs useable for offsets and limits</li>
|
||||
<li>GVAR modification popup on home screen can be enabled/disabled for each GVAR</li>
|
||||
<li>Output curve assignable to each servo on the SERVOS page</li>
|
||||
<li>32 curves instead of 16, with smoothing, and any number of points between 2 and 17</li>
|
||||
<li>Pot position memory for the 4 pots, with startup warning</li>
|
||||
<li>Copy/paste/insert/delete of custom function lines</li>
|
||||
<li>Altitude can be displayed in the top bar</li>
|
||||
<li>FrSky Taranis will run at 120MHz instead of 60MHz</li>
|
||||
<li>New trim system (a mode's trims can be relative to that of another mode's)</li>
|
||||
<li>SPORT data form internal module available on the UART connector in the battery compartment in the Taranis</li>
|
||||
<li>Support for 6-position pots, with individual positions available in the switch selection list</li>
|
||||
<li>Taranis will be useable as a standard PC joystick through USB, 8 analogs and 8 buttons mapped to CH1-8 and 9-16 respectively</li>
|
||||
</ul>
|
||||
|
||||
[ARM Boards]
|
||||
<ul>
|
||||
<li>Measured consumption (mAh) can be stored on power off
|
||||
<li>0.1% resolution for limits
|
||||
<li>Sound repeat time settable in multiples of 1sec, call at model load can be disabled
|
||||
<li>3 options for timer countdown voice output
|
||||
<li>9 GVARS instead of 5 (ARM boards only)
|
||||
<li>64 custom functions instead of 32
|
||||
<li>Ability to read text files from the SD card. A file with the name of a model will be linked to it and easily accessible as "model notes". Can be displayed automatically at model load for use as a checklist
|
||||
<li>Bootloader added, removes the need to install computer drivers to flash new firmware
|
||||
<li>Radio can handle EEPROM conversion by itself (no need for companion)
|
||||
<li>Improved vario sounds
|
||||
<li>Default audio files can be placed on the SD card for each model for all switch positions (both for physical and logical switches).
|
||||
<li>Support for up to 16 channels on trainer input
|
||||
<li>Measured consumption (mAh) can be stored on power off</li>
|
||||
<li>0.1% resolution for limits</li>
|
||||
<li>Sound repeat time settable in multiples of 1sec, call at model load can be disabled</li>
|
||||
<li>3 options for timer countdown voice output</li>
|
||||
<li>9 GVARS instead of 5 (ARM boards only)</li>
|
||||
<li>64 custom functions instead of 32</li>
|
||||
<li>Ability to read text files from the SD card. A file with the name of a model will be linked to it and easily accessible as "model notes". Can be displayed automatically at model load for use as a checklist</li>
|
||||
<li>Bootloader added, removes the need to install computer drivers to flash new firmware</li>
|
||||
<li>Radio can handle EEPROM conversion by itself (no need for companion)</li>
|
||||
<li>Improved vario sounds</li>
|
||||
<li>Default audio files can be placed on the SD card for each model for all switch positions (both for physical and logical switches)</li>
|
||||
<li>Support for up to 16 channels on trainer input</li>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>Proportional fonts
|
||||
<li>Switch warnings can be disabled for switches you don't use on a given model
|
||||
<li>Compensation for offset error of FrSky FAS-xx current sensors (option on m64)
|
||||
<li>Companion merged into OpenTX
|
||||
<li>Companion major code / graphics refactoring
|
||||
<li>Sticky Logical Switches
|
||||
<li>ASpd, dTE, Cel-, Vfas- added to Telemetry values
|
||||
<li>Workaround for newer bogus FlySky modules that send out servo centers on powerup (9x only)
|
||||
<li>Finnish language support
|
||||
<li>Proportional fonts</li>
|
||||
<li>Switch warnings can be disabled for switches you don't use on a given model</li>
|
||||
<li>Compensation for offset error of FrSky FAS-xx current sensors (option on m64)</li>
|
||||
<li>Companion merged into OpenTX</li>
|
||||
<li>Companion major code / graphics refactoring</li>
|
||||
<li>Sticky Logical Switches</li>
|
||||
<li>ASpd, dTE, Cel-, Vfas- added to Telemetry values</li>
|
||||
<li>Workaround for newer bogus FlySky modules that send out servo centers on powerup (9x only)</li>
|
||||
<li>Finnish language support</li>
|
||||
</ul>
|
||||
|
||||
<h2>2940 / 2014-02-02</h2>
|
||||
[ARM Boards]
|
||||
<ul>
|
||||
<li>Wav files played even in silent mode
|
||||
<li>GPS support had broken VFAS
|
||||
<li>Wav files played even in silent mode</li>
|
||||
<li>GPS support had broken VFAS</li>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>Custom function triggered by a CSW based on analog triggering erroneously at powerup
|
||||
<li>Problem with mixer weight field when !GVARS
|
||||
<li>PPM5 was broken
|
||||
<li>Custom function triggered by a CSW based on analog triggering erroneously at powerup</li>
|
||||
<li>Problem with mixer weight field when !GVARS</li>
|
||||
<li>PPM5 was broken</li>
|
||||
</ul>
|
||||
|
||||
<h2>2923 / 2014-01-08</h2>
|
||||
[ARM Boards]
|
||||
<ul>
|
||||
<li>Audio freeze bug fixed
|
||||
<li>Aurora gimbals support
|
||||
<li>Audio freeze bug fixed</li>
|
||||
<li>Aurora gimbals support</li>
|
||||
</ul>
|
||||
|
||||
<h2>2834 / 2013-10-29</h2>
|
||||
[ARM Boards]
|
||||
<ul>
|
||||
<li>Altitude played without decimal when >= 10m
|
||||
<li>Check to avoid too long paths when playing SD files
|
||||
<li>Altitude played without decimal when >= 10m</li>
|
||||
<li>Check to avoid too long paths when playing SD files</li>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>Mixer bug when a MULTIPLY mix used with a slow
|
||||
<li>GVAR popup removed
|
||||
<li>Sticky virtual switches are reset when ResetFlight function is called
|
||||
<li>Mixer bug when a MULTIPLY mix used with a slow</li>
|
||||
<li>GVAR popup removed</li>
|
||||
<li>Sticky virtual switches are reset when ResetFlight function is called </li>
|
||||
</ul>
|
||||
|
||||
<h2>2768 / 2013-09-20</h2>
|
||||
@@ -298,26 +325,26 @@
|
||||
<ul>
|
||||
<li>Flash savings</li>
|
||||
<li>Vario sink tones removed</li>
|
||||
<li>Audio files renumbered (see here) </li>
|
||||
<li>Audio files renumbered (see here)</li>
|
||||
</ul>
|
||||
|
||||
[Sky9x]
|
||||
<ul>
|
||||
<li>Audio mixer: several sounds can now be played simulataneously, and beeps won't interrupt and clear voice alerts anymore. Note that sound files now need to have sampling rates of either 8, 16 or 32kHz and may need to be replaced. </li>
|
||||
<li>Audio mixer: several sounds can now be played simulataneously, and beeps won't interrupt and clear voice alerts anymore. Note that sound files now need to have sampling rates of either 8, 16 or 32kHz and may need to be replaced</li>
|
||||
</ul>
|
||||
|
||||
<h2>2413 / 2013-05-22</h2>
|
||||
[All]
|
||||
<ul>
|
||||
<li>Calibration screen automatically appears following an EEPROM format</li>
|
||||
<li>Wraparound in popup menus </li>
|
||||
<li>Wraparound in popup menus</li>
|
||||
</ul>
|
||||
|
||||
[9X Stock]
|
||||
<ul>
|
||||
<li>More options supported (novario / nogps / nogauges)</li>
|
||||
<li>Flash savings</li>
|
||||
<li>Mavlink huge rework by Rienk! </li>
|
||||
<li>Mavlink huge rework by Rienk!</li>
|
||||
</ul>
|
||||
|
||||
[Sky9x]
|
||||
@@ -329,17 +356,17 @@
|
||||
<h2>2215 / 2013-04-05</h2>
|
||||
[All]
|
||||
<ul>
|
||||
<li>New option AUTOSOURCE to automatically select the stick / pot / switch which is moved when editing a Mix source </li>
|
||||
<li>New option AUTOSOURCE to automatically select the stick / pot / switch which is moved when editing a Mix source</li>
|
||||
</ul>
|
||||
|
||||
[9X Stock]
|
||||
<ul>
|
||||
<li>All prompts renumbered to have the "custom" prompts starting at 0 and to be able to use PlayTrack?(GVAR) with Adjust(GVAR) to play tracks sequences </li>
|
||||
<li>All prompts renumbered to have the "custom" prompts starting at 0 and to be able to use PlayTrack?(GVAR) with Adjust(GVAR) to play tracks sequences</li>
|
||||
</ul>
|
||||
|
||||
[Gruvin9x]
|
||||
<ul>
|
||||
<li>Possibility to have both BEEPER and SPEAKER enable in the same time </li>
|
||||
<li>Possibility to have both BEEPER and SPEAKER enable in the same time</li>
|
||||
</ul>
|
||||
|
||||
[Sky9x]
|
||||
@@ -349,5 +376,5 @@
|
||||
<li>Possibility to have both BEEPER and SPEAKER enable in the same time</li>
|
||||
<li>New menu in Main Views / Telemetry Views</li>
|
||||
<li>Vario sounds improved!</li>
|
||||
<li>SD Folders renamed. "9XSOUNDS" becomes "SOUNDS", don't forget to updateyour cards!</li>
|
||||
<li>SD Folders renamed. "9XSOUNDS" becomes "SOUNDS", don't forget to update your SD card!</li>
|
||||
</ul>
|
||||
+18
-19
@@ -69,7 +69,7 @@ FAI = NO
|
||||
|
||||
# the latests deliveries for Turnigy 9x transmitters (since 2 years now, 2014) do not stop sending if no pulses are generated.
|
||||
# This fact totally breaks the nice throttle and switch warning concept, because even we prevent sending pulses the
|
||||
# transmitter modul ignores this, and continous to send the last value or 0 at beginning. And 0 means in the middle of throttle -> 50%.
|
||||
# transmitter module ignores this, and continues to send the last value or 0 at beginning. And 0 means in the middle of throttle -> 50%.
|
||||
# To cope with this situation, we need a new concept how to handle throttle and switch warnings.
|
||||
# if you have a 0 value (50% ) for throttle, while throttle warning is active, you should activate this switch
|
||||
# Values = YES, NO
|
||||
@@ -126,7 +126,7 @@ CORRECT_NEGATIVE_VALUES = YES
|
||||
ARITHMETIC_OVERFLOW_CHECK = NO
|
||||
|
||||
# increases resolution for throttle statistics and throttle counting, in very rare cases.
|
||||
# this will be only true if an output channel is used for throttle calculation, and this chanenel has changed limits, e.g. -90% to +80%
|
||||
# this will be only true if an output channel is used for throttle calculation, and this channel has changed limits, e.g. -90% to +80%
|
||||
# if you use standard limits for throttle or directly the throttle stick you do not need to bother about this option
|
||||
# not valid for ARM based transmitters like Taranis, They do not have this rounding issue at all
|
||||
# Values = YES, NO
|
||||
@@ -161,7 +161,7 @@ FONT = STD
|
||||
# Values = YES, NO
|
||||
PPM_CENTER_ADJUSTABLE = NO
|
||||
|
||||
# PPM symetrical limits
|
||||
# PPM symmetrical limits
|
||||
# Values = YES, NO
|
||||
PPM_LIMITS_SYMETRICAL = NO
|
||||
|
||||
@@ -247,7 +247,7 @@ EEPROM_PROGRESS_BAR = NO
|
||||
|
||||
# Activates the DEBUG Mode (all boards)
|
||||
# On G9X V4 board, when VOICE=NO:
|
||||
# PORTH:7 --> Transistion LOW to HIGH = start of setupPulses(). Transistion HIGH to LOW = end of setupPulses().
|
||||
# PORTH:7 --> Transition LOW to HIGH = start of setupPulses(). Transition HIGH to LOW = end of setupPulses().
|
||||
# PORTH:6 --> LOW->HIGH = start of mixer calcs. HIGH->LOW, end of mixer calcs.
|
||||
# Values = YES, NO
|
||||
DEBUG = NO
|
||||
@@ -282,16 +282,16 @@ MENUS_LOCK = NO
|
||||
# MASSSTORAGE: The TX will appear as a drive
|
||||
USB = JOYSTICK
|
||||
|
||||
# Channel monitor display behaviour
|
||||
# Channel monitor display behavior
|
||||
# Values = NO, YES
|
||||
# YES - hide the fact that channel is inverted in limits tab
|
||||
# and show inverted channel value with oposite sign
|
||||
# NO - normal behaviour, show real channel values
|
||||
# and show inverted channel value with opposite sign
|
||||
# NO - normal behavior, show real channel values
|
||||
CHANNELS_MONITOR_INV_HIDE = NO
|
||||
|
||||
# Use newlib-nano
|
||||
# Values = NO, YES
|
||||
NANO = YES
|
||||
NANO = NO
|
||||
|
||||
#------- END BUILD OPTIONS ---------------------------
|
||||
|
||||
@@ -300,7 +300,7 @@ SHELL = sh
|
||||
IMG2LBM = -python ../util/img2lbm.py
|
||||
BIN2LBM = -python ../util/bin2lbm.py
|
||||
TRANSLATE = -python ../util/translate.py
|
||||
VERSION = 2.0.10
|
||||
VERSION = 2.0.12
|
||||
|
||||
SRC =
|
||||
CPPSRC =
|
||||
@@ -736,9 +736,8 @@ ifeq ($(PCB), TARANIS)
|
||||
INCDIRS += lua/src
|
||||
CPPSRC += lua.cpp
|
||||
LUASRC = lua/src/lapi.c lua/src/lcode.c lua/src/lctype.c lua/src/ldebug.c lua/src/ldo.c lua/src/ldump.c lua/src/lfunc.c lua/src/lgc.c lua/src/llex.c lua/src/lmem.c \
|
||||
lua/src/lobject.c lua/src/lopcodes.c lua/src/lparser.c lua/src/lstate.c lua/src/lstring.c lua/src/ltable.c lua/src/ltm.c lua/src/lundump.c lua/src/lvm.c lua/src/lzio.c \
|
||||
lua/src/lbaselib.c lua/src/linit.c lua/src/lmathlib.c lua/src/loadlib.c lua/src/lauxlib.c lua/src/ltablib.c lua/src/lcorolib.c
|
||||
# lua/src/loslib.c lua/src/lbitlib.c lua/src/lstrlib.c lua/src/liolib.c lua/src/ldblib.c
|
||||
lua/src/lobject.c lua/src/lopcodes.c lua/src/lparser.c lua/src/lstate.c lua/src/lstring.c lua/src/ltable.c lua/src/lrotable.c lua/src/ltm.c lua/src/lundump.c lua/src/lvm.c lua/src/lzio.c \
|
||||
lua/src/lbaselib.c lua/src/linit.c lua/src/lmathlib.c lua/src/lbitlib.c lua/src/loadlib.c lua/src/lauxlib.c lua/src/ltablib.c lua/src/lcorolib.c
|
||||
SRC += $(LUASRC)
|
||||
LUADEP = lua_exports.cpp
|
||||
endif
|
||||
@@ -1350,7 +1349,7 @@ else
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O ihex opentx.elf opentx.hex
|
||||
$(OBJCOPY) -O ihex opentx.elf opentx.hex
|
||||
endif
|
||||
|
||||
%.bin: %.elf
|
||||
@@ -1440,12 +1439,12 @@ AVRCOMMAND = $(AVRDUDE) $(AVRDEVICE)
|
||||
|
||||
WRITE_COMMAND = $(AVRCOMMAND) -U flash:w:opentx.hex:i
|
||||
ifeq ($(RESTORE_EEPROM), YES)
|
||||
BACKUP_EEPROM = YES
|
||||
ifeq ($(DOUBLE_WRITE_OK), YES)
|
||||
WRITE_COMMAND += -U eeprom:w:$(DATA_DIR)/eeprom-$(DATE).hex:i
|
||||
else
|
||||
SECOND_WRITE_COMMAND = -U eeprom:w:$(DATA_DIR)/eeprom-$(DATE).hex:i
|
||||
endif
|
||||
BACKUP_EEPROM = YES
|
||||
ifeq ($(DOUBLE_WRITE_OK), YES)
|
||||
WRITE_COMMAND += -U eeprom:w:$(DATA_DIR)/eeprom-$(DATE).hex:i
|
||||
else
|
||||
SECOND_WRITE_COMMAND = -U eeprom:w:$(DATA_DIR)/eeprom-$(DATE).hex:i
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BACKUP_FLASH), YES)
|
||||
|
||||
+12
-2
@@ -737,7 +737,7 @@ void AudioQueue::wakeup()
|
||||
else {
|
||||
CoEnterMutexSection(audioMutex);
|
||||
if (ridx != widx) {
|
||||
normalContext.fragment = fragments[ridx];
|
||||
normalContext.tone.setFragment(fragments[ridx]);
|
||||
if (!fragments[ridx].repeat--) {
|
||||
ridx = (ridx + 1) % AUDIO_QUEUE_LENGTH;
|
||||
}
|
||||
@@ -804,8 +804,9 @@ void AudioQueue::playTone(uint16_t freq, uint16_t len, uint16_t pause, uint8_t f
|
||||
{
|
||||
CoEnterMutexSection(audioMutex);
|
||||
|
||||
if (freq && freq < BEEP_MIN_FREQ)
|
||||
if (freq && freq < BEEP_MIN_FREQ) {
|
||||
freq = BEEP_MIN_FREQ;
|
||||
}
|
||||
|
||||
if (flags & PLAY_BACKGROUND) {
|
||||
AudioFragment & fragment = varioContext.fragment;
|
||||
@@ -928,6 +929,15 @@ void AudioQueue::stopAll()
|
||||
CoLeaveMutexSection(audioMutex);
|
||||
}
|
||||
|
||||
void AudioQueue::flush()
|
||||
{
|
||||
CoEnterMutexSection(audioMutex);
|
||||
widx = ridx; // clean the queue
|
||||
varioContext.clear();
|
||||
backgroundContext.clear();
|
||||
CoLeaveMutexSection(audioMutex);
|
||||
}
|
||||
|
||||
void audioEvent(uint8_t e, uint16_t f)
|
||||
{
|
||||
#if defined(HAPTIC)
|
||||
|
||||
@@ -103,6 +103,12 @@ class ToneContext {
|
||||
uint16_t pause;
|
||||
} state;
|
||||
|
||||
inline void setFragment(AudioFragment & fragment)
|
||||
{
|
||||
this->fragment = fragment;
|
||||
memset(&state, 0, sizeof(state));
|
||||
}
|
||||
|
||||
inline void clear()
|
||||
{
|
||||
memset(this, 0, sizeof(ToneContext));
|
||||
@@ -163,6 +169,8 @@ class AudioQueue {
|
||||
|
||||
void stopAll();
|
||||
|
||||
void flush();
|
||||
|
||||
void pause(uint16_t tLen);
|
||||
|
||||
void stopSD();
|
||||
@@ -328,6 +336,7 @@ void pushPrompt(uint16_t prompt, uint8_t id=0);
|
||||
#define PLAY_FILE(f, flags, id) audioQueue.playFile((f), (flags), (id))
|
||||
#define STOP_PLAY(id) audioQueue.stopPlay((id))
|
||||
#define AUDIO_RESET() audioQueue.stopAll()
|
||||
#define AUDIO_FLUSH() audioQueue.flush()
|
||||
|
||||
#if defined(SDCARD)
|
||||
extern tmr10ms_t timeAutomaticPromptsSilence;
|
||||
|
||||
@@ -154,6 +154,7 @@ void audioDefevent(uint8_t e);
|
||||
#define AUDIO_HEARTBEAT() audio.heartbeat()
|
||||
#define IS_AUDIO_BUSY() audio.busy()
|
||||
#define AUDIO_RESET()
|
||||
#define AUDIO_FLUSH()
|
||||
|
||||
#define PLAY_PHASE_OFF(phase)
|
||||
#define PLAY_PHASE_ON(phase)
|
||||
|
||||
@@ -99,6 +99,7 @@ void beep(uint8_t val);
|
||||
|
||||
#define IS_AUDIO_BUSY() (g_beepCnt || beepAgain || beepOn)
|
||||
#define AUDIO_RESET()
|
||||
#define AUDIO_FLUSH()
|
||||
|
||||
#define PLAY_PHASE_OFF(phase)
|
||||
#define PLAY_PHASE_ON(phase)
|
||||
|
||||
@@ -385,6 +385,7 @@ void eeLoadModel(uint8_t id)
|
||||
read32_eeprom_data((File_system[id+1].block_no << 12) + sizeof(struct t_eeprom_header), (uint8_t *)&g_model, size) ;
|
||||
}
|
||||
|
||||
AUDIO_FLUSH();
|
||||
flightReset();
|
||||
logicalSwitchesReset();
|
||||
|
||||
|
||||
@@ -964,16 +964,22 @@ void eeLoadModel(uint8_t id)
|
||||
}
|
||||
#endif
|
||||
|
||||
bool newModel = false;
|
||||
|
||||
if (sz < 256) {
|
||||
modelDefault(id);
|
||||
eeCheck(true);
|
||||
newModel = true;
|
||||
}
|
||||
|
||||
AUDIO_FLUSH();
|
||||
flightReset();
|
||||
logicalSwitchesReset();
|
||||
|
||||
if (pulsesStarted()) {
|
||||
checkAll();
|
||||
if (!newModel) {
|
||||
checkAll();
|
||||
}
|
||||
resumePulses();
|
||||
}
|
||||
|
||||
|
||||
@@ -1325,8 +1325,8 @@ void menuModelSetup(uint8_t event)
|
||||
uint8_t x = MODEL_SETUP_2ND_COLUMN+5*FW;
|
||||
for (uint8_t i=0; i<NUM_POTS ; i++) {
|
||||
#if !defined(REVPLUS)
|
||||
if (attr && i == POT3-POT1) {
|
||||
if (m_posHorz==i+1) REPEAT_LAST_CURSOR_MOVE();
|
||||
if (i == POT3-POT1) {
|
||||
if (attr && (m_posHorz==i+1)) REPEAT_LAST_CURSOR_MOVE();
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
@@ -1353,7 +1353,7 @@ void menuModelSetup(uint8_t event)
|
||||
uint8_t x = MODEL_SETUP_2ND_COLUMN+i*FW;
|
||||
#if defined(PCBTARANIS) && !defined(REVPLUS)
|
||||
if (i == POT3) {
|
||||
if (m_posHorz == POT3) REPEAT_LAST_CURSOR_MOVE();
|
||||
if (attr && m_posHorz == POT3) REPEAT_LAST_CURSOR_MOVE();
|
||||
continue;
|
||||
}
|
||||
else if (i > POT3) {
|
||||
@@ -1621,7 +1621,7 @@ void menuModelSetup(uint8_t event)
|
||||
if (IS_PPM_PROTOCOL(protocol)) {
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+7*FW, y, STR_NCHANNELS, g_model.ppmNCH+2, m_posHorz!=0 ? attr : 0);
|
||||
}
|
||||
else if (attr) {
|
||||
else if (m_posHorz>0 && attr) {
|
||||
MOVE_CURSOR_FROM_HERE();
|
||||
}
|
||||
if (attr && (editMode>0 || p1valdiff || (!IS_PPM_PROTOCOL(protocol) && !IS_DSM2_PROTOCOL(protocol)))) {
|
||||
@@ -4491,7 +4491,7 @@ void menuModelLogicalSwitchOne(uint8_t event)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
v2_min = -125; v2_max = 125;
|
||||
v2_min = -LIMIT_EXT_PERCENT; v2_max = +LIMIT_EXT_PERCENT;
|
||||
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, cs->v2, LEFT|attr);
|
||||
}
|
||||
}
|
||||
@@ -4788,7 +4788,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
v2_min = -125; v2_max = +125;
|
||||
v2_min = -LIMIT_EXT_PERCENT; v2_max = +LIMIT_EXT_PERCENT;
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -4798,7 +4798,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||
}
|
||||
else {
|
||||
lcd_outdezAtt(CSW_3RD_COLUMN, y, cs->v2, LEFT|attr2);
|
||||
v2_min = -125; v2_max = 125;
|
||||
v2_min = -LIMIT_EXT_PERCENT; v2_max = +LIMIT_EXT_PERCENT;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -5119,8 +5119,10 @@ void menuModelCustomFunctions(uint8_t event)
|
||||
}
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
else if (func == FUNC_OVERRIDE_CHANNEL) {
|
||||
#if !defined(CPUARM)
|
||||
val_displayed = (int8_t)CFN_PARAM(sd);
|
||||
val_min = -125; val_max = 125;
|
||||
#endif
|
||||
val_min = -LIMIT_EXT_PERCENT; val_max = +LIMIT_EXT_PERCENT;
|
||||
lcd_outdezAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -164,7 +164,7 @@ void displayTrims(uint8_t phase)
|
||||
uint8_t att = ROUND;
|
||||
int16_t val = getTrimValue(phase, i);
|
||||
|
||||
if (val < -125 || val > 125)
|
||||
if (val < TRIM_MIN || val > TRIM_MAX)
|
||||
att = BLINK|INVERS|ROUND;
|
||||
|
||||
if (val < -(TRIM_LEN+1)*4)
|
||||
|
||||
@@ -215,13 +215,14 @@ void menuStatisticsDebug(uint8_t event)
|
||||
lcd_puts(lcdLastPos, MENU_DEBUG_Y_MIXMAX, "ms");
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if 0
|
||||
lcd_putsLeft(MENU_DEBUG_Y_STACK, STR_FREESTACKMINB);
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_STACK, stack_free(255), UNSIGN|LEFT);
|
||||
lcd_puts(lcdLastPos, MENU_DEBUG_Y_STACK, "b");
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
lcd_putsLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[Main]", SMLSIZE);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stack_free(0), UNSIGN|LEFT);
|
||||
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[Mix]", SMLSIZE);
|
||||
|
||||
+191
-112
@@ -45,6 +45,7 @@ extern "C" {
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <lualib.h>
|
||||
#include <lrotable.h>
|
||||
#if !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
@@ -73,7 +74,6 @@ uint16_t maxLuaDuration = 0;
|
||||
|
||||
#define PERMANENT_SCRIPTS_MAX_INSTRUCTIONS (10000/100)
|
||||
#define MANUAL_SCRIPTS_MAX_INSTRUCTIONS (20000/100)
|
||||
#define SCRIPTS_MAX_HEAP 50
|
||||
#define SET_LUA_INSTRUCTIONS_COUNT(x) (instructionsPercent=0, lua_sethook(L, hook, LUA_MASKCOUNT, x))
|
||||
|
||||
struct our_longjmp * global_lj = 0;
|
||||
@@ -527,6 +527,7 @@ static int luaModelGetInfo(lua_State *L)
|
||||
{
|
||||
lua_newtable(L);
|
||||
lua_pushtablezstring(L, "name", g_model.header.name);
|
||||
lua_pushtablenzstring(L, "bitmap", g_model.header.bitmap);
|
||||
lua_pushtableinteger(L, "id", g_model.header.modelId);
|
||||
return 1;
|
||||
}
|
||||
@@ -542,6 +543,10 @@ static int luaModelSetInfo(lua_State *L)
|
||||
str2zchar(g_model.header.name, name, sizeof(g_model.header.name));
|
||||
memcpy(modelHeaders[g_eeGeneral.currModel].name, g_model.header.name, sizeof(g_model.header.name));
|
||||
}
|
||||
else if (!strcmp(key, "bitmap")) {
|
||||
const char * name = luaL_checkstring(L, -1);
|
||||
strncpy(g_model.header.bitmap, name, sizeof(g_model.header.bitmap));
|
||||
}
|
||||
else if (!strcmp(key, "id")) {
|
||||
g_model.header.modelId = luaL_checkinteger(L, -1);
|
||||
modelHeaders[g_eeGeneral.currModel].modelId = g_model.header.modelId;
|
||||
@@ -781,6 +786,8 @@ static int luaModelGetMix(lua_State *L)
|
||||
lua_pushtableinteger(L, "weight", mix->weight);
|
||||
lua_pushtableinteger(L, "offset", mix->offset);
|
||||
lua_pushtableinteger(L, "switch", mix->swtch);
|
||||
lua_pushtableinteger(L, "curveType", mix->curve.type);
|
||||
lua_pushtableinteger(L, "curveValue", mix->curve.value);
|
||||
lua_pushtableinteger(L, "multiplex", mix->mltpx);
|
||||
}
|
||||
else {
|
||||
@@ -822,6 +829,12 @@ static int luaModelInsertMix(lua_State *L)
|
||||
else if (!strcmp(key, "switch")) {
|
||||
mix->swtch = luaL_checkinteger(L, -1);
|
||||
}
|
||||
else if (!strcmp(key, "curveType")) {
|
||||
mix->curve.type = luaL_checkinteger(L, -1);
|
||||
}
|
||||
else if (!strcmp(key, "curveValue")) {
|
||||
mix->curve.value = luaL_checkinteger(L, -1);
|
||||
}
|
||||
else if (!strcmp(key, "multiplex")) {
|
||||
mix->mltpx = luaL_checkinteger(L, -1);
|
||||
}
|
||||
@@ -910,6 +923,48 @@ static int luaModelSetLogicalSwitch(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int luaModelGetCurve(lua_State *L)
|
||||
{
|
||||
int idx = luaL_checkunsigned(L, 1);
|
||||
if (idx < MAX_CURVES) {
|
||||
CurveInfo & curveInfo = g_model.curves[idx];
|
||||
lua_newtable(L);
|
||||
lua_pushtablezstring(L, "name", g_model.curveNames[idx]);
|
||||
lua_pushtableinteger(L, "type", curveInfo.type);
|
||||
lua_pushtableboolean(L, "smooth", curveInfo.smooth);
|
||||
lua_pushtableinteger(L, "points", curveInfo.points+5);
|
||||
lua_pushstring(L, "y");
|
||||
lua_newtable(L);
|
||||
int8_t * point = curveAddress(idx);
|
||||
for (int i=0; i<curveInfo.points+5; i++) {
|
||||
lua_pushinteger(L, i);
|
||||
lua_pushinteger(L, *point++);
|
||||
lua_settable(L, -3);
|
||||
}
|
||||
lua_settable(L, -3);
|
||||
if (curveInfo.type == CURVE_TYPE_CUSTOM) {
|
||||
lua_pushstring(L, "x");
|
||||
lua_newtable(L);
|
||||
lua_pushinteger(L, 0);
|
||||
lua_pushinteger(L, 0);
|
||||
lua_settable(L, -3);
|
||||
for (int i=0; i<curveInfo.points+3; i++) {
|
||||
lua_pushinteger(L, i+1);
|
||||
lua_pushinteger(L, *point++);
|
||||
lua_settable(L, -3);
|
||||
}
|
||||
lua_pushinteger(L, curveInfo.points+4);
|
||||
lua_pushinteger(L, 100);
|
||||
lua_settable(L, -3);
|
||||
lua_settable(L, -3);
|
||||
}
|
||||
}
|
||||
else {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int luaModelGetCustomFunction(lua_State *L)
|
||||
{
|
||||
int idx = luaL_checkunsigned(L, 1);
|
||||
@@ -1293,7 +1348,77 @@ int luaGetOutputs(ScriptInputsOutputs & sid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const luaL_Reg modelLib[] = {
|
||||
const luaL_Reg opentxLib[] = {
|
||||
{ "getTime", luaGetTime },
|
||||
{ "getVersion", luaGetVersion },
|
||||
{ "getGeneralSettings", luaGetGeneralSettings },
|
||||
{ "getValue", luaGetValue },
|
||||
{ "getFieldInfo", luaGetFieldInfo },
|
||||
{ "playFile", luaPlayFile },
|
||||
{ "playNumber", luaPlayNumber },
|
||||
// { "playDuration", luaPlayDuration },
|
||||
// { "playTone", luaPlayTone },
|
||||
{ "popupInput", luaPopupInput },
|
||||
{ "defaultStick", luaDefaultStick },
|
||||
{ "defaultChannel", luaDefaultChannel },
|
||||
{ "killEvents", luaKillEvents },
|
||||
{ NULL, NULL } /* sentinel */
|
||||
};
|
||||
|
||||
const luaR_value_entry opentxConstants[] = {
|
||||
{ "FULLSCALE", RESX },
|
||||
{ "XXLSIZE", XXLSIZE },
|
||||
{ "DBLSIZE", DBLSIZE },
|
||||
{ "MIDSIZE", MIDSIZE },
|
||||
{ "SMLSIZE", SMLSIZE },
|
||||
{ "INVERS", INVERS },
|
||||
{ "LEFT", LEFT },
|
||||
{ "PREC1", PREC1 },
|
||||
{ "PREC2", PREC2 },
|
||||
{ "BLINK", BLINK },
|
||||
{ "VALUE", 0 },
|
||||
{ "SOURCE", 1 },
|
||||
{ "REPLACE", MLTPX_REP },
|
||||
{ "MIXSRC_FIRST_INPUT", MIXSRC_FIRST_INPUT },
|
||||
{ "MIXSRC_Rud", MIXSRC_Rud },
|
||||
{ "MIXSRC_Ele", MIXSRC_Ele },
|
||||
{ "MIXSRC_Thr", MIXSRC_Thr },
|
||||
{ "MIXSRC_Ail", MIXSRC_Ail },
|
||||
{ "MIXSRC_SA", MIXSRC_SA },
|
||||
{ "MIXSRC_SB", MIXSRC_SB },
|
||||
{ "MIXSRC_SC", MIXSRC_SC },
|
||||
{ "MIXSRC_SD", MIXSRC_SD },
|
||||
{ "MIXSRC_SE", MIXSRC_SE },
|
||||
{ "MIXSRC_SF", MIXSRC_SF },
|
||||
{ "MIXSRC_SG", MIXSRC_SG },
|
||||
{ "MIXSRC_SH", MIXSRC_SH },
|
||||
{ "MIXSRC_CH1", MIXSRC_CH1 },
|
||||
{ "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH },
|
||||
{ "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU) },
|
||||
{ "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE) },
|
||||
{ "EVT_PAGE_LONG", EVT_KEY_LONG(KEY_PAGE) },
|
||||
{ "EVT_ENTER_BREAK", EVT_KEY_BREAK(KEY_ENTER) },
|
||||
{ "EVT_ENTER_LONG", EVT_KEY_LONG(KEY_ENTER) },
|
||||
{ "EVT_EXIT_BREAK", EVT_KEY_BREAK(KEY_EXIT) },
|
||||
{ "EVT_PLUS_BREAK", EVT_KEY_BREAK(KEY_PLUS) },
|
||||
{ "EVT_MINUS_BREAK", EVT_KEY_BREAK(KEY_MINUS) },
|
||||
{ "EVT_PLUS_FIRST", EVT_KEY_FIRST(KEY_PLUS) },
|
||||
{ "EVT_MINUS_FIRST", EVT_KEY_FIRST(KEY_MINUS) },
|
||||
{ "EVT_PLUS_REPT", EVT_KEY_REPT(KEY_PLUS) },
|
||||
{ "EVT_MINUS_REPT", EVT_KEY_REPT(KEY_MINUS) },
|
||||
{ "FILL_WHITE", FILL_WHITE },
|
||||
{ "GREY_DEFAULT", GREY_DEFAULT },
|
||||
{ "SOLID", SOLID },
|
||||
{ "DOTTED", DOTTED },
|
||||
{ "LCD_W", LCD_W },
|
||||
{ "LCD_H", LCD_H },
|
||||
{ "PLAY_NOW", PLAY_NOW },
|
||||
{ "PLAY_BACKGROUND", PLAY_BACKGROUND },
|
||||
{ "TIMEHOUR", TIMEHOUR },
|
||||
{ NULL, 0 } /* sentinel */
|
||||
};
|
||||
|
||||
const luaL_Reg modelLib[] = {
|
||||
{ "getInfo", luaModelGetInfo },
|
||||
{ "setInfo", luaModelSetInfo },
|
||||
{ "getTimer", luaModelGetTimer },
|
||||
@@ -1313,6 +1438,7 @@ static const luaL_Reg modelLib[] = {
|
||||
{ "setLogicalSwitch", luaModelSetLogicalSwitch },
|
||||
{ "getCustomFunction", luaModelGetCustomFunction },
|
||||
{ "setCustomFunction", luaModelSetCustomFunction },
|
||||
{ "getCurve", luaModelGetCurve },
|
||||
{ "getOutput", luaModelGetOutput },
|
||||
{ "setOutput", luaModelSetOutput },
|
||||
{ "getGlobalVariable", luaModelGetGlobalVariable },
|
||||
@@ -1322,7 +1448,7 @@ static const luaL_Reg modelLib[] = {
|
||||
{ NULL, NULL } /* sentinel */
|
||||
};
|
||||
|
||||
static const luaL_Reg lcdLib[] = {
|
||||
const luaL_Reg lcdLib[] = {
|
||||
{ "lock", luaLcdLock },
|
||||
{ "clear", luaLcdClear },
|
||||
{ "getLastPos", luaLcdGetLastPos },
|
||||
@@ -1368,73 +1494,6 @@ void luaRegisterAll()
|
||||
{
|
||||
// Init lua
|
||||
luaL_openlibs(L);
|
||||
|
||||
// Push OpenTX libs
|
||||
lua_registerlib(L, "model", modelLib);
|
||||
lua_registerlib(L, "lcd", lcdLib);
|
||||
|
||||
// Push OpenTX functions
|
||||
lua_register(L, "getTime", luaGetTime);
|
||||
lua_register(L, "getVersion", luaGetVersion);
|
||||
lua_register(L, "getGeneralSettings", luaGetGeneralSettings);
|
||||
lua_register(L, "getValue", luaGetValue);
|
||||
lua_register(L, "getFieldInfo", luaGetFieldInfo);
|
||||
|
||||
lua_register(L, "playFile", luaPlayFile);
|
||||
lua_register(L, "playNumber", luaPlayNumber);
|
||||
lua_register(L, "popupInput", luaPopupInput);
|
||||
lua_register(L, "defaultStick", luaDefaultStick);
|
||||
lua_register(L, "defaultChannel", luaDefaultChannel);
|
||||
lua_register(L, "killEvents", luaKillEvents);
|
||||
|
||||
// Push OpenTX constants
|
||||
lua_registerint(L, "FULLSCALE", RESX);
|
||||
lua_registerint(L, "XXLSIZE", XXLSIZE);
|
||||
lua_registerint(L, "DBLSIZE", DBLSIZE);
|
||||
lua_registerint(L, "MIDSIZE", MIDSIZE);
|
||||
lua_registerint(L, "SMLSIZE", SMLSIZE);
|
||||
lua_registerint(L, "INVERS", INVERS);
|
||||
lua_registerint(L, "LEFT", LEFT);
|
||||
lua_registerint(L, "PREC1", PREC1);
|
||||
lua_registerint(L, "PREC2", PREC2);
|
||||
lua_registerint(L, "BLINK", BLINK);
|
||||
lua_registerint(L, "VALUE", 0);
|
||||
lua_registerint(L, "SOURCE", 1);
|
||||
lua_registerint(L, "REPLACE", MLTPX_REP);
|
||||
lua_registerint(L, "MIXSRC_FIRST_INPUT", MIXSRC_FIRST_INPUT);
|
||||
lua_registerint(L, "MIXSRC_Rud", MIXSRC_Rud);
|
||||
lua_registerint(L, "MIXSRC_Ele", MIXSRC_Ele);
|
||||
lua_registerint(L, "MIXSRC_Thr", MIXSRC_Thr);
|
||||
lua_registerint(L, "MIXSRC_Ail", MIXSRC_Ail);
|
||||
lua_registerint(L, "MIXSRC_SA", MIXSRC_SA);
|
||||
lua_registerint(L, "MIXSRC_SB", MIXSRC_SB);
|
||||
lua_registerint(L, "MIXSRC_SC", MIXSRC_SC);
|
||||
lua_registerint(L, "MIXSRC_SD", MIXSRC_SD);
|
||||
lua_registerint(L, "MIXSRC_SE", MIXSRC_SE);
|
||||
lua_registerint(L, "MIXSRC_SF", MIXSRC_SF);
|
||||
lua_registerint(L, "MIXSRC_SG", MIXSRC_SG);
|
||||
lua_registerint(L, "MIXSRC_SH", MIXSRC_SH);
|
||||
lua_registerint(L, "MIXSRC_CH1", MIXSRC_CH1);
|
||||
lua_registerint(L, "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH);
|
||||
lua_registerint(L, "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU));
|
||||
lua_registerint(L, "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE));
|
||||
lua_registerint(L, "EVT_PAGE_LONG", EVT_KEY_LONG(KEY_PAGE));
|
||||
lua_registerint(L, "EVT_ENTER_BREAK", EVT_KEY_BREAK(KEY_ENTER));
|
||||
lua_registerint(L, "EVT_ENTER_LONG", EVT_KEY_LONG(KEY_ENTER));
|
||||
lua_registerint(L, "EVT_EXIT_BREAK", EVT_KEY_BREAK(KEY_EXIT));
|
||||
lua_registerint(L, "EVT_PLUS_BREAK", EVT_KEY_BREAK(KEY_PLUS));
|
||||
lua_registerint(L, "EVT_MINUS_BREAK", EVT_KEY_BREAK(KEY_MINUS));
|
||||
lua_registerint(L, "EVT_PLUS_FIRST", EVT_KEY_FIRST(KEY_PLUS));
|
||||
lua_registerint(L, "EVT_MINUS_FIRST", EVT_KEY_FIRST(KEY_MINUS));
|
||||
lua_registerint(L, "EVT_PLUS_REPT", EVT_KEY_REPT(KEY_PLUS));
|
||||
lua_registerint(L, "EVT_MINUS_REPT", EVT_KEY_REPT(KEY_MINUS));
|
||||
lua_registerint(L, "FILL_WHITE", FILL_WHITE);
|
||||
lua_registerint(L, "GREY_DEFAULT", GREY_DEFAULT);
|
||||
lua_registerint(L, "SOLID", SOLID);
|
||||
lua_registerint(L, "DOTTED", DOTTED);
|
||||
lua_registerint(L, "LCD_W", LCD_W);
|
||||
lua_registerint(L, "LCD_H", LCD_H);
|
||||
lua_registerint(L, "TIMEHOUR", TIMEHOUR);
|
||||
}
|
||||
|
||||
void luaInit()
|
||||
@@ -1490,7 +1549,14 @@ int luaLoad(const char *filename, ScriptInternalData & sid, ScriptInputsOutputs
|
||||
sid.instructions = 0;
|
||||
sid.state = SCRIPT_OK;
|
||||
|
||||
#if 0
|
||||
// not needed, we just called luaInit
|
||||
luaFree(sid);
|
||||
#endif
|
||||
|
||||
if (luaState == INTERPRETER_PANIC) {
|
||||
return SCRIPT_PANIC;
|
||||
}
|
||||
|
||||
SET_LUA_INSTRUCTIONS_COUNT(MANUAL_SCRIPTS_MAX_INSTRUCTIONS);
|
||||
|
||||
@@ -1539,8 +1605,8 @@ int luaLoad(const char *filename, ScriptInternalData & sid, ScriptInputsOutputs
|
||||
}
|
||||
}
|
||||
else {
|
||||
TRACE("Panic in script %s: %s", filename, lua_tostring(L, -1));
|
||||
sid.state = SCRIPT_PANIC;
|
||||
luaDisable();
|
||||
return SCRIPT_PANIC;
|
||||
}
|
||||
UNPROTECT_LUA();
|
||||
|
||||
@@ -1551,7 +1617,7 @@ int luaLoad(const char *filename, ScriptInternalData & sid, ScriptInputsOutputs
|
||||
return sid.state;
|
||||
}
|
||||
|
||||
void luaLoadMixScript(uint8_t index)
|
||||
bool luaLoadMixScript(uint8_t index)
|
||||
{
|
||||
ScriptData & sd = g_model.scriptsData[index];
|
||||
|
||||
@@ -1564,8 +1630,11 @@ void luaLoadMixScript(uint8_t index)
|
||||
strncpy(filename+sizeof(SCRIPTS_MIXES_PATH), sd.file, sizeof(sd.file));
|
||||
filename[sizeof(SCRIPTS_MIXES_PATH)+sizeof(sd.file)] = '\0';
|
||||
strcat(filename+sizeof(SCRIPTS_MIXES_PATH), SCRIPTS_EXT);
|
||||
luaLoad(filename, sid, sio);
|
||||
if (luaLoad(filename, sid, sio) == SCRIPT_PANIC) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool luaLoadFunctionScript(uint8_t index)
|
||||
@@ -1581,13 +1650,15 @@ bool luaLoadFunctionScript(uint8_t index)
|
||||
strncpy(filename+sizeof(SCRIPTS_FUNCS_PATH), fn.play.name, sizeof(fn.play.name));
|
||||
filename[sizeof(SCRIPTS_FUNCS_PATH)+sizeof(fn.play.name)] = '\0';
|
||||
strcat(filename+sizeof(SCRIPTS_FUNCS_PATH), SCRIPTS_EXT);
|
||||
luaLoad(filename, sid);
|
||||
if (luaLoad(filename, sid) == SCRIPT_PANIC) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1616,9 +1687,12 @@ bool luaLoadTelemetryScript(uint8_t index)
|
||||
ScriptInternalData & sid = scriptInternalData[luaScriptsCount++];
|
||||
sid.reference = SCRIPT_TELEMETRY_FIRST+index;
|
||||
sid.state = SCRIPT_NOFILE;
|
||||
luaLoad(path, sid);
|
||||
if (luaLoad(path, sid) == SCRIPT_PANIC) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1644,13 +1718,14 @@ void luaLoadPermanentScripts()
|
||||
|
||||
// Load model scripts
|
||||
for (int i=0; i<MAX_SCRIPTS; i++) {
|
||||
luaLoadMixScript(i);
|
||||
if (!luaLoadMixScript(i)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Load custom function scripts
|
||||
for (int i=0; i<NUM_CFN; i++) {
|
||||
if (!luaLoadFunctionScript(i)) {
|
||||
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1658,16 +1733,13 @@ void luaLoadPermanentScripts()
|
||||
// Load custom telemetry scripts
|
||||
for (int i=0; i<MAX_SCRIPTS; i++) {
|
||||
if (!luaLoadTelemetryScript(i)) {
|
||||
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!luaLoadTelemetryScript(TELEMETRY_VOLTAGES_SCREEN)) {
|
||||
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||
return;
|
||||
}
|
||||
if (!luaLoadTelemetryScript(TELEMETRY_AFTER_FLIGHT_SCREEN)) {
|
||||
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1715,16 +1787,17 @@ void luaError(uint8_t error)
|
||||
void luaExec(const char *filename)
|
||||
{
|
||||
luaInit();
|
||||
|
||||
standaloneScript.state = SCRIPT_NOFILE;
|
||||
int result = luaLoad(filename, standaloneScript);
|
||||
// TODO the same with run ...
|
||||
if (result == SCRIPT_OK) {
|
||||
luaState = INTERPRETER_RUNNING_STANDALONE_SCRIPT;
|
||||
}
|
||||
else {
|
||||
luaError(result);
|
||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||
if (luaState != INTERPRETER_PANIC) {
|
||||
standaloneScript.state = SCRIPT_NOFILE;
|
||||
int result = luaLoad(filename, standaloneScript);
|
||||
// TODO the same with run ...
|
||||
if (result == SCRIPT_OK) {
|
||||
luaState = INTERPRETER_RUNNING_STANDALONE_SCRIPT;
|
||||
}
|
||||
else {
|
||||
luaError(result);
|
||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1762,6 +1835,7 @@ void luaDoOneRunStandalone(uint8_t evt)
|
||||
TRACE("Script finished with status %d", scriptResult);
|
||||
standaloneScript.state = SCRIPT_NOFILE;
|
||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||
return;
|
||||
}
|
||||
else if (luaDisplayStatistics) {
|
||||
lcd_hline(0, 7*FH-1, lcdLastPos+FW, ERASE);
|
||||
@@ -1885,22 +1959,24 @@ void luaDoOneRunPermanentScript(uint8_t evt, int i)
|
||||
|
||||
void luaDoGc()
|
||||
{
|
||||
PROTECT_LUA() {
|
||||
lua_gc(L, LUA_GCSTEP /*LUA_GCCOLLECT*/, 0); // LUA_GCSTEP is enough
|
||||
if (L) {
|
||||
PROTECT_LUA() {
|
||||
lua_gc(L, LUA_GCCOLLECT, 0);
|
||||
#if defined(SIMU) || defined(DEBUG)
|
||||
static int lastgc = 0;
|
||||
int gc = luaGetMemUsed();
|
||||
if (gc != lastgc) {
|
||||
lastgc = gc;
|
||||
TRACE("GC Use: %dbytes", gc);
|
||||
}
|
||||
static int lastgc = 0;
|
||||
int gc = luaGetMemUsed();
|
||||
if (gc != lastgc) {
|
||||
lastgc = gc;
|
||||
TRACE("GC Use: %dbytes", gc);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
// we disable Lua for the rest of the session
|
||||
luaDisable();
|
||||
}
|
||||
UNPROTECT_LUA();
|
||||
}
|
||||
else {
|
||||
// we disable Lua for the rest of the session
|
||||
luaDisable();
|
||||
}
|
||||
UNPROTECT_LUA();
|
||||
}
|
||||
|
||||
void luaTask(uint8_t evt)
|
||||
@@ -1915,13 +1991,17 @@ void luaTask(uint8_t evt)
|
||||
maxLuaInterval = interval;
|
||||
}
|
||||
|
||||
if (luaState == INTERPRETER_PANIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (luaState & INTERPRETER_RUNNING_STANDALONE_SCRIPT) {
|
||||
PROTECT_LUA() {
|
||||
luaDoOneRunStandalone(evt);
|
||||
}
|
||||
else {
|
||||
POPUP_WARNING("Script Panic!");
|
||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||
luaDisable();
|
||||
return;
|
||||
}
|
||||
UNPROTECT_LUA();
|
||||
}
|
||||
@@ -1930,8 +2010,9 @@ void luaTask(uint8_t evt)
|
||||
if (luaState & INTERPRETER_RELOAD_PERMANENT_SCRIPTS) {
|
||||
luaState = 0;
|
||||
luaInit();
|
||||
if (!L) return;
|
||||
if (luaState == INTERPRETER_PANIC) return;
|
||||
luaLoadPermanentScripts();
|
||||
if (luaState == INTERPRETER_PANIC) return;
|
||||
}
|
||||
|
||||
for (int i=0; i<luaScriptsCount; i++) {
|
||||
@@ -1939,10 +2020,8 @@ void luaTask(uint8_t evt)
|
||||
luaDoOneRunPermanentScript(evt, i);
|
||||
}
|
||||
else {
|
||||
// we disable this script for the rest of the session
|
||||
ScriptInternalData & sid = scriptInternalData[i];
|
||||
sid.state = SCRIPT_PANIC;
|
||||
luaFree(sid);
|
||||
luaDisable();
|
||||
return;
|
||||
}
|
||||
UNPROTECT_LUA();
|
||||
}
|
||||
|
||||
+34
-12
@@ -23,6 +23,7 @@
|
||||
#include "lstate.h"
|
||||
#include "lstring.h"
|
||||
#include "ltable.h"
|
||||
#include "lrotable.h"
|
||||
#include "ltm.h"
|
||||
#include "lundump.h"
|
||||
#include "lvm.h"
|
||||
@@ -260,7 +261,7 @@ LUA_API const char *lua_typename (lua_State *L, int t) {
|
||||
|
||||
LUA_API int lua_iscfunction (lua_State *L, int idx) {
|
||||
StkId o = index2addr(L, idx);
|
||||
return (ttislcf(o) || (ttisCclosure(o)));
|
||||
return (ttislcf(o) || ttislightfunction(o) || (ttisCclosure(o)));
|
||||
}
|
||||
|
||||
|
||||
@@ -417,7 +418,7 @@ LUA_API size_t lua_rawlen (lua_State *L, int idx) {
|
||||
|
||||
LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {
|
||||
StkId o = index2addr(L, idx);
|
||||
if (ttislcf(o)) return fvalue(o);
|
||||
if (ttislcf(o)) return lcfvalue(o);
|
||||
else if (ttisCclosure(o))
|
||||
return clCvalue(o)->f;
|
||||
else return NULL; /* not a C function */
|
||||
@@ -446,11 +447,14 @@ LUA_API const void *lua_topointer (lua_State *L, int idx) {
|
||||
case LUA_TTABLE: return hvalue(o);
|
||||
case LUA_TLCL: return clLvalue(o);
|
||||
case LUA_TCCL: return clCvalue(o);
|
||||
case LUA_TLCF: return cast(void *, cast(size_t, fvalue(o)));
|
||||
case LUA_TLCF: return cast(void *, cast(size_t, lcfvalue(o)));
|
||||
case LUA_TTHREAD: return thvalue(o);
|
||||
case LUA_TUSERDATA:
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
return lua_touserdata(L, idx);
|
||||
case LUA_TROTABLE:
|
||||
case LUA_TLIGHTFUNCTION:
|
||||
return pvalue(o);
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
@@ -551,11 +555,10 @@ LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
|
||||
lua_lock(L);
|
||||
if (n == 0) {
|
||||
setfvalue(L->top, fn);
|
||||
setlcfvalue(L->top, fn);
|
||||
}
|
||||
else {
|
||||
Closure *cl;
|
||||
@@ -573,7 +576,6 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
|
||||
LUA_API void lua_pushboolean (lua_State *L, int b) {
|
||||
lua_lock(L);
|
||||
setbvalue(L->top, (b != 0)); /* ensure that true is 1 */
|
||||
@@ -589,6 +591,19 @@ LUA_API void lua_pushlightuserdata (lua_State *L, void *p) {
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
LUA_API void lua_pushrotable (lua_State *L, void *p) {
|
||||
lua_lock(L);
|
||||
setrvalue(L->top, p);
|
||||
api_incr_top(L);
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
LUA_API void lua_pushlightfunction(lua_State *L, void *p) {
|
||||
lua_lock(L);
|
||||
setlfvalue(L->top, p);
|
||||
api_incr_top(L);
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
LUA_API int lua_pushthread (lua_State *L) {
|
||||
lua_lock(L);
|
||||
@@ -598,8 +613,6 @@ LUA_API int lua_pushthread (lua_State *L) {
|
||||
return (G(L)->mainthread == L);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** get functions (Lua -> stack)
|
||||
*/
|
||||
@@ -609,9 +622,19 @@ LUA_API void lua_getglobal (lua_State *L, const char *var) {
|
||||
Table *reg = hvalue(&G(L)->l_registry);
|
||||
const TValue *gt; /* global table */
|
||||
lua_lock(L);
|
||||
gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
|
||||
setsvalue2s(L, L->top++, luaS_new(L, var));
|
||||
luaV_gettable(L, gt, L->top - 1, L->top - 1);
|
||||
|
||||
lu_byte keytype;
|
||||
luaR_result res = luaR_findglobal(var, &keytype);
|
||||
if (res != 0) {
|
||||
setsvalue2s(L, L->top++, luaS_new(L, var));
|
||||
setlfvalue(L->top - 1, (void*)(size_t)res)
|
||||
}
|
||||
else {
|
||||
gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
|
||||
setsvalue2s(L, L->top++, luaS_new(L, var));
|
||||
luaV_gettable(L, gt, L->top - 1, L->top - 1);
|
||||
}
|
||||
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
@@ -1008,7 +1031,6 @@ LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) {
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
LUA_API int lua_status (lua_State *L) {
|
||||
return L->status;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,12 @@ typedef struct luaL_Reg {
|
||||
lua_CFunction func;
|
||||
} luaL_Reg;
|
||||
|
||||
extern const luaL_Reg baselib[];
|
||||
extern const luaL_Reg mathlib[];
|
||||
extern const luaL_Reg opentxLib[];
|
||||
extern const luaL_Reg bitlib[];
|
||||
extern const luaL_Reg lcdLib[];
|
||||
extern const luaL_Reg modelLib[];
|
||||
|
||||
LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver);
|
||||
#define luaL_checkversion(L) luaL_checkversion_(L, LUA_VERSION_NUM)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "lauxlib.h"
|
||||
#include "lualib.h"
|
||||
|
||||
#include "lrotable.h"
|
||||
|
||||
static int luaB_print (lua_State *L) {
|
||||
int n = lua_gettop(L); /* number of arguments */
|
||||
@@ -411,8 +411,7 @@ static int luaB_tostring (lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static const luaL_Reg base_funcs[] = {
|
||||
const luaL_Reg baselib[] = {
|
||||
{"assert", luaB_assert},
|
||||
{"collectgarbage", luaB_collectgarbage},
|
||||
{"dofile", luaB_dofile},
|
||||
@@ -441,16 +440,10 @@ static const luaL_Reg base_funcs[] = {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
LUAMOD_API int luaopen_base (lua_State *L) {
|
||||
/* set global _G */
|
||||
lua_pushglobaltable(L);
|
||||
lua_pushglobaltable(L);
|
||||
lua_setfield(L, -2, "_G");
|
||||
/* open lib into global table */
|
||||
luaL_setfuncs(L, base_funcs, 0);
|
||||
lua_pushliteral(L, LUA_VERSION);
|
||||
lua_setfield(L, -2, "_VERSION"); /* set global _VERSION */
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// TODO
|
||||
const luaR_value_entry baselib_vals[] = {
|
||||
{"_VERSION", LUA_VERSION},
|
||||
{NULL, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "lauxlib.h"
|
||||
#include "lualib.h"
|
||||
|
||||
#include "lrotable.h"
|
||||
|
||||
/* number of bits to consider in a number */
|
||||
#if !defined(LUA_NBITS)
|
||||
@@ -185,7 +186,7 @@ static int b_replace (lua_State *L) {
|
||||
}
|
||||
|
||||
|
||||
static const luaL_Reg bitlib[] = {
|
||||
const luaL_Reg bitlib[] = {
|
||||
{"arshift", b_arshift},
|
||||
{"band", b_and},
|
||||
{"bnot", b_not},
|
||||
@@ -201,10 +202,11 @@ static const luaL_Reg bitlib[] = {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
const luaR_value_entry bitlib_vals[] = {
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
LUAMOD_API int luaopen_bit32 (lua_State *L) {
|
||||
luaL_newlib(L, bitlib);
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -299,7 +299,10 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
|
||||
ptrdiff_t funcr = savestack(L, func);
|
||||
switch (ttype(func)) {
|
||||
case LUA_TLCF: /* light C function */
|
||||
f = fvalue(func);
|
||||
f = lcfvalue(func);
|
||||
goto Cfunc;
|
||||
case LUA_TLIGHTFUNCTION:
|
||||
f = check_exp(ttislightfunction(func), val_(func).f);
|
||||
goto Cfunc;
|
||||
case LUA_TCCL: { /* C closure */
|
||||
f = clCvalue(func)->f;
|
||||
|
||||
@@ -20,13 +20,14 @@
|
||||
#include "lualib.h"
|
||||
#include "lauxlib.h"
|
||||
|
||||
#include "lrotable.h"
|
||||
|
||||
/*
|
||||
** these libs are loaded by lua.c and are readily available to any Lua
|
||||
** program
|
||||
*/
|
||||
static const luaL_Reg loadedlibs[] = {
|
||||
{"_G", luaopen_base},
|
||||
// {"_G", luaopen_base},
|
||||
// {LUA_LOADLIBNAME, luaopen_package},
|
||||
// {LUA_COLIBNAME, luaopen_coroutine},
|
||||
// {LUA_TABLIBNAME, luaopen_table},
|
||||
@@ -34,11 +35,22 @@ static const luaL_Reg loadedlibs[] = {
|
||||
// {LUA_OSLIBNAME, luaopen_os},
|
||||
// {LUA_STRLIBNAME, luaopen_string},
|
||||
// {LUA_BITLIBNAME, luaopen_bit32},
|
||||
{LUA_MATHLIBNAME, luaopen_math},
|
||||
// {LUA_MATHLIBNAME, luaopen_math},
|
||||
// {LUA_DBLIBNAME, luaopen_debug},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
/* The read-only tables are defined here */
|
||||
const luaR_table lua_rotable[] =
|
||||
{
|
||||
{LUA_MATHLIBNAME, mathlib, mathlib_vals},
|
||||
{LUA_BITLIBNAME, bitlib, NULL},
|
||||
{"lcd", lcdLib, NULL},
|
||||
{"model", modelLib, NULL},
|
||||
{"__baselib", baselib, NULL},
|
||||
{"__opentx", opentxLib, opentxConstants},
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/*
|
||||
** these libs are preloaded and must be required before used
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "lauxlib.h"
|
||||
#include "lualib.h"
|
||||
|
||||
#include "lrotable.h"
|
||||
|
||||
#undef PI
|
||||
#define PI ((lua_Number)(3.1415926535897932384626433832795))
|
||||
@@ -228,20 +229,19 @@ static int math_randomseed (lua_State *L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static const luaL_Reg mathlib[] = {
|
||||
const luaL_Reg mathlib[] = {
|
||||
{"abs", math_abs},
|
||||
{"acos", math_acos},
|
||||
{"asin", math_asin},
|
||||
{"atan2", math_atan2},
|
||||
{"atan", math_atan},
|
||||
{"ceil", math_ceil},
|
||||
{"cosh", math_cosh},
|
||||
{"cosh", math_cosh},
|
||||
{"cos", math_cos},
|
||||
{"deg", math_deg},
|
||||
{"exp", math_exp},
|
||||
{"floor", math_floor},
|
||||
{"fmod", math_fmod},
|
||||
{"fmod", math_fmod},
|
||||
{"frexp", math_frexp},
|
||||
{"ldexp", math_ldexp},
|
||||
#if defined(LUA_COMPAT_LOG10)
|
||||
@@ -263,16 +263,16 @@ static const luaL_Reg mathlib[] = {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
const luaR_value_entry mathlib_vals[] = {
|
||||
{"pi", PI},
|
||||
{"huge", HUGE_VAL},
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
/*
|
||||
** Open math library
|
||||
*/
|
||||
LUAMOD_API int luaopen_math (lua_State *L) {
|
||||
luaL_newlib(L, mathlib);
|
||||
lua_pushnumber(L, PI);
|
||||
lua_setfield(L, -2, "pi");
|
||||
lua_pushnumber(L, HUGE_VAL);
|
||||
lua_setfield(L, -2, "huge");
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,8 @@ typedef union Value Value;
|
||||
#define ttisnil(o) checktag((o), LUA_TNIL)
|
||||
#define ttisboolean(o) checktag((o), LUA_TBOOLEAN)
|
||||
#define ttislightuserdata(o) checktag((o), LUA_TLIGHTUSERDATA)
|
||||
#define ttisrotable(o) checktag((o), LUA_TROTABLE)
|
||||
#define ttislightfunction(o) checktag((o), LUA_TLIGHTFUNCTION)
|
||||
#define ttisstring(o) checktype((o), LUA_TSTRING)
|
||||
#define ttisshrstring(o) checktag((o), ctb(LUA_TSHRSTR))
|
||||
#define ttislngstring(o) checktag((o), ctb(LUA_TLNGSTR))
|
||||
@@ -156,6 +158,8 @@ typedef union Value Value;
|
||||
#define nvalue(o) check_exp(ttisnumber(o), num_(o))
|
||||
#define gcvalue(o) check_exp(iscollectable(o), val_(o).gc)
|
||||
#define pvalue(o) check_exp(ttislightuserdata(o), val_(o).p)
|
||||
#define rvalue(o) check_exp(ttisrotable(o), val_(o).p)
|
||||
#define lfvalue(o) check_exp(ttislightfunction(o), val_(o).p)
|
||||
#define rawtsvalue(o) check_exp(ttisstring(o), &val_(o).gc->ts)
|
||||
#define tsvalue(o) (&rawtsvalue(o)->tsv)
|
||||
#define rawuvalue(o) check_exp(ttisuserdata(o), &val_(o).gc->u)
|
||||
@@ -163,7 +167,7 @@ typedef union Value Value;
|
||||
#define clvalue(o) check_exp(ttisclosure(o), &val_(o).gc->cl)
|
||||
#define clLvalue(o) check_exp(ttisLclosure(o), &val_(o).gc->cl.l)
|
||||
#define clCvalue(o) check_exp(ttisCclosure(o), &val_(o).gc->cl.c)
|
||||
#define fvalue(o) check_exp(ttislcf(o), val_(o).f)
|
||||
#define lcfvalue(o) check_exp(ttislcf(o), val_(o).f)
|
||||
#define hvalue(o) check_exp(ttistable(o), &val_(o).gc->h)
|
||||
#define bvalue(o) check_exp(ttisboolean(o), val_(o).b)
|
||||
#define thvalue(o) check_exp(ttisthread(o), &val_(o).gc->th)
|
||||
@@ -192,12 +196,18 @@ typedef union Value Value;
|
||||
|
||||
#define setnilvalue(obj) settt_(obj, LUA_TNIL)
|
||||
|
||||
#define setfvalue(obj,x) \
|
||||
#define setlcfvalue(obj,x) \
|
||||
{ TValue *io=(obj); val_(io).f=(x); settt_(io, LUA_TLCF); }
|
||||
|
||||
#define setpvalue(obj,x) \
|
||||
{ TValue *io=(obj); val_(io).p=(x); settt_(io, LUA_TLIGHTUSERDATA); }
|
||||
|
||||
#define setrvalue(obj,x) \
|
||||
{ TValue *io=(obj); val_(io).p=(x); settt_(io, LUA_TROTABLE); }
|
||||
|
||||
#define setlfvalue(obj,x) \
|
||||
{ TValue *io=(obj); val_(io).p=(x); settt_(io, LUA_TLIGHTFUNCTION); }
|
||||
|
||||
#define setbvalue(obj,x) \
|
||||
{ TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); }
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
/* Read-only tables for Lua */
|
||||
|
||||
#include <string.h>
|
||||
#include "lua.h"
|
||||
#include "lauxlib.h"
|
||||
#include "lrotable.h"
|
||||
|
||||
/* Local defines */
|
||||
#define LUAR_FINDFUNCTION 0
|
||||
#define LUAR_FINDVALUE 1
|
||||
|
||||
/* Utility function: find a key in a given table (of functions or constants) */
|
||||
static luaR_result luaR_findkey(const void *where, const char *key, int type, int *found) {
|
||||
const char *pname;
|
||||
const luaL_Reg *pf = (luaL_Reg*)where;
|
||||
const luaR_value_entry *pv = (luaR_value_entry*)where;
|
||||
int isfunction = type == LUAR_FINDFUNCTION;
|
||||
*found = 0;
|
||||
if(!where)
|
||||
return 0;
|
||||
while(1) {
|
||||
if (!(pname = isfunction ? pf->name : pv->name))
|
||||
break;
|
||||
if (!strcmp(pname, key)) {
|
||||
*found = 1;
|
||||
return isfunction ? (luaR_result)(size_t)pf->func : (luaR_result)pv->value;
|
||||
}
|
||||
pf ++; pv ++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Find a global "read only table" in the constant lua_rotable array */
|
||||
luaR_result luaR_findglobal(const char *name, lu_byte *ptype) {
|
||||
unsigned i;
|
||||
*ptype = LUA_TNIL;
|
||||
if (strlen(name) > LUA_MAX_ROTABLE_NAME)
|
||||
return 0;
|
||||
for (i=0; lua_rotable[i].name; i++) {
|
||||
if (!strcmp(lua_rotable[i].name, name)) {
|
||||
*ptype = LUA_TROTABLE;
|
||||
return i+1;
|
||||
}
|
||||
if (!strncmp(lua_rotable[i].name, "__", 2)) {
|
||||
int result = luaR_findentry((void *)(size_t)(i+1), name, ptype);
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int luaR_findfunction(lua_State *L, const luaL_Reg *ptable) {
|
||||
int found;
|
||||
const char *key = luaL_checkstring(L, 2);
|
||||
luaR_result res = luaR_findkey(ptable, key, LUAR_FINDFUNCTION, &found);
|
||||
if (found)
|
||||
lua_pushlightfunction(L, (void*)(size_t)res);
|
||||
else
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
luaR_result luaR_findentry(void *data, const char *key, lu_byte *ptype) {
|
||||
int found;
|
||||
unsigned idx = (unsigned)(size_t)data - 1;
|
||||
luaR_result res;
|
||||
*ptype = LUA_TNIL;
|
||||
/* First look at the functions */
|
||||
res = luaR_findkey(lua_rotable[idx].pfuncs, key, LUAR_FINDFUNCTION, &found);
|
||||
if (found) {
|
||||
*ptype = LUA_TLIGHTFUNCTION;
|
||||
return res;
|
||||
}
|
||||
else {
|
||||
/* Then at the values */
|
||||
res = luaR_findkey(lua_rotable[idx].pvalues, key, LUAR_FINDVALUE, &found);
|
||||
if(found) {
|
||||
*ptype = LUA_TNUMBER;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// Read-only tables for Lua
|
||||
|
||||
#ifndef lrotable_h
|
||||
#define lrotable_h
|
||||
|
||||
#include "lua.h"
|
||||
#include "llimits.h"
|
||||
#include "lauxlib.h"
|
||||
|
||||
typedef lua_Number luaR_result;
|
||||
|
||||
// A number entry in the read only table
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
lua_Number value;
|
||||
} luaR_value_entry;
|
||||
|
||||
extern const luaR_value_entry baselib_vals[];
|
||||
extern const luaR_value_entry mathlib_vals[];
|
||||
extern const luaR_value_entry opentxConstants[];
|
||||
|
||||
// A mapping between table name and its entries
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
const luaL_Reg *pfuncs;
|
||||
const luaR_value_entry *pvalues;
|
||||
} luaR_table;
|
||||
|
||||
extern const luaR_table lua_rotable[];
|
||||
|
||||
luaR_result luaR_findglobal(const char *key, lu_byte *ptype);
|
||||
int luaR_findfunction(lua_State *L, const luaL_Reg *ptable);
|
||||
luaR_result luaR_findentry(void *data, const char *key, lu_byte *ptype);
|
||||
|
||||
#endif
|
||||
@@ -113,7 +113,7 @@ static Node *mainposition (const Table *t, const TValue *key) {
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
return hashpointer(t, pvalue(key));
|
||||
case LUA_TLCF:
|
||||
return hashpointer(t, fvalue(key));
|
||||
return hashpointer(t, lcfvalue(key));
|
||||
default:
|
||||
return hashpointer(t, gcvalue(key));
|
||||
}
|
||||
|
||||
@@ -23,12 +23,11 @@ static const char udatatypename[] = "userdata";
|
||||
|
||||
LUAI_DDEF const char *const luaT_typenames_[LUA_TOTALTAGS] = {
|
||||
"no value",
|
||||
"nil", "boolean", udatatypename, "number",
|
||||
"nil", "boolean", "rotable", "lightfunction", udatatypename, "number",
|
||||
"string", "table", "function", udatatypename, "thread",
|
||||
"proto", "upval" /* these last two cases are used for tests only */
|
||||
};
|
||||
|
||||
|
||||
void luaT_init (lua_State *L) {
|
||||
static const char *const luaT_eventname[] = { /* ORDER TM */
|
||||
"__index", "__newindex",
|
||||
|
||||
+12
-8
@@ -77,15 +77,17 @@ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
|
||||
|
||||
#define LUA_TNIL 0
|
||||
#define LUA_TBOOLEAN 1
|
||||
#define LUA_TLIGHTUSERDATA 2
|
||||
#define LUA_TNUMBER 3
|
||||
#define LUA_TSTRING 4
|
||||
#define LUA_TTABLE 5
|
||||
#define LUA_TFUNCTION 6
|
||||
#define LUA_TUSERDATA 7
|
||||
#define LUA_TTHREAD 8
|
||||
#define LUA_TROTABLE 2
|
||||
#define LUA_TLIGHTFUNCTION 3
|
||||
#define LUA_TLIGHTUSERDATA 4
|
||||
#define LUA_TNUMBER 5
|
||||
#define LUA_TSTRING 6
|
||||
#define LUA_TTABLE 7
|
||||
#define LUA_TFUNCTION 8
|
||||
#define LUA_TUSERDATA 9
|
||||
#define LUA_TTHREAD 10
|
||||
|
||||
#define LUA_NUMTAGS 9
|
||||
#define LUA_NUMTAGS 11
|
||||
|
||||
|
||||
|
||||
@@ -214,6 +216,8 @@ LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);
|
||||
LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
|
||||
LUA_API void (lua_pushboolean) (lua_State *L, int b);
|
||||
LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p);
|
||||
LUA_API void (lua_pushlightfunction) (lua_State *L, void *p);
|
||||
LUA_API void (lua_pushrotable) (lua_State *L, void *p);
|
||||
LUA_API int (lua_pushthread) (lua_State *L);
|
||||
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@
|
||||
** without modifying the main part of the file.
|
||||
*/
|
||||
|
||||
|
||||
#define LUA_MAX_ROTABLE_NAME 20
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+149
-51
@@ -25,7 +25,7 @@
|
||||
#include "ltable.h"
|
||||
#include "ltm.h"
|
||||
#include "lvm.h"
|
||||
|
||||
#include "lrotable.h"
|
||||
|
||||
|
||||
/* limit for table tag-method chains (to avoid loops) */
|
||||
@@ -106,9 +106,31 @@ static void callTM (lua_State *L, const TValue *f, const TValue *p1,
|
||||
}
|
||||
}
|
||||
|
||||
static void lua_getcstr(char *dest, const TString *src, size_t maxsize) {
|
||||
if (src->tsv.len+1 > maxsize)
|
||||
dest[0] = '\0';
|
||||
else {
|
||||
memcpy(dest, getstr(src), src->tsv.len);
|
||||
dest[src->tsv.len] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
|
||||
int loop;
|
||||
if (ttisrotable(t)) {
|
||||
setnilvalue(val);
|
||||
if (ttisstring(key)) {
|
||||
char keyname[LUA_MAX_ROTABLE_NAME + 1];
|
||||
lu_byte keytype;
|
||||
lua_getcstr(keyname, rawtsvalue(key), LUA_MAX_ROTABLE_NAME);
|
||||
luaR_result res = luaR_findentry(rvalue(t), keyname, &keytype);
|
||||
if (keytype == LUA_TLIGHTFUNCTION)
|
||||
setlfvalue(val, (void*)(size_t)res)
|
||||
else if (keytype == LUA_TNUMBER)
|
||||
setnvalue(val, (lua_Number)res)
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (loop = 0; loop < MAXTAGLOOP; loop++) {
|
||||
const TValue *tm;
|
||||
if (ttistable(t)) { /* `t' is a table? */
|
||||
@@ -123,7 +145,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
|
||||
}
|
||||
else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX)))
|
||||
luaG_typeerror(L, t, "index");
|
||||
if (ttisfunction(tm)) {
|
||||
if (ttisfunction(tm) || ttislightfunction(tm)) {
|
||||
callTM(L, tm, t, key, val, 1);
|
||||
return;
|
||||
}
|
||||
@@ -264,8 +286,11 @@ int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2) {
|
||||
case LUA_TNIL: return 1;
|
||||
case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2));
|
||||
case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */
|
||||
case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2);
|
||||
case LUA_TLCF: return fvalue(t1) == fvalue(t2);
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
case LUA_TROTABLE:
|
||||
case LUA_TLIGHTFUNCTION:
|
||||
return pvalue(t1) == pvalue(t2);
|
||||
case LUA_TLCF: return lcfvalue(t1) == lcfvalue(t2);
|
||||
case LUA_TSHRSTR: return eqshrstr(rawtsvalue(t1), rawtsvalue(t2));
|
||||
case LUA_TLNGSTR: return luaS_eqlngstr(rawtsvalue(t1), rawtsvalue(t2));
|
||||
case LUA_TUSERDATA: {
|
||||
@@ -554,53 +579,97 @@ void luaV_execute (lua_State *L) {
|
||||
lua_assert(base == ci->u.l.base);
|
||||
lua_assert(base <= L->top && L->top < L->stack + L->stacksize);
|
||||
vmdispatch (GET_OPCODE(i)) {
|
||||
vmcase(OP_MOVE,
|
||||
case OP_MOVE:
|
||||
setobjs2s(L, ra, RB(i));
|
||||
)
|
||||
vmcase(OP_LOADK,
|
||||
break;
|
||||
|
||||
case OP_LOADK:
|
||||
{
|
||||
TValue *rb = k + GETARG_Bx(i);
|
||||
setobj2s(L, ra, rb);
|
||||
)
|
||||
vmcase(OP_LOADKX,
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_LOADKX:
|
||||
{
|
||||
TValue *rb;
|
||||
lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG);
|
||||
rb = k + GETARG_Ax(*ci->u.l.savedpc++);
|
||||
setobj2s(L, ra, rb);
|
||||
)
|
||||
vmcase(OP_LOADBOOL,
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_LOADBOOL:
|
||||
setbvalue(ra, GETARG_B(i));
|
||||
if (GETARG_C(i)) ci->u.l.savedpc++; /* skip next instruction (if C) */
|
||||
)
|
||||
vmcase(OP_LOADNIL,
|
||||
break;
|
||||
|
||||
case OP_LOADNIL:
|
||||
{
|
||||
int b = GETARG_B(i);
|
||||
do {
|
||||
setnilvalue(ra++);
|
||||
} while (b--);
|
||||
)
|
||||
vmcase(OP_GETUPVAL,
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_GETUPVAL:
|
||||
{
|
||||
int b = GETARG_B(i);
|
||||
setobj2s(L, ra, cl->upvals[b]->v);
|
||||
)
|
||||
vmcase(OP_GETTABUP,
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_GETTABUP:
|
||||
{
|
||||
int b = GETARG_B(i);
|
||||
Protect(luaV_gettable(L, cl->upvals[b]->v, RKC(i), ra));
|
||||
)
|
||||
vmcase(OP_GETTABLE,
|
||||
if (ttisstring(RKC(i))) {
|
||||
char keyname[LUA_MAX_ROTABLE_NAME + 1];
|
||||
lu_byte keytype;
|
||||
lua_getcstr(keyname, rawtsvalue(RKC(i)), LUA_MAX_ROTABLE_NAME);
|
||||
luaR_result res = luaR_findglobal(keyname, &keytype);
|
||||
if (keytype == LUA_TROTABLE) {
|
||||
setrvalue(ra, (void*)(size_t)res)
|
||||
}
|
||||
else if (keytype == LUA_TLIGHTFUNCTION)
|
||||
setlfvalue(ra, (void*)(size_t)res)
|
||||
else if (keytype == LUA_TNUMBER)
|
||||
setnvalue(ra, (lua_Number)res)
|
||||
else
|
||||
Protect(luaV_gettable(L, cl->upvals[b]->v, RKC(i), ra));
|
||||
}
|
||||
else {
|
||||
Protect(luaV_gettable(L, cl->upvals[b]->v, RKC(i), ra));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_GETTABLE:
|
||||
/* First try to look for a rotable with this name */
|
||||
Protect(luaV_gettable(L, RB(i), RKC(i), ra));
|
||||
)
|
||||
vmcase(OP_SETTABUP,
|
||||
break;
|
||||
|
||||
case OP_SETTABUP:
|
||||
{
|
||||
int a = GETARG_A(i);
|
||||
Protect(luaV_settable(L, cl->upvals[a]->v, RKB(i), RKC(i)));
|
||||
)
|
||||
vmcase(OP_SETUPVAL,
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_SETUPVAL:
|
||||
{
|
||||
UpVal *uv = cl->upvals[GETARG_B(i)];
|
||||
setobj(L, uv->v, ra);
|
||||
luaC_barrier(L, uv, ra);
|
||||
)
|
||||
vmcase(OP_SETTABLE,
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_SETTABLE:
|
||||
Protect(luaV_settable(L, ra, RKB(i), RKC(i)));
|
||||
)
|
||||
vmcase(OP_NEWTABLE,
|
||||
break;
|
||||
|
||||
case OP_NEWTABLE:
|
||||
{
|
||||
int b = GETARG_B(i);
|
||||
int c = GETARG_C(i);
|
||||
Table *t = luaH_new(L);
|
||||
@@ -608,31 +677,43 @@ void luaV_execute (lua_State *L) {
|
||||
if (b != 0 || c != 0)
|
||||
luaH_resize(L, t, luaO_fb2int(b), luaO_fb2int(c));
|
||||
checkGC(L, ra + 1);
|
||||
)
|
||||
vmcase(OP_SELF,
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_SELF:
|
||||
{
|
||||
StkId rb = RB(i);
|
||||
setobjs2s(L, ra+1, rb);
|
||||
Protect(luaV_gettable(L, rb, RKC(i), ra));
|
||||
)
|
||||
vmcase(OP_ADD,
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_ADD:
|
||||
arith_op(luai_numadd, TM_ADD);
|
||||
)
|
||||
vmcase(OP_SUB,
|
||||
break;
|
||||
|
||||
case OP_SUB:
|
||||
arith_op(luai_numsub, TM_SUB);
|
||||
)
|
||||
vmcase(OP_MUL,
|
||||
break;
|
||||
|
||||
case OP_MUL:
|
||||
arith_op(luai_nummul, TM_MUL);
|
||||
)
|
||||
vmcase(OP_DIV,
|
||||
break;
|
||||
|
||||
case OP_DIV:
|
||||
arith_op(luai_numdiv, TM_DIV);
|
||||
)
|
||||
vmcase(OP_MOD,
|
||||
break;
|
||||
|
||||
case OP_MOD:
|
||||
arith_op(luai_nummod, TM_MOD);
|
||||
)
|
||||
vmcase(OP_POW,
|
||||
break;
|
||||
|
||||
case OP_POW:
|
||||
arith_op(luai_numpow, TM_POW);
|
||||
)
|
||||
vmcase(OP_UNM,
|
||||
break;
|
||||
|
||||
case OP_UNM:
|
||||
{
|
||||
TValue *rb = RB(i);
|
||||
if (ttisnumber(rb)) {
|
||||
lua_Number nb = nvalue(rb);
|
||||
@@ -641,15 +722,19 @@ void luaV_execute (lua_State *L) {
|
||||
else {
|
||||
Protect(luaV_arith(L, ra, rb, rb, TM_UNM));
|
||||
}
|
||||
)
|
||||
}
|
||||
break;
|
||||
|
||||
vmcase(OP_NOT,
|
||||
TValue *rb = RB(i);
|
||||
int res = l_isfalse(rb); /* next assignment may change this value */
|
||||
setbvalue(ra, res);
|
||||
)
|
||||
|
||||
vmcase(OP_LEN,
|
||||
Protect(luaV_objlen(L, ra, RB(i)));
|
||||
)
|
||||
|
||||
vmcase(OP_CONCAT,
|
||||
int b = GETARG_B(i);
|
||||
int c = GETARG_C(i);
|
||||
@@ -662,9 +747,11 @@ void luaV_execute (lua_State *L) {
|
||||
checkGC(L, (ra >= rb ? ra + 1 : rb));
|
||||
L->top = ci->top; /* restore top */
|
||||
)
|
||||
|
||||
vmcase(OP_JMP,
|
||||
dojump(ci, i, 0);
|
||||
)
|
||||
|
||||
vmcase(OP_EQ,
|
||||
TValue *rb = RKB(i);
|
||||
TValue *rc = RKC(i);
|
||||
@@ -675,6 +762,7 @@ void luaV_execute (lua_State *L) {
|
||||
donextjump(ci);
|
||||
)
|
||||
)
|
||||
|
||||
vmcase(OP_LT,
|
||||
Protect(
|
||||
if (luaV_lessthan(L, RKB(i), RKC(i)) != GETARG_A(i))
|
||||
@@ -706,7 +794,9 @@ void luaV_execute (lua_State *L) {
|
||||
donextjump(ci);
|
||||
}
|
||||
)
|
||||
vmcase(OP_CALL,
|
||||
|
||||
case OP_CALL:
|
||||
{
|
||||
int b = GETARG_B(i);
|
||||
int nresults = GETARG_C(i) - 1;
|
||||
if (b != 0) L->top = ra+b; /* else previous instruction set top */
|
||||
@@ -719,8 +809,11 @@ void luaV_execute (lua_State *L) {
|
||||
ci->callstatus |= CIST_REENTRY;
|
||||
goto newframe; /* restart luaV_execute over new Lua function */
|
||||
}
|
||||
)
|
||||
vmcase(OP_TAILCALL,
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_TAILCALL:
|
||||
{
|
||||
int b = GETARG_B(i);
|
||||
if (b != 0) L->top = ra+b; /* else previous instruction set top */
|
||||
lua_assert(GETARG_C(i) - 1 == LUA_MULTRET);
|
||||
@@ -748,7 +841,8 @@ void luaV_execute (lua_State *L) {
|
||||
lua_assert(L->top == oci->u.l.base + getproto(ofunc)->maxstacksize);
|
||||
goto newframe; /* restart luaV_execute over new Lua function */
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
vmcasenb(OP_RETURN,
|
||||
int b = GETARG_B(i);
|
||||
if (b != 0) L->top = ra+b-1;
|
||||
@@ -764,7 +858,9 @@ void luaV_execute (lua_State *L) {
|
||||
goto newframe; /* restart luaV_execute over new Lua function */
|
||||
}
|
||||
)
|
||||
vmcase(OP_FORLOOP,
|
||||
|
||||
case OP_FORLOOP:
|
||||
{
|
||||
lua_Number step = nvalue(ra+2);
|
||||
lua_Number idx = luai_numadd(L, nvalue(ra), step); /* increment index */
|
||||
lua_Number limit = nvalue(ra+1);
|
||||
@@ -774,7 +870,9 @@ void luaV_execute (lua_State *L) {
|
||||
setnvalue(ra, idx); /* update internal index... */
|
||||
setnvalue(ra+3, idx); /* ...and external index */
|
||||
}
|
||||
)
|
||||
}
|
||||
break;
|
||||
|
||||
vmcase(OP_FORPREP,
|
||||
const TValue *init = ra;
|
||||
const TValue *plimit = ra+1;
|
||||
|
||||
+3
-1
@@ -252,8 +252,10 @@ int16_t applyLimits(uint8_t channel, int32_t value)
|
||||
if (lim->revert) ofs = -ofs; // finally do the reverse.
|
||||
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
if (safetyCh[channel] != -128) // if safety channel available for channel check
|
||||
if (safetyCh[channel] != OVERRIDE_CHANNEL_UNDEFINED) {
|
||||
// safety channel available for channel check
|
||||
ofs = calc100toRESX(safetyCh[channel]);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ofs;
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
CURVE_TYPE_CUSTOM,
|
||||
CURVE_TYPE_LAST = CURVE_TYPE_CUSTOM
|
||||
};
|
||||
PACK(typedef struct t_CurveInfo {
|
||||
PACK(typedef struct {
|
||||
uint8_t type:3;
|
||||
uint8_t smooth:1;
|
||||
uint8_t spare:4;
|
||||
@@ -473,7 +473,7 @@ enum CurveRefType {
|
||||
CURVE_REF_FUNC,
|
||||
CURVE_REF_CUSTOM
|
||||
};
|
||||
PACK(typedef struct t_CurveRef {
|
||||
PACK(typedef struct {
|
||||
uint8_t type;
|
||||
int8_t value;
|
||||
}) CurveRef;
|
||||
|
||||
@@ -148,7 +148,7 @@ uint8_t heartbeat;
|
||||
uint8_t stickMode;
|
||||
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
int8_t safetyCh[NUM_CHNOUT];
|
||||
safetych_t safetyCh[NUM_CHNOUT];
|
||||
#endif
|
||||
|
||||
union ReusableBuffer reusableBuffer;
|
||||
@@ -1904,7 +1904,7 @@ void evalFunctions()
|
||||
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
for (uint8_t i=0; i<NUM_CHNOUT; i++) {
|
||||
safetyCh[i] = -128; // not defined
|
||||
safetyCh[i] = OVERRIDE_CHANNEL_UNDEFINED;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3327,7 +3327,7 @@ uint16_t stack_free(uint8_t tid)
|
||||
stack = audioStack;
|
||||
size = AUDIO_STACK_SIZE;
|
||||
break;
|
||||
#if defined(PCBTARANIS)
|
||||
#if 0 // defined(PCBTARANIS)
|
||||
case 255:
|
||||
// main stack
|
||||
stack = (OS_STK *)&_main_stack_start;
|
||||
|
||||
+17
-10
@@ -621,7 +621,12 @@ extern uint8_t pxxFlag[NUM_MODULES];
|
||||
#define PXX_SEND_RANGECHECK (1 << 5)
|
||||
|
||||
#define LEN_STD_CHARS 40
|
||||
|
||||
#if defined(TRANSLATIONS_CZ)
|
||||
#define ZCHAR_MAX (LEN_STD_CHARS)
|
||||
#else
|
||||
#define ZCHAR_MAX (LEN_STD_CHARS + LEN_SPECIAL_CHARS)
|
||||
#endif
|
||||
|
||||
char idx2char(int8_t idx);
|
||||
#if defined(CPUARM) || defined(SIMU)
|
||||
@@ -852,7 +857,14 @@ struct TimerState {
|
||||
extern TimerState timersStates[MAX_TIMERS];
|
||||
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
extern int8_t safetyCh[NUM_CHNOUT];
|
||||
#if defined(CPUARM)
|
||||
typedef int16_t safetych_t;
|
||||
#define OVERRIDE_CHANNEL_UNDEFINED -4096
|
||||
#else
|
||||
typedef int8_t safetych_t;
|
||||
#define OVERRIDE_CHANNEL_UNDEFINED -128
|
||||
#endif
|
||||
extern safetych_t safetyCh[NUM_CHNOUT];
|
||||
#endif
|
||||
|
||||
extern uint8_t trimsCheckTimer;
|
||||
@@ -1467,7 +1479,7 @@ enum AUDIO_SOUNDS {
|
||||
SCRIPT_NOFILE,
|
||||
SCRIPT_SYNTAX_ERROR,
|
||||
SCRIPT_PANIC,
|
||||
SCRIPT_KILLED,
|
||||
SCRIPT_KILLED
|
||||
};
|
||||
enum ScriptReference {
|
||||
SCRIPT_MIX_FIRST,
|
||||
@@ -1490,12 +1502,9 @@ enum AUDIO_SOUNDS {
|
||||
uint8_t outputsCount;
|
||||
ScriptOutput outputs[MAX_SCRIPT_OUTPUTS];
|
||||
};
|
||||
enum InterpreterState {
|
||||
INTERPRETER_RUNNING_PERMANENT_SCRIPTS,
|
||||
INTERPRETER_RUNNING_STANDALONE_SCRIPT,
|
||||
INTERPRETER_RELOAD_PERMANENT_SCRIPTS,
|
||||
INTERPRETER_PANIC,
|
||||
};
|
||||
#define INTERPRETER_RUNNING_STANDALONE_SCRIPT 1
|
||||
#define INTERPRETER_RELOAD_PERMANENT_SCRIPTS 2
|
||||
#define INTERPRETER_PANIC 255
|
||||
extern uint8_t luaState;
|
||||
extern uint8_t luaScriptsCount;
|
||||
extern ScriptInternalData standaloneScript;
|
||||
@@ -1505,8 +1514,6 @@ enum AUDIO_SOUNDS {
|
||||
void luaInit();
|
||||
void luaTask(uint8_t evt);
|
||||
void luaExec(const char *filename);
|
||||
void luaLoadMixScript(uint8_t index);
|
||||
void luaLoadMixScripts();
|
||||
int luaGetMemUsed();
|
||||
#define luaGetCpuUsed(idx) scriptInternalData[idx].instructions
|
||||
bool isTelemetryScriptAvailable(uint8_t index);
|
||||
|
||||
@@ -308,9 +308,10 @@ void putPcmHead()
|
||||
putPcmPart( 0xC0 ) ;
|
||||
}
|
||||
|
||||
uint16_t scaleForPXX(uint8_t i)
|
||||
uint16_t scaleForPXX( uint8_t i )
|
||||
{
|
||||
return channelOutputs[i] * 3 / 4 + 2250 ;
|
||||
int16_t value = ( ( i < 16 ) ? channelOutputs[i] * 3 / 4 : 0 ) + 1024;
|
||||
return limit<uint16_t>(1, value, 2046);
|
||||
}
|
||||
|
||||
void setupPulsesPXX()
|
||||
|
||||
@@ -49,7 +49,7 @@ char idx2char(int8_t idx)
|
||||
if (idx < 37) return '0' + idx - 27;
|
||||
if (idx <= 40) return pgm_read_byte(s_charTab+idx-37);
|
||||
#if LEN_SPECIAL_CHARS > 0
|
||||
if (idx <= ZCHAR_MAX) return 'z' + 5 + idx - 40;
|
||||
if (idx <= (LEN_STD_CHARS + LEN_SPECIAL_CHARS)) return 'z' + 5 + idx - 40;
|
||||
#endif
|
||||
return ' ';
|
||||
}
|
||||
|
||||
@@ -301,7 +301,6 @@ FORCEINLINE void readKeysAndTrims()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ROTARY_ENCODERS <= 2
|
||||
ISR(INT2_vect)
|
||||
{
|
||||
uint8_t input = (PIND & 0x0C);
|
||||
@@ -313,7 +312,6 @@ ISR(INT3_vect)
|
||||
uint8_t input = (PIND & 0x0C);
|
||||
if (input == 0 || input == 0x0C) incRotaryEncoder(0, +1);
|
||||
}
|
||||
#endif
|
||||
|
||||
ISR(INT5_vect)
|
||||
{
|
||||
|
||||
@@ -82,14 +82,12 @@
|
||||
#define JACK_PPM_OUT() PORTG |= (1<<OUT_G_SIM_CTL)
|
||||
#define JACK_PPM_IN() PORTG &= ~(1<<OUT_G_SIM_CTL)
|
||||
|
||||
#define sdDone()
|
||||
|
||||
// SD driver
|
||||
#define sdDone()
|
||||
#if !defined(SIMU)
|
||||
bool sdMounted();
|
||||
void sdMountPoll();
|
||||
void sdPoll10ms();
|
||||
|
||||
#define SD_IS_HC() (0)
|
||||
#define SD_GET_BLOCKNR() (0)
|
||||
#define SD_GET_SIZE_MB() (0)
|
||||
@@ -193,13 +191,8 @@ void pwrOff();
|
||||
#define HAPTIC_OFF() PORTD |= (1 << OUT_D_HAPTIC)
|
||||
|
||||
// Rotary encoder driver
|
||||
#if ROTARY_ENCODERS <= 2
|
||||
#define REA_DOWN() (~PIND & 0x20)
|
||||
#define REB_DOWN() (~PIND & 0x10)
|
||||
#else
|
||||
#define REA_DOWN() (0)
|
||||
#define REB_DOWN() (0)
|
||||
#endif
|
||||
#define REA_DOWN() (~PIND & 0x20)
|
||||
#define REB_DOWN() (~PIND & 0x10)
|
||||
#define ROTENC_DOWN() (REA_DOWN() || REB_DOWN())
|
||||
|
||||
#endif
|
||||
|
||||
@@ -116,12 +116,6 @@ void pwrOff()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ROTARY_ENCODERS <= 2
|
||||
#define ROTENC_DOWN() ((~PIND & 0x20) || (~PIND & 0x10))
|
||||
#else
|
||||
#define ROTENC_DOWN() (0)
|
||||
#endif
|
||||
|
||||
FORCEINLINE uint8_t keyDown()
|
||||
{
|
||||
return ((~PINL) & 0x3F) || ROTENC_DOWN();
|
||||
@@ -196,6 +190,24 @@ bool switchState(EnumKeys enuk)
|
||||
return result;
|
||||
}
|
||||
|
||||
// Trim switches ...
|
||||
static const pm_uchar crossTrim[] PROGMEM ={
|
||||
1<<INP_F_TRM_LH_DWN,
|
||||
1<<INP_F_TRM_LH_UP,
|
||||
1<<INP_F_TRM_LV_DWN,
|
||||
1<<INP_F_TRM_LV_UP,
|
||||
1<<INP_F_TRM_RV_DWN,
|
||||
1<<INP_F_TRM_RV_UP,
|
||||
1<<INP_F_TRM_RH_DWN,
|
||||
1<<INP_F_TRM_RH_UP
|
||||
};
|
||||
|
||||
uint8_t trimDown(uint8_t idx)
|
||||
{
|
||||
uint8_t in = ~PIND;
|
||||
return (in & pgm_read_byte(crossTrim+idx));
|
||||
}
|
||||
|
||||
FORCEINLINE void readKeysAndTrims()
|
||||
{
|
||||
/* Original keys were connected to PORTB as follows:
|
||||
@@ -213,40 +225,28 @@ FORCEINLINE void readKeysAndTrims()
|
||||
|
||||
uint8_t enuk = KEY_MENU;
|
||||
|
||||
keys[BTN_REa].input(~PIND & 0x20, BTN_REa);
|
||||
keys[BTN_REb].input(~PIND & 0x10, BTN_REb);
|
||||
|
||||
// User buttons ...
|
||||
uint8_t tin = ~PINL;
|
||||
uint8_t in;
|
||||
in = (tin & 0x0f) << 3;
|
||||
in |= (tin & 0x30) >> 3;
|
||||
|
||||
for (int i=1; i<7; i++)
|
||||
{
|
||||
for (int i=1; i<7; i++) {
|
||||
//INP_B_KEY_MEN 1 .. INP_B_KEY_LFT 6
|
||||
keys[enuk].input(in & (1<<i),(EnumKeys)enuk);
|
||||
++enuk;
|
||||
}
|
||||
|
||||
// Trim switches ...
|
||||
static const pm_uchar crossTrim[] PROGMEM ={
|
||||
1<<INP_F_TRM_LH_DWN,
|
||||
1<<INP_F_TRM_LH_UP,
|
||||
1<<INP_F_TRM_LV_DWN,
|
||||
1<<INP_F_TRM_LV_UP,
|
||||
1<<INP_F_TRM_RV_DWN,
|
||||
1<<INP_F_TRM_RV_UP,
|
||||
1<<INP_F_TRM_RH_DWN,
|
||||
1<<INP_F_TRM_RH_UP
|
||||
};
|
||||
|
||||
// Trims ...
|
||||
in = ~PINF;
|
||||
|
||||
for (int i=0; i<8; i++) {
|
||||
// INP_D_TRM_RH_UP 0 .. INP_D_TRM_LH_UP 7
|
||||
keys[enuk].input(in & pgm_read_byte(crossTrim+i),(EnumKeys)enuk);
|
||||
++enuk;
|
||||
}
|
||||
|
||||
keys[BTN_REa].input(REA_DOWN(), BTN_REa);
|
||||
keys[BTN_REb].input(REB_DOWN(), BTN_REb);
|
||||
}
|
||||
|
||||
ISR(INT2_vect)
|
||||
|
||||
@@ -83,12 +83,11 @@
|
||||
#define JACK_PPM_IN() PORTG &= ~(1<<OUT_G_SIM_CTL)
|
||||
|
||||
// SD driver
|
||||
#define sdDone()
|
||||
#if !defined(SIMU)
|
||||
bool sdMounted();
|
||||
void sdMountPoll();
|
||||
void sdPoll10ms();
|
||||
#define sdDone()
|
||||
|
||||
#define SD_IS_HC() (0)
|
||||
#define SD_GET_BLOCKNR() (0)
|
||||
#define SD_GET_SIZE_MB() (0)
|
||||
@@ -143,6 +142,7 @@ void sdPoll10ms();
|
||||
# define OUT_G_SIM_CTL 4 //1 : phone-jack=ppm_in
|
||||
|
||||
# define INP_C_ID1 0
|
||||
# define INP_C_ID2 1
|
||||
|
||||
# define INP_G_RF_POW 1
|
||||
# define INP_G_RuddDR 0
|
||||
@@ -155,8 +155,6 @@ void sdPoll10ms();
|
||||
# define OUT_B_PPM 6
|
||||
# define INP_B_Trainer 5
|
||||
|
||||
# define INP_C_ID2 1
|
||||
|
||||
#if defined(VOICE)
|
||||
# define OUT_H_14DRESET 3
|
||||
# define OUT_H_14DCLK 4
|
||||
@@ -194,4 +192,9 @@ void pwrOff();
|
||||
#define HAPTIC_ON() PORTD &= ~(1 << OUT_D_HAPTIC)
|
||||
#define HAPTIC_OFF() PORTD |= (1 << OUT_D_HAPTIC)
|
||||
|
||||
// Rotary encoder driver
|
||||
#define REA_DOWN() (~PIND & 0x20)
|
||||
#define REB_DOWN() (~PIND & 0x10)
|
||||
#define ROTENC_DOWN() (REA_DOWN() || REB_DOWN())
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
volatile uint8_t pina=0xff, pinb=0xff, pinc=0xff, pind, pine=0xff, ping=0xff, pinh=0xff, pinj=0xff, pinl=0;
|
||||
volatile uint8_t pina=0xff, pinb=0xff, pinc=0xff, pind, pine=0xff, pinf=0xff, ping=0xff, pinh=0xff, pinj=0xff, pinl=0;
|
||||
uint8_t portb, portc, porth=0, dummyport;
|
||||
uint16_t dummyport16;
|
||||
const char *eepromFile = NULL;
|
||||
@@ -158,7 +158,7 @@ void simuSetKey(uint8_t key, bool state)
|
||||
#endif
|
||||
#if defined(PCBSKY9X) && !defined(REVX)
|
||||
KEY_CASE(BTN_REa, PIOB->PIO_PDSR, 0x40)
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#elif defined(PCBGRUVIN9X) || defined(PCBMEGA2560)
|
||||
KEY_CASE(BTN_REa, pind, 0x20)
|
||||
#elif defined(ROTARY_ENCODER_NAVIGATION)
|
||||
KEY_CASE(BTN_REa, RotEncoder, 0x20)
|
||||
@@ -212,7 +212,15 @@ void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
SWITCH_CASE(4, pinc, 1<<INP_C_AileDR)
|
||||
SWITCH_CASE(5, ping, 1<<INP_G_Gear)
|
||||
SWITCH_CASE(6, pinb, 1<<INP_B_Trainer)
|
||||
#else // STOCK
|
||||
#elif defined(PCBMEGA2560)
|
||||
SWITCH_CASE(0, ping, 1<<INP_G_ThrCt)
|
||||
SWITCH_CASE(1, ping, 1<<INP_G_RuddDR)
|
||||
SWITCH_CASE(2, pinc, 1<<INP_C_ElevDR)
|
||||
SWITCH_3_CASE(3, pinc, pinc, (1<<INP_C_ID1), (1<<INP_C_ID2))
|
||||
SWITCH_CASE(4, pinc, 1<<INP_C_AileDR)
|
||||
SWITCH_CASE(5, ping, 1<<INP_G_Gear)
|
||||
SWITCH_CASE(6, pinb, 1<<INP_B_Trainer)
|
||||
#else // PCB9X
|
||||
#if defined(JETI) || defined(FRSKY) || defined(NMEA) || defined(ARDUPILOT)
|
||||
SWITCH_CASE(0, pinc, 1<<INP_C_ThrCt)
|
||||
SWITCH_CASE(4, pinc, 1<<INP_C_AileDR)
|
||||
|
||||
@@ -225,6 +225,7 @@ extern void rxPdcUsart( void (*pChProcess)(uint8_t x) );
|
||||
#define PINC ~pinc
|
||||
#define PIND ~pind
|
||||
#define PINE ~pine
|
||||
#define PINF ~pinf
|
||||
#define PING ~ping
|
||||
#define PINH ~pinh
|
||||
#define PINJ ~pinj
|
||||
@@ -334,7 +335,7 @@ extern uint32_t Master_frequency;
|
||||
#define __enable_irq()
|
||||
#endif
|
||||
|
||||
extern volatile unsigned char pina, pinb, pinc, pind, pine, ping, pinh, pinj, pinl;
|
||||
extern volatile unsigned char pina, pinb, pinc, pind, pine, pinf, ping, pinh, pinj, pinl;
|
||||
extern uint8_t portb, portc, porth, dummyport;
|
||||
extern uint16_t dummyport16;
|
||||
extern uint8_t main_thread_running;
|
||||
|
||||
@@ -107,6 +107,7 @@ bool dacQueue(AudioBuffer *buffer)
|
||||
return false;
|
||||
}
|
||||
|
||||
#pragma GCC optimize ("O1")
|
||||
extern "C" void DAC_IRQHandler()
|
||||
{
|
||||
AudioBuffer *nextBuffer = audioQueue.getNextFilledBuffer();
|
||||
@@ -118,6 +119,7 @@ extern "C" void DAC_IRQHandler()
|
||||
dacStop();
|
||||
}
|
||||
}
|
||||
#pragma GCC optimize ("O2")
|
||||
|
||||
// Sound routines
|
||||
void audioInit()
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include "debug.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Exported variables
|
||||
@@ -54,8 +53,10 @@
|
||||
|
||||
#undef errno
|
||||
extern int errno;
|
||||
extern int _end;
|
||||
extern int _main_stack_start;
|
||||
extern int _end;
|
||||
extern int _estack;
|
||||
|
||||
#define RAM_END (unsigned char *)&_estack
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Exported functions
|
||||
@@ -67,7 +68,7 @@ extern int _getpid ( void ) ;
|
||||
unsigned char *heap = (unsigned char *)&_end;
|
||||
extern caddr_t _sbrk(int nbytes)
|
||||
{
|
||||
if (heap + nbytes < (unsigned char *)&_main_stack_start) {
|
||||
if (heap + nbytes < RAM_END-4096) {
|
||||
unsigned char *prev_heap = heap;
|
||||
heap += nbytes;
|
||||
return (caddr_t) prev_heap;
|
||||
@@ -141,8 +142,9 @@ extern int _write( int file, char *ptr, int len )
|
||||
|
||||
extern void _exit( int status )
|
||||
{
|
||||
TRACE( "Exiting with status %d.\n", status ) ;
|
||||
|
||||
#if defined(SIMU)
|
||||
printf( "Exiting with status %d.\n", status ) ;
|
||||
#endif
|
||||
for ( ; ; ) ;
|
||||
}
|
||||
|
||||
|
||||
-15
@@ -98,23 +98,8 @@ LoopFillZerobss:
|
||||
ldr r3, = _ebss
|
||||
cmp r2, r3
|
||||
bcc FillZerobss
|
||||
|
||||
/*Paint Main Stack */
|
||||
ldr r2, = _main_stack_start
|
||||
PaintMainStack:
|
||||
movs r3, #0x55555555
|
||||
str r3, [r2], #4
|
||||
LoopPaintMainStack:
|
||||
ldr r3, = _estack
|
||||
cmp r2, r3
|
||||
bcc PaintMainStack
|
||||
|
||||
/* Call the clock system intitialization function.*/
|
||||
bl SystemInit
|
||||
|
||||
/* Call C++ constructors for static objects */
|
||||
bl __libc_init_array
|
||||
|
||||
/* Call the application's entry point.*/
|
||||
bl main
|
||||
bx lr
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
volatile uint16_t Analog_values[NUMBER_ANALOG];
|
||||
|
||||
#if defined(REVPLUS)
|
||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,1,-1,1, 1};
|
||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,-1,-1,1, 1};
|
||||
#elif defined(REV4a)
|
||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,0,-1,1, 1};
|
||||
#elif !defined(REV3)
|
||||
|
||||
@@ -34,8 +34,6 @@ ENTRY(Reset_Handler)
|
||||
|
||||
/* Highest address of the user mode stack */
|
||||
_estack = 0x20020000; /* end of 128K SRAM */
|
||||
_main_stack_size = 0x1000; /*size of main stack*/
|
||||
_main_stack_start = _estack - _main_stack_size;
|
||||
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
_Min_Heap_Size = 0; /* required amount of heap */
|
||||
|
||||
@@ -21,8 +21,6 @@ ENTRY(Reset_Handler)
|
||||
|
||||
/* Highest address of the user mode stack */
|
||||
_estack = 0x20020000; /* end of 128K SRAM */
|
||||
_main_stack_size = 0x1000; /*size of main stack*/
|
||||
_main_stack_start = _estack - _main_stack_size;
|
||||
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
_Min_Heap_Size = 0; /* required amount of heap */
|
||||
|
||||
+32
-32
@@ -54,7 +54,7 @@
|
||||
#define LEN_SPECIAL_CHARS 6
|
||||
#elif defined(TRANSLATIONS_CZ)
|
||||
#include "translations/cz.h"
|
||||
#define LEN_SPECIAL_CHARS 0
|
||||
#define LEN_SPECIAL_CHARS 17
|
||||
#elif defined(TRANSLATIONS_ES)
|
||||
#include "translations/es.h"
|
||||
#define LEN_SPECIAL_CHARS 0
|
||||
@@ -372,7 +372,7 @@ extern const pm_char STR_BLADES[];
|
||||
extern const pm_char STR_SCREEN[];
|
||||
extern const pm_char STR_SOUND_LABEL[];
|
||||
extern const pm_char STR_LENGTH[];
|
||||
extern const pm_char STR_BEEP_LENGTH[];
|
||||
extern const pm_char STR_BEEP_LENGTH[];
|
||||
#if defined(CPUARM)
|
||||
extern const pm_char STR_BEEP_LENGTH[];
|
||||
#else
|
||||
@@ -407,11 +407,11 @@ extern const pm_char STR_SWITCHWARNING[];
|
||||
extern const pm_char STR_TIMEZONE[];
|
||||
extern const pm_char STR_GPSCOORD[];
|
||||
extern const pm_char STR_VARIO[];
|
||||
extern const pm_char STR_PITCH_AT_ZERO[];
|
||||
extern const pm_char STR_PITCH_AT_MAX[];
|
||||
extern const pm_char STR_REPEAT_AT_ZERO[];
|
||||
extern const pm_char STR_PITCH_AT_ZERO[];
|
||||
extern const pm_char STR_PITCH_AT_MAX[];
|
||||
extern const pm_char STR_REPEAT_AT_ZERO[];
|
||||
extern const pm_char STR_RXCHANNELORD[];
|
||||
extern const pm_char STR_SWITCHES_DELAY[];
|
||||
extern const pm_char STR_SWITCHES_DELAY[];
|
||||
extern const pm_char STR_SLAVE[];
|
||||
extern const pm_char STR_MODESRC[];
|
||||
extern const pm_char STR_MULTIPLIER[];
|
||||
@@ -471,8 +471,8 @@ extern const pm_char STR_MENUCURVE[];
|
||||
extern const pm_char STR_MENULOGICALSWITCH[];
|
||||
extern const pm_char STR_MENULOGICALSWITCHES[];
|
||||
extern const pm_char STR_MENUCUSTOMFUNC[];
|
||||
extern const pm_char STR_MENUCUSTOMSCRIPTS[];
|
||||
extern const pm_char STR_MENUCUSTOMSCRIPT[];
|
||||
extern const pm_char STR_MENUCUSTOMSCRIPTS[];
|
||||
extern const pm_char STR_MENUCUSTOMSCRIPT[];
|
||||
extern const pm_char STR_MENUTELEMETRY[];
|
||||
extern const pm_char STR_MENUTEMPLATES[];
|
||||
extern const pm_char STR_MENUSTAT[];
|
||||
@@ -574,7 +574,7 @@ extern const pm_char STR_RESET_BTN[];
|
||||
|
||||
extern const pm_char STR_WARNING[];
|
||||
extern const pm_char STR_EEPROMWARN[];
|
||||
extern const pm_char STR_EEPROM_CONVERTING[];
|
||||
extern const pm_char STR_EEPROM_CONVERTING[];
|
||||
extern const pm_char STR_THROTTLEWARN[];
|
||||
extern const pm_char STR_ALARMSWARN[];
|
||||
extern const pm_char STR_SWITCHWARN[];
|
||||
@@ -599,10 +599,10 @@ extern const pm_char STR_SDHC_CARD[];
|
||||
extern const pm_char STR_NO_SOUNDS_ON_SD[];
|
||||
extern const pm_char STR_NO_MODELS_ON_SD[];
|
||||
extern const pm_char STR_NO_BITMAPS_ON_SD[];
|
||||
extern const pm_char STR_NO_SCRIPTS_ON_SD[];
|
||||
extern const pm_char STR_NO_SCRIPTS_ON_SD[];
|
||||
extern const pm_char STR_PLAY_FILE[];
|
||||
extern const pm_char STR_ASSIGN_BITMAP[];
|
||||
extern const pm_char STR_EXECUTE_FILE[];
|
||||
extern const pm_char STR_EXECUTE_FILE[];
|
||||
extern const pm_char STR_DELETE_FILE[];
|
||||
extern const pm_char STR_COPY_FILE[];
|
||||
extern const pm_char STR_RENAME_FILE[];
|
||||
@@ -628,14 +628,14 @@ extern const pm_char STR_OWN[];
|
||||
extern const pm_char STR_ROTARY_ENCODER[];
|
||||
extern const pm_char STR_DATE[];
|
||||
extern const pm_char STR_CHANNELS_MONITOR[];
|
||||
extern const pm_char STR_PATH_TOO_LONG[];
|
||||
extern const pm_char STR_VIEW_TEXT[];
|
||||
extern const pm_char STR_FLASH_BOOTLOADER[];
|
||||
extern const pm_char STR_WRITING[];
|
||||
extern const pm_char STR_PATH_TOO_LONG[];
|
||||
extern const pm_char STR_VIEW_TEXT[];
|
||||
extern const pm_char STR_FLASH_BOOTLOADER[];
|
||||
extern const pm_char STR_WRITING[];
|
||||
extern const pm_char STR_CONFIRM_FORMAT[];
|
||||
extern const pm_char STR_EEBACKUP[];
|
||||
extern const pm_char STR_TOO_MANY_LUA_SCRIPTS[];
|
||||
extern const pm_char STR_BLCOLOR[];
|
||||
extern const pm_char STR_TOO_MANY_LUA_SCRIPTS[];
|
||||
extern const pm_char STR_BLCOLOR[];
|
||||
|
||||
#if defined(VOICE) && defined(CPUARM)
|
||||
struct LanguagePack {
|
||||
@@ -697,24 +697,24 @@ extern const pm_char STR_BLCOLOR[];
|
||||
#if defined(PCBTARANIS)
|
||||
extern const pm_char STR_BYTES[];
|
||||
extern const pm_char STR_ANTENNAPROBLEM[];
|
||||
extern const pm_char STR_MODULE[];
|
||||
extern const pm_char STR_ENABLE_POPUP[];
|
||||
extern const pm_char STR_DISABLE_POPUP[];
|
||||
extern const pm_char STR_CURVE_PRESET[];
|
||||
extern const pm_char STR_PRESET[];
|
||||
extern const pm_char STR_MIRROR[];
|
||||
extern const pm_char STR_CLEAR[];
|
||||
extern const pm_char STR_MODULE[];
|
||||
extern const pm_char STR_ENABLE_POPUP[];
|
||||
extern const pm_char STR_DISABLE_POPUP[];
|
||||
extern const pm_char STR_CURVE_PRESET[];
|
||||
extern const pm_char STR_PRESET[];
|
||||
extern const pm_char STR_MIRROR[];
|
||||
extern const pm_char STR_CLEAR[];
|
||||
extern const pm_char STR_RESET[];
|
||||
extern const pm_char STR_COUNT[];
|
||||
extern const pm_char STR_PT[];
|
||||
extern const pm_char STR_PTS[];
|
||||
extern const pm_char STR_SMOOTH[];
|
||||
extern const pm_char STR_COPY_STICKS_TO_OFS[];
|
||||
extern const pm_char STR_COPY_TRIMS_TO_OFS[];
|
||||
extern const pm_char STR_COUNT[];
|
||||
extern const pm_char STR_PT[];
|
||||
extern const pm_char STR_PTS[];
|
||||
extern const pm_char STR_SMOOTH[];
|
||||
extern const pm_char STR_COPY_STICKS_TO_OFS[];
|
||||
extern const pm_char STR_COPY_TRIMS_TO_OFS[];
|
||||
extern const pm_char STR_TOP_BAR[];
|
||||
extern const pm_char STR_ALTITUDE[];
|
||||
extern const pm_char STR_SCALE[];
|
||||
extern const pm_char STR_VIEW_CHANNELS[];
|
||||
extern const pm_char STR_SCALE[];
|
||||
extern const pm_char STR_VIEW_CHANNELS[];
|
||||
extern const pm_char STR_POTWARNING[];
|
||||
extern const pm_char STR_UART3MODE[];
|
||||
extern const pm_char STR_THROTTLE_LABEL[];
|
||||
|
||||
@@ -80,10 +80,10 @@
|
||||
#define TR_TRNCHN "CH1CH2CH3CH4"
|
||||
|
||||
#define LEN_UART3MODES "\017"
|
||||
#define TR_UART3MODES "VYP\0 ""S-Port Mirror\0 ""Telemetry\0 ""Debug\0 "
|
||||
#define TR_UART3MODES "VYP\0 ""S-Port Mirror\0 ""Telemetrie\0 ""Debug\0 "
|
||||
|
||||
#define LEN_POTTYPES "\017"
|
||||
#define TR_POTTYPES "Není\0 ""Pot with detent""Vícepol. přep.\0""Potenciometr\0"
|
||||
#define TR_POTTYPES "Není\0 ""Pot s aretací\0 ""Vícepol. přep.\0""Potenciometr\0"
|
||||
|
||||
#define LEN_DATETIME "\006"
|
||||
#define TR_DATETIME "DATUM:""ČAS: "
|
||||
@@ -92,7 +92,7 @@
|
||||
#define TR_VLCD "NormalOptrex"
|
||||
|
||||
#define LEN_VPERSISTENT "\014"
|
||||
#define TR_VPERSISTENT "OFF\0 ""Flight\0 ""Manual Reset"
|
||||
#define TR_VPERSISTENT "Ne\0 ""V rámci letu""Reset ručně\0"
|
||||
|
||||
#define LEN_COUNTRYCODES TR("\002", "\010")
|
||||
#define TR_COUNTRYCODES TR("US""JP""EU", "Amerika\0""Japonsko""Evropa\0 ")
|
||||
@@ -253,7 +253,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(LUA)
|
||||
#define TR_CFN_PLAY_SCRIPT "Lua Script\0"
|
||||
#define TR_CFN_PLAY_SCRIPT "Lua Skript\0"
|
||||
#else
|
||||
#define TR_CFN_PLAY_SCRIPT "[Lua]\0 "
|
||||
#endif
|
||||
@@ -570,7 +570,7 @@
|
||||
#define TR_SCREEN "Panel "
|
||||
#define TR_SOUND_LABEL "Zvuk"
|
||||
#define TR_LENGTH INDENT"Délka"
|
||||
#define TR_BEEP_LENGTH INDENT "Beep Length"
|
||||
#define TR_BEEP_LENGTH INDENT "Délka"
|
||||
#define TR_SPKRPITCH INDENT"Tón"
|
||||
#define TR_HAPTIC_LABEL "Vibrace"
|
||||
#define TR_HAPTICSTRENGTH INDENT"Síla"
|
||||
@@ -598,7 +598,7 @@
|
||||
#define TR_POTWARNING TR("* Potenc.", INDENT "Nastavení Pot.")
|
||||
#define TR_TIMEZONE "časové pásmo"
|
||||
#define TR_RXCHANNELORD TR("Pořadí kanálů", "Výchozí pořadí kanálů")
|
||||
#define TR_SWITCHES_DELAY "Switches Delay"
|
||||
#define TR_SWITCHES_DELAY "Přechod středu přepínače"
|
||||
#define TR_SLAVE "Podřízený"
|
||||
#define TR_MODESRC " Mód\006% Zdroj"
|
||||
#define TR_MULTIPLIER "Násobič"
|
||||
@@ -800,7 +800,7 @@
|
||||
#define TR_ANTENNAPROBLEM CENTER "Problém s TX anténou!"
|
||||
#define TR_MODELIDUSED TR("ID již použito","ID modelu je již použito")
|
||||
#define TR_MODULE INDENT "Modul"
|
||||
#define TR_TELEMETRY_TYPE TR("Type", "Telemetry Type")
|
||||
#define TR_TELEMETRY_TYPE TR("Typ", "Typ telemetrie")
|
||||
#define TR_CHANNELRANGE INDENT "Rozsah kanálů"
|
||||
#define TR_LOWALARM INDENT "Nízký Alarm"
|
||||
#define TR_CRITICALALARM INDENT "Kritický Alarm"
|
||||
@@ -816,8 +816,8 @@
|
||||
#define TR_PT "č."
|
||||
#define TR_PTS " b."
|
||||
#define TR_SMOOTH "Hladká"
|
||||
#define TR_COPY_STICKS_TO_OFS "Kopírovat stick do subtrimu"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Copy trims to subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS "Kopie pák do subtrimu"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Kopíe trimů do subtrimu"
|
||||
#define TR_PERSISTENT_MAH TR(INDENT "Str mAh", INDENT "Ukládat mAh")
|
||||
#define TR_PREFLIGHT "Předletová kontrola"
|
||||
#define TR_CHECKLIST INDENT "Zobrazit poznámky"
|
||||
@@ -827,7 +827,7 @@
|
||||
#define TR_INPUTS "Vstupy"
|
||||
#define TR_OUTPUTS "Výstupy"
|
||||
#define TR_EEBACKUP "\010[dlouze ENTER] zálohuje EEPROM"
|
||||
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||
#define TR_TO_MANY_LUA_SCRIPTS "Příliš mnoho skriptů!"
|
||||
|
||||
#if defined(MAVLINK)
|
||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||
@@ -871,7 +871,7 @@
|
||||
|
||||
#define TR_ABOUT_BERTRAND_1 "Bertrand Songis"
|
||||
#define TR_ABOUT_BERTRAND_2 "Hlavní vývojář OpenTX"
|
||||
#define TR_ABOUT_BERTRAND_3 "Spoluautor Companion9x"
|
||||
#define TR_ABOUT_BERTRAND_3 "Spoluautor Companion"
|
||||
|
||||
#define TR_ABOUT_MIKE_1 "Mike Blandford"
|
||||
#define TR_ABOUT_MIKE_2 "Specialista na kód,"
|
||||
@@ -880,7 +880,7 @@
|
||||
|
||||
#define TR_ABOUT_ROMOLO_1 "Romolo Manfredini"
|
||||
#define TR_ABOUT_ROMOLO_2 "Hlavní vývojář"
|
||||
#define TR_ABOUT_ROMOLO_3 "Companion9x"
|
||||
#define TR_ABOUT_ROMOLO_3 "Companion"
|
||||
|
||||
#define TR_ABOUT_ANDRE_1 "Andre Bernet"
|
||||
#define TR_ABOUT_ANDRE_2 "Funkčnost, použitelnost,"
|
||||
@@ -891,8 +891,8 @@
|
||||
|
||||
#define TR_ABOUT_KJELL_1 "Kjell Kernen"
|
||||
#define TR_ABOUT_KJELL_2 "www.open-tx.org main author"
|
||||
#define TR_ABOUT_KJELL_3 "OpenTX Recorder author"
|
||||
#define TR_ABOUT_KJELL_4 "Companion contributor"
|
||||
#define TR_ABOUT_KJELL_3 "autor OpenTX Recorder"
|
||||
#define TR_ABOUT_KJELL_4 "Spoluautor Companion"
|
||||
|
||||
#define TR_ABOUT_MARTIN_1 "Martin Hotař"
|
||||
#define TR_ABOUT_MARTIN_2 "Grafický design, Čeština"
|
||||
|
||||
@@ -460,7 +460,7 @@
|
||||
#define TR_VSRCRAW "---\0""Rud\0""Ele\0""Thr\0""Ail\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODERS "MAX\0" TR_CYC_VSRCRAW "TrmR" "TrmE" "TrmT" "TrmA" TR_SW_VSRCRAW
|
||||
|
||||
#define LEN_VTMRMODES "\003"
|
||||
#define TR_VTMRMODES "OFF""ABS""THs""TH%""THt"
|
||||
#define TR_VTMRMODES "OFF""ON\0""THs""TH%""THt"
|
||||
|
||||
#define LEN_VTRAINERMODES "\006"
|
||||
#define TR_VTRAINERMODES "Master""Slave\0"
|
||||
@@ -518,11 +518,15 @@
|
||||
#define TR_ELIMITS TR("E.Limits", "Extended Limits")
|
||||
#define TR_ETRIMS TR("E.Trims", "Extended Trims")
|
||||
#define TR_TRIMINC "Trim Step"
|
||||
#define TR_TTRACE TR("T-Source", INDENT "Timer Source")
|
||||
#define TR_TTRACE TR("T-Source", INDENT "Source")
|
||||
#define TR_TTRIM TR("T-Trim", INDENT "Trim Idle Only")
|
||||
#define TR_BEEPCTR TR("Ctr Beep", "Center Beep")
|
||||
#define TR_PROTO TR(INDENT "Proto", INDENT "Protocol")
|
||||
#define TR_PPMFRAME TR(INDENT "PPM frame", INDENT "PPM frame")
|
||||
#if defined(CPUARM)
|
||||
#define TR_PPMFRAME INDENT "PPM frame"
|
||||
#else
|
||||
#define TR_PPMFRAME "PPM frame"
|
||||
#endif
|
||||
#define TR_MS "ms"
|
||||
#define TR_SWITCH "Switch"
|
||||
#define TR_TRIMS "Trims"
|
||||
@@ -680,7 +684,11 @@
|
||||
#define TR_MENUTEMPLATES "TEMPLATES"
|
||||
#define TR_MENUSTAT "STATS"
|
||||
#define TR_MENUDEBUG "DEBUG"
|
||||
#define TR_RXNUM TR(INDENT "RxNum", INDENT "Receiver No.")
|
||||
#if defined(CPUARM)
|
||||
#define TR_RXNUM TR(INDENT "RxNum", INDENT "Receiver No.")
|
||||
#else
|
||||
#define TR_RXNUM "RxNum"
|
||||
#endif
|
||||
#define TR_SYNCMENU "[Sync]"
|
||||
#define TR_LIMIT INDENT "Limit"
|
||||
#define TR_MINRSSI "Min Rssi"
|
||||
|
||||
@@ -458,7 +458,7 @@
|
||||
#define TR_VSRCRAW "---\0""Dir\0""Prf\0""Gaz\0""Ail\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODERS "MAX\0" TR_CYC_VSRCRAW "TrmD" "TrmP" "TrmG" "TrmA" TR_SW_VSRCRAW
|
||||
|
||||
#define LEN_VTMRMODES "\003"
|
||||
#define TR_VTMRMODES "OFF""ABS""GZs""GZ%""GZt"
|
||||
#define TR_VTMRMODES "OFF""ON\0""GZs""GZ%""GZt"
|
||||
|
||||
#define LEN_VTRAINERMODES "\006"
|
||||
#define TR_VTRAINERMODES "Maître""Elève\0"
|
||||
@@ -516,7 +516,7 @@
|
||||
#define TR_ELIMITS TR("Limites ét", "Limites étendues")
|
||||
#define TR_ETRIMS TR("Trims ét.", "Trims étendus")
|
||||
#define TR_TRIMINC TR("Pas Trim", "Pas des trims")
|
||||
#define TR_TTRACE TR("Src\001chrnos", INDENT "Source chronos")
|
||||
#define TR_TTRACE TR("Source Gaz", INDENT "Source")
|
||||
#define TR_TTRIM TR("Trim gaz", INDENT "Trim ralenti uniq.")
|
||||
#define TR_BEEPCTR TR("Bips centr", "Bips centrage")
|
||||
#define TR_PROTO TR(INDENT "Proto.", INDENT "Protocole")
|
||||
|
||||
Reference in New Issue
Block a user