aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
authorShai Frieder <Shai.Frieder@twine-s.com>2019-09-22 14:10:25 +0300
committerShai Frieder <Shai.Frieder@twine-s.com>2019-09-22 14:10:25 +0300
commit3cbfa58f4a68e778b84124ae2f6d3d4d0d32e64c (patch)
treee56fc06bff92597cfdd1c1077ca207b5b5445a11 /Software/Embedded_SW/Embedded/Modules
parent6715e2fccbfb38f803d5cf5e2e98377a47340582 (diff)
downloadTango-3cbfa58f4a68e778b84124ae2f6d3d4d0d32e64c.tar.gz
Tango-3cbfa58f4a68e778b84124ae2f6d3d4d0d32e64c.zip
fix press 4 times Load Thred
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/buttons.c20
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c2
2 files changed, 15 insertions, 7 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.c b/Software/Embedded_SW/Embedded/Modules/General/buttons.c
index 2e6d7e3b5..e691cad69 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/buttons.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.c
@@ -149,7 +149,7 @@ uint32_t ButtonLoadCallBackFunction(uint32_t IfIndex, uint32_t ReadValue)
//uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 );
//Power_Reset()// Resets the MCU
-#define BUTTOMS_SAMPLE_TIME 50
+#define BUTTONS_SAMPLE_TIME (eTenMillisecond*50)
uint32_t Buttons_Init(void)
{
@@ -160,7 +160,7 @@ uint32_t Buttons_Init(void)
power.state = sttON; //sttOFF, sttON, sttDISABLE, sttENABLE, sttIDLE, sttJOGGING
power.count = 0;
- AddControlCallback( ButtonPowerCBFunction, BUTTOMS_SAMPLE_TIME, ButtonPowerCallBackFunction, 0,0,0 ); // eFiftyMillisecond
+ AddControlCallback( ButtonPowerCBFunction, BUTTONS_SAMPLE_TIME, ButtonPowerCallBackFunction, 0,0,0 ); // eFiftyMillisecond
strcpy(jog.bttn_name, "jog");
jog.bttn_status = release; // 0=release 1=press
@@ -169,7 +169,7 @@ uint32_t Buttons_Init(void)
jog.state = sttENABLE; // sttDISABLE, sttENABLE, sttJOGGING
jog.count = 0;
- AddControlCallback( ButtonJogCBFunction, BUTTOMS_SAMPLE_TIME, ButtonJogCallBackFunction, 0,0,0 ); //
+ AddControlCallback( ButtonJogCBFunction, BUTTONS_SAMPLE_TIME, ButtonJogCallBackFunction, 0,0,0 ); //
strcpy(load.bttn_name, "load");
load.bttn_status = release; // 0=release 1=press
@@ -178,7 +178,7 @@ uint32_t Buttons_Init(void)
load.state = sttRDY; //
load.count = 0;
- AddControlCallback( ButtonLoadCBFunction, BUTTOMS_SAMPLE_TIME, ButtonLoadCallBackFunction, 0,0,0 ); //
+ AddControlCallback( ButtonLoadCBFunction, BUTTONS_SAMPLE_TIME, ButtonLoadCallBackFunction, 0,0,0 ); //
return OK;
}
@@ -206,9 +206,16 @@ uint32_t ButtonLoadCBFunction(uint32_t IfIndex, uint32_t ReadValue)
{
uint8_t parameter = 2;
+ if ((load.bttn_status == press) && ( ReadValue == release ))
+ {
+ load.count=0;
+ REPORT_MSG(load.count," ------------ thread loading buttons is released ----------------- ");
+
+ }
+
if ((load.bttn_status == release) && (ReadValue == press))
{
- REPORT_MSG(parameter," ------------ Start thread loading empty function ----------------- ");
+ REPORT_MSG(load.count," ------------ thread loading buttons is pressed ----------------- ");
//load.bttn_status = press;
LoadStatMachine(&load);
load.count=1;
@@ -217,8 +224,9 @@ uint32_t ButtonLoadCBFunction(uint32_t IfIndex, uint32_t ReadValue)
{
if (load.count == LOADLONGPRESS) // todo
{
- //load.count = 0;
+ REPORT_MSG(load.count," ------------ thread loading buttons is pressed: LOADLONGPRESS ----------------- ");
LoadLongPress( &load );
+ load.count = 0;
}
else load.count++;
}
diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c
index 7796f09cf..f22ce46ac 100644
--- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_init.c
@@ -1231,7 +1231,7 @@ bool InitCartStatus()
}
else
{
- REPORT_MSG(parameter," ------------ INIT : WHS_waste1 cart is NOT presence_sensor !!! ----------------- ");
+ REPORT_MSG(parameter," ------------ INIT : WHS_waste2 cart is NOT presence_sensor !!! ----------------- ");
WHS_info.WHS_sensors.waste_cartridge2_precense_sensor = CarteidgeNotPrecense;
Pannel_Leds( CART_3, MODE_OFF);
cart3.color = colorOFF;