Skip to content

Fix reset to use system definition of digital write #15

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

Merged
merged 1 commit into from
Apr 4, 2022
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
12 changes: 6 additions & 6 deletions src/SparkFunSX1509.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ void SX1509::reset(bool hardware)
writeByte(REG_MISC, regMisc);
}
// Reset the SX1509, the pin is active low
pinMode(pinReset, OUTPUT); // set reset pin as output
digitalWrite(pinReset, LOW); // pull reset pin low
::pinMode(pinReset, OUTPUT); // set reset pin as output
::digitalWrite(pinReset, LOW); // pull reset pin low
delay(1); // Wait for the pin to settle
digitalWrite(pinReset, HIGH); // pull reset pin back high
::digitalWrite(pinReset, HIGH); // pull reset pin back high
}
else
{
Expand Down Expand Up @@ -506,10 +506,10 @@ void SX1509::sync(void)
}

// Toggle nReset pin to sync LED timers
pinMode(pinReset, OUTPUT); // set reset pin as output
digitalWrite(pinReset, LOW); // pull reset pin low
::pinMode(pinReset, OUTPUT); // set reset pin as output
::digitalWrite(pinReset, LOW); // pull reset pin low
delay(1); // Wait for the pin to settle
digitalWrite(pinReset, HIGH); // pull reset pin back high
::digitalWrite(pinReset, HIGH); // pull reset pin back high

// Return nReset to POR functionality
writeByte(REG_MISC, (regMisc & ~(1 << 2)));
Expand Down