Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 4 months ago.
Modserial & interrupts
Hi everyone, I need help with interrupts while using modserial.
The problem I am having is it appears NVIC_DisableIRQ(UART1_IRQn); && NVIC_EnableIRQ(UART1_IRQn); are not disabling/enabling the interrupts. I have also tried: disable_interrupt() enable_interrupt()
Specifically when I call the disableIRQ and transmit over serial I am capturing the talk back from my own Tx. This intern is causing another IRQ RX call and I get stuck in a forever loop of the same data transmitted over and over.
line.attach(&txCallback, MODSERIAL::TxIrq); line.attach(&rxCallback, MODSERIAL::RxIrq); line.attach(&txEmpty, MODSERIAL::TxEmpty);
I notice the documentation shows SERIAL instead of MODSERIAL in the attach. I am wondering if this is the cause of the IRQ not disabling.
I also tried uart1-3 with no luck based on this post: https://developer.mbed.org/questions/135/UART-and-pins/
So what do you do when you are transmitting a 5 to 10 bytes and do not want to receive your own transmission? Is there a way to only disable the Rx interrupt? Not sure if this is needed since the line is only half duplex but just a thought.