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

Add config parameter to RS485 initialization #27

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

svollenweider
Copy link

@svollenweider svollenweider commented Jan 3, 2025

Dear all

I recently updated my projects to the new repository. When using RS485, I noticed that there is no option to set the UART Config. This PR adds this option back in.

Copy link
Contributor

@leonardocavagnis leonardocavagnis left a comment

Choose a reason for hiding this comment

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

Thanks for contributing! 😄
This should resolve the compilation issue.

Could you please also update the RS485_fullduplex and RS485_halfduplex examples to include the config parameter?

@@ -17,7 +17,7 @@ RS485CommClass::RS485CommClass(arduino::UART& uart_itf, PinName rs_tx_pin, PinNa
RS485CommClass::~RS485CommClass()
{ }

void RS485CommClass::begin(unsigned long baudrate, int predelay, int postdelay) {
void RS485CommClass::begin(unsigned long baudrate, uint16_t config = SERIAL_8N1, int predelay, int postdelay) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void RS485CommClass::begin(unsigned long baudrate, uint16_t config = SERIAL_8N1, int predelay, int postdelay) {
void RS485CommClass::begin(unsigned long baudrate, uint16_t config, int predelay, int postdelay) {

@leonardocavagnis leonardocavagnis changed the title Allow for Config of RS485 again Add config parameter to RS485 initialization Jan 7, 2025
@leonardocavagnis leonardocavagnis added type: enhancement Proposed improvement status: changes requested Changes to PR are required before merge topic: code Related to content of the project itself labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: changes requested Changes to PR are required before merge 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.

2 participants