Help finding the power on delay for qx7 in source code

Need some advice? Trying out a new idea? Fancy a beer?
Join us for some general banter and good times.
Post Reply
bengmo
Posts: 2
Joined: Tue Apr 17, 2018 12:16 am
Country: -

Help finding the power on delay for qx7 in source code

Post by bengmo » Tue Apr 17, 2018 12:30 am

I have downloaded and after much trial an error, got the source for opentx 2.2 to compile. I found the PWR_OFF_DELAY and reduced it to 1.5 seconds. Now I would like to find the power on delay code and reduce that delay to zero but I can't seem to find it anywhere!

I've done some experimenting with java and C++ years ago, but this is beyond me.

Can one of you fine gentlemen/ladies help me find the code that controls that delay before powering on the Taranis Qx7? What I'm talking about is the little squares that pop up while you hold the power button, the radio doesn't actually boot up until four of them appear, one by one. What I would prefer is if the radio would just come on instantly, I'm not worried about accidentally turning it on. :D


User avatar
MikeB
9x Developer
Posts: 16585
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Help finding the power on delay for qx7 in source code

Post by MikeB » Tue Apr 17, 2018 1:36 pm

radio\src\targets\Taranis\board.cpp

Code: Select all

    while (pwrPressed()) {
      duration = get_tmr10ms() - start;
      if (duration < PWR_PRESS_DURATION_MIN) {
        unsigned index = duration / (PWR_PRESS_DURATION_MIN / 4);
        lcdClear();
#if defined(PCBX9E)
        lcdDrawBitmap(76, 2, bmp_startup, index*60, 60);
#else
        for(uint8_t i= 0; i < 4; i++) {
          if (index >= i) {
            lcdDrawFilledRect(LCD_W / 2 - 18 + 10 * i, LCD_H / 2 - 3, 6, 6, SOLID, 0);
          }
        }
#endif
PWR_PRESS_DURATION_MIN is defined as 100 (units of 10mS) so 1 second.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

DaniLecx
Posts: 2
Joined: Sat Jun 01, 2019 8:58 am
Country: -

Re: Help finding the power on delay for qx7 in source code

Post by DaniLecx » Sat Jun 01, 2019 9:03 am

Where did you find PWR_OFF_DELAY ? Haven't found it in OpenTX 2.3
Last edited by DaniLecx on Sat Jun 01, 2019 10:12 pm, edited 2 times in total.

User avatar
MikeB
9x Developer
Posts: 16585
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Help finding the power on delay for qx7 in source code

Post by MikeB » Sat Jun 01, 2019 9:08 pm

I've just found:
#define PWR_PRESS_SHUTDOWN_DELAY 300 // 3s
in openTx.h

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

DaniLecx
Posts: 2
Joined: Sat Jun 01, 2019 8:58 am
Country: -

Re: Help finding the power on delay for qx7 in source code

Post by DaniLecx » Sat Jun 01, 2019 10:12 pm

I found it too ! Thanks for the help :)


bpjacobsen
Posts: 28
Joined: Sat Jul 27, 2019 7:02 pm
Country: -

Re: Help finding the power on delay for qx7 in source code

Post by bpjacobsen » Sat Oct 12, 2019 12:49 am

Hello, can someone please help me locate where I edit the power shutoff time? I'm using a QX7. Not finding any script files that would appear to have this in it. I have not yet messed with lua script as I'm new to open tx this year. (I know how to use the radio and all, but have not learned yet how to access and update script files for stuff like this. I did a *.lua search in the usb drive that comes up when I plug in the Tx but I don't think any of these would have this setting in it? (see attached)
Attachments
Lua scripts.png

User avatar
Kilrah
Posts: 10237
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Help finding the power on delay for qx7 in source code

Post by Kilrah » Sat Oct 12, 2019 7:35 am

Nothing to do with lua.
Why don't you just update to 2.3 which has this user adjustable?

bpjacobsen
Posts: 28
Joined: Sat Jul 27, 2019 7:02 pm
Country: -

Re: Help finding the power on delay for qx7 in source code

Post by bpjacobsen » Sat Oct 12, 2019 3:28 pm

oh, well I guess I will do that then. thanks. didn't realize I was not on the latest version.


Post Reply

Return to “The Pickled Gnu (The Pub)”