Page 1 of 1

NXC: completely disable BTNEXIT for program abort?

Posted: 30 Jun 2011, 18:43
by HaWe
is it possible to completely disable BTNEXIT for any program abort?
I want to use it for program control even if it's constantly pressed far longer than 2 sec.
(Program abort is handled by a customized function.)

Re: NXC: completely disable BTNEXIT for program abort?

Posted: 01 Jul 2011, 02:10
by mattallen37
You mean like SetAbortFlag(false); ?

Re: NXC: completely disable BTNEXIT for program abort?

Posted: 01 Jul 2011, 02:19
by muntoo
Like this:

Code: Select all

SetAbortFlag(BTNSTATE_LONG_PRESSED_EV);
And if you want to keep pressing the exit button forever:

Code: Select all

SetAbortFlag(BTNSTATE_NONE);
More constants here.

Alternatively, you can also use:

Code: Select all

SetLongAbort(true);
I prefer that method.

Re: NXC: completely disable BTNEXIT for program abort?

Posted: 01 Jul 2011, 06:36
by HaWe
SetLongAbort(true) shuts off after 2sec, I know (and tried) that but that's not what I wanted.
But SetAbortFlag(BTNSTATE_NONE) could be a solution, this I will try, thanks!