NXC: completely disable BTNEXIT for program abort?

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

NXC: completely disable BTNEXIT for program abort?

Post 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.)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXC: completely disable BTNEXIT for program abort?

Post by mattallen37 »

You mean like SetAbortFlag(false); ?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: NXC: completely disable BTNEXIT for program abort?

Post 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.
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXC: completely disable BTNEXIT for program abort?

Post 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!
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 3 guests