controlling Arduino Due UART/USART interrupt

498 views
Skip to first unread message

Ricardo Crudo

unread,
Apr 3, 2015, 2:01:26 PM4/3/15
to devel...@arduino.cc
I'd like to control by myself the UART/USART interrupt of Arduino. I can't find a way to do it without change the Arduino hardware code. Thus I'd like to suggest to declare the UART/USART Handler as a weak attribute.

void UART_Handler(void)  __attribute__((weak));
void UART_Handler(void)
{
 
Serial.IrqHandler();
}


In this way the user have the possibility to make it own handler without any charge to the regular use of the library. I can submit if you enjoy the idea.

I've suggested this to Due, but should be great have this working for all Arduinos.

Ricardo Crudo

unread,
Apr 13, 2015, 4:53:25 PM4/13/15
to devel...@arduino.cc
bump

--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.

Collin Kidder

unread,
Apr 14, 2015, 9:12:41 AM4/14/15
to developers
I don't see this as being a bad idea. The current interrupt routine
does what most people would need but it is insufficient if you need to
do anything custom. For instance, the Serial ports on the Due can
implement LIN. But, the Arduino core has no ability to do this so even
if you access the registers to place the port into LIN mode you
currently cannot change the ISR to match what you need to do. So, yes,
this seems like a good idea.
Reply all
Reply to author
Forward
0 new messages