increasing number of global variables on stock board

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
archer183
Posts: 97
Joined: Mon Oct 08, 2012 4:31 am
Country: -

increasing number of global variables on stock board

Post by archer183 »

So I realized that I wanted a few extra global variables in the stock board to play with. I've got plenty of space left to add some in the modified open9x I've been playing around with. I found the right spot to increase the quantity so that in the curves menu I get say 7 instead of 5 global variables, and values I put in there are saved when the tx is powered off. what I have not figured out is what I missed so those variables will show up in the mix menu? can someone point me to the block of code that deals with the mix menu and global variables? I can probably figure it out from there.

thanks
Greg

User avatar
Peter
Posts: 232
Joined: Thu Dec 29, 2011 8:45 pm
Country: -
Location: Zuid-Holland

Re: increasing number of global variables on stock board

Post by Peter »

I don't think it is possible without changing the eeprom structure. One byte is used for mixer value. -125 to 125 is 251 values. Leaving 5 values for the gvars...
archer183
Posts: 97
Joined: Mon Oct 08, 2012 4:31 am
Country: -

Re: increasing number of global variables on stock board

Post by archer183 »

If that be the case then I can readily live with it by relocating the input parameters to my custom code I use gvars 1-5 for to gvars 6-10 and reserve 1-5 for normal usage. Now onto finding the section of the code that puts gvar1-n in the menu and rename it something else for the ones I am hijacking
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: increasing number of global variables on stock board

Post by bertrand35 »

Have a look to my last commit, I added the negative GVxx which can be useful for differential. You will be able to select there -GV5 .. -GV1 and GV1 .. GV5.
Now if you want more global vars, it's a little bit more difficult, because of the 256 values of a byte... But if you don't need to go from -125 to 125, it's rather easy. You will have to modify 2 functions:

- gvarMenuItem(...)
- GET_GVAR(...)

For the mixer you have to search for "MixOne" in model_menus.cpp

Bertrand.
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: increasing number of global variables on stock board

Post by Rob Thomson »

At last. Negative gvar is superb!

:-)

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: increasing number of global variables on stock board

Post by bertrand35 »

Right. It's difficult to work on features, add new boards support + real work and real life. Ok I must go, the baby is calling ;)
Bertrand.
User avatar
Peter
Posts: 232
Joined: Thu Dec 29, 2011 8:45 pm
Country: -
Location: Zuid-Holland

Re: increasing number of global variables on stock board

Post by Peter »

The software is already great! With negative gvars it is even better.
But family life is more important!

Verstuurd van mijn TF300T met Tapatalk

Post Reply

Return to “openTx”