Skip to content

Commit c60c486

Browse files
Fix missing pull-down on OBS Pro and remove double button pin initialization
1 parent 7a07702 commit c60c486

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/OpenBikeSensorFirmware.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ void setup() {
237237
// Configure button pin as INPUT
238238
//##############################################################
239239

240-
pinMode(PUSHBUTTON_PIN, INPUT);
241240
pinMode(IP5306_BUTTON, OUTPUT);
242241
digitalWrite(IP5306_BUTTON, LOW);
243242
pinMode(BatterieVoltage_PIN, INPUT);

src/utils/button.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "variant.h"
2727

2828
Button::Button(int pin) : mPin(pin) {
29-
pinMode(pin, INPUT);
29+
pinMode(pin, INPUT_PULLDOWN);
3030
mLastStateChangeMillis = mLastRawReadMillis = millis();
3131
mLastState = mLastRawState = read();
3232
}

0 commit comments

Comments
 (0)