Skip to content

[Request] Add "weak" attribute to UART interrupt in HardwareSerial #378

Open
@thorv

Description

@thorv

I want to use hardware flow control for AVR Serial.I think I can do it by inspecting RTS/CTS pins in the transmit/receive interrupt routine, but I can't override the interrupt routine because it is defined in HardwareSerialN.cpp as follows.

#if defined(USART_RX_vect)
  ISR(USART_RX_vect)
#elif defined(USART0_RX_vect)
  ISR(USART0_RX_vect)
#elif defined(USART_RXC_vect)
  ISR(USART_RXC_vect) // ATmega8.
#else.
  #error "Don't know what the Data Received vector is called for Serial."
#endif
  {
    Serial._rx_complete_irq();
  }

If we change this to the following, we can override the interrupts without affecting the existing usage.

ISR( vector, __attribute__((weak)) )
{
  //behavior
}

I hope you'll consider changing this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions