8 years, 6 months ago.

Disable SoftSerial Interrupt

You can enable Serial or SoftSerial with:

code snippet 1

serialDevice.attach(&rxInterrupt,Serial::RxIrq); //or
serialDevice.attach(&rxInterrupt,SoftSerial::RxIrq);


Then, you can disable the interrupt in Serial with:

code snippet 2

NVIC_DisableIRQ(USART2_IRQn);


But, how do you that with SoftSerial?
How do you disable SoftSerial Interrupt?
What reference should I point to?

Thanks for your time

Question relating to:

Software serial, for when you are out of serial pins

1 Answer

8 years, 6 months ago.

Currently it is not possible to disable the internal interrupts used for SoftSerial: The result would be that it stops functioning properly, since contrary to normal Serial, it requires interrupts to receive/transmit data.

However if you just want to disable interrupts going to your program, use:

serialDevice.attach(NULL,SoftSerial::RxIrq);

That should work.

Accepted Answer