9 years, 4 months ago.

Detach method?

Is there an equivalent detach method that allows you to disable a MODSERIAL interrupt and detach the ISR you attached to it in the first place?

Question relating to:

Did you try attach(NULL); ?

posted by Andy A 12 Dec 2014

2 Answers

7 years, 10 months ago.

im also trying to find out if this is possible, for now I just attach it to a different function that does nothing. but not the best way to solve a problem like this

7 years, 10 months ago.

Hello,
If you would like just to detach your ISR then attach a 0 (or NULL), as suggested by Andy.

modserial.attach(0);


However, this will not disable the interrups (only no user ISR will be called from that moment on). If you'd like to disable interrupts, then I think you should call the disableIrq() member function.

can you give an example on how you would do that?

posted by ovi rahman 23 Jun 2016

Of what? Calling .disableIrq()? Which part are you struggling with?

Btw do remember that if you really disable the MOSERIAL irq, you disable the library effectively.

posted by Erik - 23 Jun 2016