Page 1 of 1

Help finding the power on delay for qx7 in source code

Posted: Tue Apr 17, 2018 12:30 am
by bengmo
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

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

Posted: Tue Apr 17, 2018 1:36 pm
by MikeB
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

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

Posted: Sat Jun 01, 2019 9:03 am
by DaniLecx
Where did you find PWR_OFF_DELAY ? Haven't found it in OpenTX 2.3

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

Posted: Sat Jun 01, 2019 9:08 pm
by MikeB
I've just found:
#define PWR_PRESS_SHUTDOWN_DELAY 300 // 3s
in openTx.h

Mike

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

Posted: Sat Jun 01, 2019 10:12 pm
by DaniLecx
I found it too ! Thanks for the help :)

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

Posted: Sat Oct 12, 2019 12:49 am
by bpjacobsen
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)

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

Posted: Sat Oct 12, 2019 7:35 am
by Kilrah
Nothing to do with lua.
Why don't you just update to 2.3 which has this user adjustable?

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

Posted: Sat Oct 12, 2019 3:28 pm
by bpjacobsen
oh, well I guess I will do that then. thanks. didn't realize I was not on the latest version.