Skip to content

Commit c610e1d

Browse files
committed
Alt button bugfix
1 parent 16dd672 commit c610e1d

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

arduino-nixie/input.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ void initInputs(){
6969
//TODO are there no "loose" pins left floating after this? per https://electronics.stackexchange.com/q/37696/151805
7070
#ifdef INPUT_BUTTONS
7171
pinMode(CTRL_SEL, INPUT_PULLUP);
72-
#if CTRL_ALT>0
72+
if(CTRL_ALT>0){ //preprocessor directives don't seem to work for this when e.g. "A7"
7373
pinMode(CTRL_ALT, INPUT_PULLUP);
74-
#endif
74+
}
7575
#ifdef INPUT_UPDN_BUTTONS
7676
pinMode(CTRL_UP, INPUT_PULLUP);
7777
pinMode(CTRL_DN, INPUT_PULLUP);
@@ -198,15 +198,6 @@ void checkRot(){
198198
} //end checkRot()
199199
#endif
200200

201-
bool checkForHeldButtonAtStartup(){
202-
//This is a bit outside the standard ctrlEvt functionality due to happening at startup
203-
bool ret = readBtn(CTRL_SEL);
204-
//prevent the held button from doing anything else, if applicable
205-
//TODO expand this so short and long hold can happen at startup
206-
inputCur = CTRL_SEL; inputStop();
207-
return ret;
208-
}
209-
210201
void checkInputs(){
211202
//TODO potential issue: if user only means to rotate or push encoder but does both?
212203
#ifdef INPUT_IMU
@@ -216,9 +207,9 @@ void checkInputs(){
216207
//We just need to only call checkBtn if one or the other is equipped
217208
#if defined(INPUT_BUTTONS) || defined(INPUT_IMU)
218209
checkBtn(CTRL_SEL);
219-
#if CTRL_ALT>0
210+
if(CTRL_ALT>0){ //preprocessor directives don't seem to work for this when e.g. "A7"
220211
checkBtn(CTRL_ALT);
221-
#endif
212+
}
222213
#if defined(INPUT_UPDN_BUTTONS) || defined(INPUT_IMU)
223214
checkBtn(CTRL_UP);
224215
checkBtn(CTRL_DN);

0 commit comments

Comments
 (0)