1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 19:40:20 +03:00

[X9D] P3 fix

This commit is contained in:
Bertrand Songis 2019-10-07 12:40:11 +02:00
parent 63614a06f8
commit f78dbafa17
No known key found for this signature in database
GPG key ID: F189F79290FEC50F
7 changed files with 32 additions and 14 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