Page 1 of 1

increasing number of global variables on stock board

Posted: Fri Jan 18, 2013 9:56 pm
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

Re: increasing number of global variables on stock board

Posted: Fri Jan 18, 2013 10:29 pm
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...

Re: increasing number of global variables on stock board

Posted: Sat Jan 19, 2013 2:44 am
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

Re: increasing number of global variables on stock board

Posted: Sat Jan 19, 2013 9:07 pm
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.

Re: increasing number of global variables on stock board

Posted: Sat Jan 19, 2013 9:10 pm
by Rob Thomson
At last. Negative gvar is superb!

:-)

Sent from my GT-I9300 using Tapatalk 2

Re: increasing number of global variables on stock board

Posted: Sat Jan 19, 2013 9:14 pm
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.

Re: increasing number of global variables on stock board

Posted: Sun Jan 20, 2013 9:15 am
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