Hello All,
I'm looking to create my own UART interrupt. For those who need to know why it's because I need to stop the timer as soon as a value comes in. While I know I will get a lot of reasons and explanations why this is not necessary I'm a lot more interested in how to go about doing this.
I have to commented out
void SERCOM5_Handler()
{
Serial1.IrqHandler();
}
in the variant.cpp file which works to remove the Arduino code from doing what it wants. The issue I'm having now is finding the function Serial.read(). I'm trying to read the uart rx buffer but with Atmel's documentation what it is this is not as easy as it should be.
I have tried
void SERCOM5_Handler()
{
char temp = SERCOM5->USART.DATA.reg;
if (temp == 'h' || temp == 'H'){
digitalWrite(LED_BUILTIN, HIGH);
}
if (temp == 'l' || temp == 'L'){
digitalWrite(LED_BUILTIN, LOW);
}
}
without much success. Therefore any help in reading the UART rx register would be very much appreciated.
Kas