Skip to content

Auto-initialize hardware flow control for SerialN objects - #549

Open
mbedNoobNinja wants to merge 1 commit into
arduino:mainfrom
Vekatech:Auto-HW-Flow-Control-Init
Open

Auto-initialize hardware flow control for SerialN objects#549
mbedNoobNinja wants to merge 1 commit into
arduino:mainfrom
Vekatech:Auto-HW-Flow-Control-Init

Conversation

@mbedNoobNinja

Copy link
Copy Markdown

This PR adds automatic hardware flow control initialization for UART SerialN objects.

Previously, users had to manually construct a UART object to enable RTS/CTS:

UART BleSerial(
    UART2_TX_PIN,
    UART2_RX_PIN,
    UART2_RTS_PIN,
    UART2_CTS_PIN
);

void setup() {
    BleSerial.begin(115200);
}

void loop()
{
    ...
}

This is inconvenient because the board variant already defines the RTS and CTS pins.

With this change, calling

Serial2.begin(...);

automatically enables hardware flow control whenever both RTS and CTS pins are defined for the selected UART in pins_arduino.h. (I specifically, needed it for this board VK-RA4M2-NANO, on Serial2)

This keeps the API simple while preserving the existing behavior for boards that do not define hardware flow control pins.

@CLAassistant

CLAassistant commented Jul 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: code Related to content of the project itself type: enhancement Proposed improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants