9 years, 1 month ago.

Remove Attach Function.

How can i Stop Attach Function Interrupt .?

Question relating to:

2 Answers

9 years, 1 month ago.

Attach again with a null pointer as the function to call.

e.g. myTicker.attach(null,1);

9 years, 1 month ago.

Actually I don't think that works properly on Ticker (Andy's method), it does work for everything else though. But for Ticker use the detach function to stop it from being called.

Attaching zero works, it won't call your user function anymore, but the underlying hardware will keep generating the interrupt.

Trust me to pick the one case where it doesn't work for my example. ;-)

posted by Andy A 02 Feb 2015

Fight ! :D

posted by Martin Kojtal 02 Feb 2015

I might do a pull request to make it work like that, then it is more consistent :).

posted by Erik - 02 Feb 2015

myTicker.stop(); and myInterrupt.fall(stop); would be more consistent with Timer T1.stop(); ???

posted by Paul Staron 02 Feb 2015

Has anything changed or is there still no built in way to stop the interrupt from being generated on the hardware level?

posted by Krzysztof Sitko 22 Apr 2015

Nothing has changed yet, but the detach function still stops an interrupt from being generatrd on the hardware level.

posted by Erik - 23 Apr 2015