Skip to content

Conversation

@WillB97
Copy link
Contributor

@WillB97 WillB97 commented Aug 6, 2024

No description provided.

Copy link
Member

@RealOrangeOne RealOrangeOne left a comment

Choose a reason for hiding this comment

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

Change looks good in principle, just a nit comment

Comment on lines +130 to +137
if (mode != OUTPUT) {
if (mode == INPUT) {
Serial.print("NACK:Digital write is not supported in INPUT\n");
} else {
Serial.print("NACK:Digital write is not supported in INPUT_PULLUP\n");
}
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Remove the outer if to make it clearer what's happening.

Same below.

Suggested change
if (mode != OUTPUT) {
if (mode == INPUT) {
Serial.print("NACK:Digital write is not supported in INPUT\n");
} else {
Serial.print("NACK:Digital write is not supported in INPUT_PULLUP\n");
}
return;
}
if (mode == INPUT) {
Serial.print("NACK:Digital write is not supported in INPUT\n");
return;
} else if (mode == INPUT_PULLUP) {
Serial.print("NACK:Digital write is not supported in INPUT_PULLUP\n");
return;
}

@WillB97 WillB97 requested a review from 8BitJosh August 30, 2024 20:07
@WillB97 WillB97 linked an issue Aug 30, 2024 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Validate pin mode on reads and writes

3 participants