Skip to content

Commit

Permalink
Merge pull request #722 from Lamnxzp/fix
Browse files Browse the repository at this point in the history
Fix back button on cplus1_1
  • Loading branch information
pr3y authored Jan 29, 2025
2 parents 494192d + db8d23a commit d5dd94c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions boards/m5stack-cplus1_1/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ void _setBrightness(uint8_t brightval) {
** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress
**********************************************************************/
void InputHandler(void) {
if(digitalRead(UP_BTN)==LOW || digitalRead(SEL_BTN)==LOW || digitalRead(DW_BTN)==LOW) {
if(axp192.GetBtnPress() || digitalRead(SEL_BTN)==LOW || digitalRead(DW_BTN)==LOW) {
if(!wakeUpScreen()) AnyKeyPress = true;
else goto END;
}
if(digitalRead(UP_BTN)==LOW) {
if(axp192.GetBtnPress()) {
PrevPress = true;
EscPress = true;
}
Expand All @@ -58,7 +58,7 @@ void InputHandler(void) {
END:
if(AnyKeyPress) {
long tmp=millis();
while((millis()-tmp)<200 && (digitalRead(UP_BTN)==LOW || digitalRead(SEL_BTN)==LOW || digitalRead(DW_BTN)==LOW));
while((millis()-tmp)<200 && (axp192.GetBtnPress() || digitalRead(SEL_BTN)==LOW || digitalRead(DW_BTN)==LOW));
}
}

Expand Down

0 comments on commit d5dd94c

Please sign in to comment.