Skip to content

minor issue: "TOGGLE" is not defined from the PinStatus enum values... #4

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
WestfW opened this issue Nov 2, 2018 · 0 comments
Closed

Comments

@WestfW
Copy link
Contributor

WestfW commented Nov 2, 2018

I see that digitalWrite() has added a "TOGGLE" option, which is currently defined in Arduino.h:
#define TOGGLE 2
However, that argument is defined as a PinStatus enum, and using toggle in a program results in a warning:

/Volumes/MacOS/HD-Users/BillW/Documents/Arduino/-test-/test_togglespeed_digitalWrite/test_togglespeed_digitalWrite.ino:46:29: warning: invalid conversion from 'int' to 'PinStatus' [-fpermissive]
     digitalWrite(PIN, TOGGLE);
                             ^

TOGGLE should be defined as a member of the enum instead:
#define TOGGLE CHANGE

(separately, I'm a little uncomfortable about the use of the PinStatus type for digitalRead and digitalWrite, but that's a separate issue.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant