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

Removed code that prevented GPIO 0 From being used as a relay port. #381

Merged
merged 1 commit into from
Oct 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions ESPixelStick/src/output/OutputRelay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,7 @@ bool c_OutputRelay::validate ()
SetOutputBufferSize (Num_Channels);
for (RelayChannel_t & currentRelay : OutputList)
{
if (currentRelay.GpioId == Relay_DEFAULT_GPIO_ID)
{
// pinMode (currentRelay.GpioId, INPUT);
currentRelay.Enabled = Relay_OUTPUT_DISABLED;
}

else if (currentRelay.Enabled)
if (currentRelay.Enabled)
{
pinMode (currentRelay.GpioId, OUTPUT);
}
Expand Down Expand Up @@ -219,11 +213,10 @@ bool c_OutputRelay::SetConfig (ArduinoJson::JsonObject & jsonConfig)
setFromJSON (temp, JsonChannelData, CN_gid);
// DEBUGV (String ("temp: ") + String (temp));

if ((temp != CurrentOutputChannel->GpioId) &&
(Relay_DEFAULT_GPIO_ID != CurrentOutputChannel->GpioId))
if (temp != CurrentOutputChannel->GpioId)
{
// DEBUGV ("Revert Pin to input");
// The pin has changed and the original pin was not the default pin
// The pin has changed. Let go of the old pin
pinMode (CurrentOutputChannel->GpioId, INPUT);
}
CurrentOutputChannel->GpioId = (gpio_num_t)temp;
Expand Down