mrrwa / NmraDcc

NMRA Digital Command Control (DCC) Library
GNU Lesser General Public License v2.1
135 stars 53 forks source link

Pullup not enabled on ESP32 #43

Closed Jueff closed 3 years ago

Jueff commented 3 years ago

Enabling pullup for ExtIntPin fails with ESP32. Seems that old way to enable pullup by writing a 1 to the port doesn't work with ESP.

Changed code from

  pinMode( ExtIntPinNum, INPUT );
  if( EnablePullup )
    digitalWrite(ExtIntPinNum, HIGH);

to pinMode( ExtIntPinNum, EnablePullup ? INPUT_PULLUP : INPUT );

then it works.

kiwi64ajs commented 3 years ago

Hi Jueff,

Good spotting, I’ve committed that change and released an update to 2.0.6

Alex

On 19/10/2020, at 8:19 AM, Jueff notifications@github.com wrote:

Enabling pullup for ExtIntPin fails with ESP32. Seems that old way to enable pullup by writing a 1 to the port doesn't work with ESP.

Changed code from if( EnablePullup ) digitalWrite(ExtIntPinNum, HIGH); to pinMode( ExtIntPinNum, EnablePullup ? INPUT_PULLUP : INPUT );

then it works.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrrwa/NmraDcc/issues/43, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5Y53N57OAZC5IFEXHWYYLSLM5VPANCNFSM4SVJAHIQ.