Skip to content

Commit

Permalink
Merge pull request #645 from bmorcelli/input_task
Browse files Browse the repository at this point in the history
Inputs in dedicated Task
  • Loading branch information
pr3y authored Jan 3, 2025
2 parents fe6bcd0 + 9d781d7 commit 3e99279
Show file tree
Hide file tree
Showing 360 changed files with 1,015 additions and 1,726,188 deletions.
537 changes: 34 additions & 503 deletions boards/CYD-2432S028/interface.cpp

Large diffs are not rendered by default.

48 changes: 3 additions & 45 deletions boards/ESP-General/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,52 +28,10 @@ void _setBrightness(uint8_t brightval) { }


/*********************************************************************
** Function: checkNextPress
** location: mykeyboard.cpp
** Verifies Upper Btn to go to previous item
**********************************************************************/
bool checkNextPress(){ return false; }


/*********************************************************************
** Function: checkPrevPress
** location: mykeyboard.cpp
** Verifies Down Btn to go to next item
**********************************************************************/
bool checkPrevPress() { return false; }


/*********************************************************************
** Function: checkSelPress
** location: mykeyboard.cpp
** Verifies if Select or OK was pressed
** Function: InputHandler
** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress
**********************************************************************/
bool checkSelPress(){ return false; }


/*********************************************************************
** Function: checkEscPress
** location: mykeyboard.cpp
** Verifies if Escape btn was pressed
**********************************************************************/
bool checkEscPress(){ return false; }


/*********************************************************************
** Function: checkAnyKeyPress
** location: mykeyboard.cpp
** Verifies id any of the keys was pressed
**********************************************************************/
bool checkAnyKeyPress() { return false; }


/*********************************************************************
** Function: keyboard
** location: mykeyboard.cpp
** Starts keyboard to type data
**********************************************************************/
String keyboard(String mytext, int maxSize, String msg) { }

void InputHandler(void) { }

/*********************************************************************
** Function: powerOff
Expand Down
79 changes: 32 additions & 47 deletions boards/_New-Device-Model/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,43 +33,39 @@ void _setBrightness(uint8_t brightval) { }


/*********************************************************************
** Function: checkNextPress
** location: mykeyboard.cpp
** Verifies Upper Btn to go to previous item
**********************************************************************/
bool checkNextPress(){ return false; }


/*********************************************************************
** Function: checkPrevPress
** location: mykeyboard.cpp
** Verifies Down Btn to go to next item
**********************************************************************/
bool checkPrevPress() { return false; }


/*********************************************************************
** Function: checkSelPress
** location: mykeyboard.cpp
** Verifies if Select or OK was pressed
** Function: InputHandler
** Handles the variables PrevPress, NextPress, SelPress, AnyKeyPress and EscPress
**********************************************************************/
bool checkSelPress(){ return false; }


/*********************************************************************
** Function: checkEscPress
** location: mykeyboard.cpp
** Verifies if Escape btn was pressed
**********************************************************************/
bool checkEscPress(){ return false; }


/*********************************************************************
** Function: checkAnyKeyPress
** location: mykeyboard.cpp
** Verifies id any of the keys was pressed
**********************************************************************/
bool checkAnyKeyPress() { return false; }
void InputHandler(void) {
checkPowerSaveTime();
PrevPress = false;
NextPress = false;
SelPress = false;
AnyKeyPress = false;
EscPress = false;

if(false /*Conditions fot all inputs*/) {
if(!wakeUpScreen()) AnyKeyPress = true;
else goto END;
}
if(false /*Conditions for previous btn*/) {
PrevPress = true;
}
if(false /*Conditions for Next btn*/) {
NextPress = true;
}
if(false /*Conditions for Esc btn*/) {
EscPress = true;
}
if(false /*Conditions for Select btn*/) {
SelPress = true;
}
END:
if(AnyKeyPress) {
long tmp=millis();
while((millis()-tmp)<200 && false /*Conditions fot all inputs*/);
}
}


/*********************************************************************
Expand All @@ -95,17 +91,6 @@ void powerOff() { }
**********************************************************************/
void checkReboot() { }


/*********************************************************************
** Function: _checkKeyPress
** location: mykeyboard.cpp
** returns the key from the keyboard
**********************************************************************/
keyStroke _getKeyPress() {
keyStroke key;
return key;
} // must return something that the keyboards won´t recognize by default

/*********************************************************************
** Function: _checkNextPagePress
** location: mykeyboard.cpp
Expand Down
Loading

0 comments on commit 3e99279

Please sign in to comment.