Skip to content

Commit

Permalink
bug fix DigitalOut callback
Browse files Browse the repository at this point in the history
  • Loading branch information
cotestatnt committed Jun 7, 2023
1 parent 4660953 commit f2cc75d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DigitalOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void DigitalOut::set() {
if (m_isgpio)
digitalWrite(m_pin, m_activeLow ? LOW : HIGH);

if (!m_lastState)
if (!m_lastState && fn_rise != nullptr )
fn_rise();

m_state = true;
Expand All @@ -134,7 +134,7 @@ void DigitalOut::reset() {
if (m_isgpio)
digitalWrite(m_pin, m_activeLow ? HIGH : LOW);

if (m_lastState)
if (m_lastState && fn_fall != nullptr)
fn_fall();

m_state = false;
Expand Down

0 comments on commit f2cc75d

Please sign in to comment.