Update
Dependencies: mbed mbed-rtos X_NUCLEO_IHM02A1
Diff: ST_SOLO.cpp
- Revision:
- 38:3776ee18e56f
- Parent:
- 37:a74d377d8f74
- Child:
- 39:6cc9a40bc8a6
diff -r a74d377d8f74 -r 3776ee18e56f ST_SOLO.cpp --- a/ST_SOLO.cpp Fri May 10 17:31:36 2019 +0000 +++ b/ST_SOLO.cpp Mon May 13 10:11:48 2019 +0000 @@ -67,11 +67,16 @@ int StatusSOLO=SOLO_DEFAULT; extern PwmOut Servo; -extern volatile bool buttonSTART_pressed; +/*extern volatile bool buttonSTART_pressed; extern volatile bool buttonSTART_enabled; extern volatile bool buttonAbbruch_pressed; -extern volatile bool buttonAbbruch_enabled; +extern volatile bool buttonAbbruch_enabled;*/ + +extern DigitalIn Button1; +extern DigitalIn Button2; + + extern DigitalIn LS_1; extern DigitalIn LS_2; @@ -96,6 +101,9 @@ int val_LS2 = 0; int val_LS3 = 0; +bool SOLOButtonSTART = false; +bool SOLOButtonABBRUCH = false; + int count = 0; @@ -103,8 +111,8 @@ void enable_Buttons() { - buttonSTART_enabled_cb(); - buttonAbbruch_enabled_cb(); + // buttonSTART_enabled_cb(); + //buttonAbbruch_enabled_cb(); } void entry_SOLO_DEFAULT() @@ -193,6 +201,9 @@ void EntrySOLO() { + + SOLOButtonSTART = get_Button_1(); + SOLOButtonSTART = get_Button_2(); switch(StatusSOLO) { case SOLO_DEFAULT: @@ -213,17 +224,21 @@ DisplaySendeString("Start PLA"); } - if(buttonAbbruch_pressed == true) { - buttonAbbruch_pressed = false; - buttonAbbruch_diable_cb(); + if(SOLOButtonSTART == true) { + + SOLOButtonSTART = false; + //buttonAbbruch_pressed = false; + //buttonAbbruch_diable_cb(); material = !material; } - if(buttonSTART_pressed == true) { - buttonSTART_pressed = false; - buttonSTART_diable_cb(); + if(SOLOButtonSTART == true) { + + SOLOButtonSTART = false; + //buttonSTART_pressed = false; + //buttonSTART_diable_cb(); //entry_SOLO_EinlegenOUT(); entry_SOLO_EinlegenIN(); } @@ -246,9 +261,10 @@ DisplaySendeString(" Abbruch"); - if(buttonAbbruch_pressed == true) { - buttonAbbruch_pressed = false; - buttonAbbruch_diable_cb(); + if(SOLOButtonSTART == true) { + SOLOButtonSTART = false; + //buttonAbbruch_pressed = false; + //buttonAbbruch_diable_cb(); entry_SOLO_DEFAULT(); } @@ -287,15 +303,17 @@ entry_SOLO_DEFAULT(); } - if(buttonAbbruch_pressed == true) { - buttonAbbruch_pressed = false; - buttonAbbruch_diable_cb(); + if(SOLOButtonSTART == true) { + SOLOButtonSTART = false; + //buttonAbbruch_pressed = false; + //buttonAbbruch_diable_cb(); entry_SOLO_DEFAULT(); } - if(buttonSTART_pressed == true) { - buttonSTART_pressed = false; - buttonSTART_diable_cb(); + if(SOLOButtonSTART == true) { + SOLOButtonSTART = false; + //buttonSTART_pressed = false; + //buttonSTART_diable_cb(); entry_SOLO_EinlegenOUT(); } @@ -310,9 +328,10 @@ gotoxy(1, 4); DisplaySendeString(" Abbruch"); - if(buttonAbbruch_pressed == true) { - buttonAbbruch_pressed = false; - buttonAbbruch_diable_cb(); + if(SOLOButtonSTART == true) { + SOLOButtonSTART = false; + //buttonAbbruch_pressed = false; + //buttonAbbruch_diable_cb(); entry_SOLO_DEFAULT(); } @@ -346,15 +365,17 @@ entry_SOLO_DEFAULT(); } - if(buttonAbbruch_pressed == true) { - buttonAbbruch_pressed = false; - buttonAbbruch_diable_cb(); + if(SOLOButtonSTART == true) { + SOLOButtonSTART = false; + //buttonAbbruch_pressed = false; + //buttonAbbruch_diable_cb(); entry_SOLO_DEFAULT(); } - if(buttonSTART_pressed == true) { - buttonSTART_pressed = false; - buttonSTART_diable_cb(); + if(SOLOButtonSTART == true) { + SOLOButtonSTART = false; + // buttonSTART_pressed = false; + // buttonSTART_diable_cb(); entry_SOLO_Spleissen(); } break;