added debug code

This commit is contained in:
Ronald Schaten 2022-02-01 15:59:21 +01:00
parent c0de734b03
commit 029dfb5e34

View File

@ -62,10 +62,20 @@ State state = STATE_MENU;
// === // ===
result enter_jog() {
lcd.setCursor(0, 0);
lcd.print("Jogging... ");
lcd.setCursor(0, 1);
lcd.print("[sel] to exit ");
Serial.println("enter_jog()");
state = STATE_JOG;
return proceed;
}
MENU(mainMenu, "Main menu", doNothing, noEvent, wrapStyle MENU(mainMenu, "Main menu", doNothing, noEvent, wrapStyle
,OP("Sub1", doNothing, noEvent) ,OP("Sub1", doNothing, noEvent)
,OP("Sub2", doNothing, noEvent) ,OP("Sub2", doNothing, noEvent)
,OP("Sub3", doNothing, noEvent) ,OP("Jog", enter_jog, enterEvent)
//,EXIT("<Back") //,EXIT("<Back")
); );
@ -84,6 +94,7 @@ void ButtonHandler(const ButtonParam& param) {
Serial.print(" "); Serial.print(" ");
switch (state) { switch (state) {
case STATE_MENU: case STATE_MENU:
Serial.print("menu - ");
switch (param.state) { switch (param.state) {
case ButtonState_Click: case ButtonState_Click:
Serial.print("Click"); Serial.print("Click");
@ -107,6 +118,7 @@ void ButtonHandler(const ButtonParam& param) {
} }
break; break;
case STATE_JOG: case STATE_JOG:
Serial.print("jogging - ");
switch (param.state) { switch (param.state) {
case ButtonState_Up: case ButtonState_Up:
Serial.print("Up"); Serial.print("Up");