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

Set __MODBUSMASTER_DEBUG__ to 0 by default #35

Closed
lrice opened this issue Aug 30, 2015 · 1 comment
Closed

Set __MODBUSMASTER_DEBUG__ to 0 by default #35

lrice opened this issue Aug 30, 2015 · 1 comment

Comments

@lrice
Copy link

lrice commented Aug 30, 2015

First off, great library and thanks for making it, overall I've been very happy with it and it has worked perfectly for my project.

However, these few lines were causing some odd behavior in my system that it took me a while to track down.

ModbusMaster.cpp lines 150-153:

#if __MODBUSMASTER_DEBUG__
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
#endif

The way I constructed my application is part of the reason it took a while, but generally I don't expect a library to change the state of pins in a hidden way. I recommend setting MODBUSMASTER_DEBUG to 0 by default, since if you intend to use the debugging features you will have no issue in enabling them, but most users will probably not be aware of this functionality and are more likely to be using digital pins 4 and 5.

If nothing else, it would be good to make the fact that this is enabled by default very obvious and mention it in the main README.

Thanks again for the library.

@kintel
Copy link
Contributor

kintel commented Sep 8, 2016

+1

Does it help if this is made a pull request so it can be accepted with one click?

@4-20ma 4-20ma added this to the 0.12.0 milestone Sep 10, 2016
@4-20ma 4-20ma closed this as completed in e768f39 Sep 11, 2016
4-20ma added a commit that referenced this issue Sep 11, 2016
Fix #35 - disable debug mode by default.
@4-20ma 4-20ma changed the title Default enabling of __MODBUSMASTER_DEBUG__ leads to unpredictable behavior in sketches, suggest setting to 0 by default Set __MODBUSMASTER_DEBUG__ to 0 by default Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants