1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 04:15:26 +03:00

Merge branch '2.3.1' into 2.3

This commit is contained in:
Kilrah 2019-10-07 18:13:19 +02:00
commit 16ace5cb57
6 changed files with 21 additions and 16 deletions

View file

@ -113,7 +113,7 @@ OpenTxSim::OpenTxSim(FXApp* a):
sliders[i]->setValue(0);
}
for(int i=0; i<NUM_POTS+NUM_SLIDERS; i++){
for (int i = 0; i < NUM_POTS + NUM_SLIDERS; i++) {
knobs[i]= new FXKnob(hf11, nullptr, 0, KNOB_TICKS|LAYOUT_LEFT);
knobs[i]->setValue(0);
@ -125,6 +125,7 @@ OpenTxSim::OpenTxSim(FXApp* a):
continue;
}
#endif
knobs[i]->setRange(-1024, 1024);
}
@ -152,7 +153,7 @@ OpenTxSim::~OpenTxSim()
delete sliders[2];
delete sliders[3];
for(int i=0; i<NUM_POTS+NUM_SLIDERS; i++){
for (int i = 0; i < NUM_POTS + NUM_SLIDERS; i++) {
delete knobs[i];
}
@ -521,10 +522,10 @@ int main(int argc, char ** argv)
uint16_t anaIn(uint8_t chan)
{
if (chan<NUM_STICKS)
if (chan < NUM_STICKS)
return opentxSim->sliders[chan]->getValue();
else if (chan<NUM_STICKS+NUM_POTS+NUM_SLIDERS)
return opentxSim->knobs[chan-NUM_STICKS]->getValue();
else if (chan < NUM_STICKS + NUM_POTS + NUM_SLIDERS)
return opentxSim->knobs[chan - NUM_STICKS]->getValue();
#if defined(PCBTARANIS)
else if (chan == TX_RTC_VOLTAGE)
return 800; // 2.34V