Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/2.x] fix(uart): Set back Pin signal polarity #9952

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

SuGlider
Copy link
Collaborator

Description of Change

Backport to release/v2.x branch

Fixes a problem related to inverting signal polarity back to normal after a previous inversion.
This shall set the correct polarity in Serial.begin().

Tests scenarios

#include <Arduino.h>
#include <HardwareSerial.h>

HardwareSerial serial(0);   // use serial(1) for comparison

void setup() {}

void loop() {
  serial.begin(115200, SERIAL_8N1, 3, 1, false);
  serial.write("hello");
  serial.flush();
  serial.end();

  serial.begin(115200, SERIAL_8N1, 3, 1, true);
  serial.write("hello");
  serial.flush();
  serial.end();
}

Related links

Fix #9896

Fixes a problem related to inverting signal polarity back to normal after a previous inversion.

This shall set the correct polarity in Serial.begin().
@SuGlider SuGlider self-assigned this Jun 28, 2024
@SuGlider SuGlider added this to the 2.0.17 milestone Jun 28, 2024
@SuGlider SuGlider linked an issue Jun 28, 2024 that may be closed by this pull request
1 task
Copy link

@mha1 mha1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while you're at it, can you please remove this comment in both PRs:
// Is it right or the idea is to swap rx and tx pins?

Removes a commentary with a question about the inversing polarity function.
Copy link

@mha1 mha1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuGlider PTAL.

cores/esp32/esp32-hal-uart.c Outdated Show resolved Hide resolved
Co-authored-by: Jan Procházka <[email protected]>
@P-R-O-C-H-Y P-R-O-C-H-Y added the Status: Pending Merge Pull Request is ready to be merged label Jul 1, 2024
@me-no-dev me-no-dev merged commit 33c9552 into release/v2.x Jul 1, 2024
43 checks passed
@me-no-dev me-no-dev deleted the suglider_uart_invert_polarity_2.x branch July 1, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

invert status never reset on serial0 after having been set to invert once
4 participants