Skip to content

Modify default ISR handling in Serial library (HardwareSerial.cpp) #1487

Closed
@pabloxid

Description

@pabloxid

Years ago I developed a library for Dynmamixel motors (AX12, AX18, RX24F, MX28, etc. http://www.pablogindel.com/2010/01/biblioteca-de-arduino-para-ax-12 ).

These motors work with 1 Mbps serial connection. My library is based on the original Arbotix library, and has a custom ISR (RX_VECT) handler, ie not using HardwareSerial.cpp.

On boards with multiple UARTs (such as Mega2560, etc.), it would be good to use 1 UART for the Dynamixel motors, and the remaining UARTs with Arduino Serial library. But this is not possible, because HardwareSerial.cpp appropriates all the 4 UARTs ISRs, even if only one serial port is actually used.

It would be nice that HardwareSerial.cpp will declare the ISR only for the ports that have been initialized with Serial.begin (), or that Serial objects were not pre-instantiated, or whatever else that allows to declare an ISR (RX_VECT) for a UART that is not in use by the library, and then use it to control Dynamixel motors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreRelated to the code for the standard Arduino API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions