Skip to content

Probable error in end function #29

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

Closed
fra87 opened this issue Sep 23, 2022 · 2 comments · Fixed by #33
Closed

Probable error in end function #29

fra87 opened this issue Sep 23, 2022 · 2 comments · Fixed by #33
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@fra87
Copy link
Contributor

fra87 commented Sep 23, 2022

Hello

While debugging an (unrelated) issue I had a look at the source code of the library and found this in the end function in RS485.cpp (line 75 and following):

  if (_rePin > -1) {
    digitalWrite(_rePin, LOW);
    pinMode(_dePin, INPUT);
  }
  
  if (_dePin > -1) {
    digitalWrite(_dePin, LOW);
    pinMode(_rePin, INPUT);
  }

I think the _dePin and _rePin in the pinMode functions are swapped.

I assume this is not a real issue, since not a lot of people would use the end function, but for completeness sake maybe it is to fix

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Sep 23, 2022
@facchinm
Copy link
Contributor

Hi @fra87 ,
thank you for finding the bug! Could you also submit a PR so we can give you proper attribution for the fix? Thanks!

fra87 added a commit to fra87/ArduinoRS485 that referenced this issue Dec 21, 2022
@fra87
Copy link
Contributor Author

fra87 commented Dec 21, 2022

Hello @facchinm
Sure, I just submitted PR #33 solving this issue

Best regards

@per1234 per1234 linked a pull request Dec 22, 2022 that will close this issue
@per1234 per1234 added the conclusion: resolved Issue was resolved label Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants