aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-11-08 11:23:48 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-11-08 11:23:48 +0200
commite67d15360ce355ac9e675079cd5d6442e3fa1905 (patch)
tree4456bc96ff49b197f52af59afbb2e2b58de95f07 /Software/Embedded_SW/Embedded/Modules/Thread
parent8cae26aa5d465477a408500ae64f2afc05859a6a (diff)
downloadTango-e67d15360ce355ac9e675079cd5d6442e3fa1905.tar.gz
Tango-e67d15360ce355ac9e675079cd5d6442e3fa1905.zip
fix bugs
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new7
1 files changed, 7 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new
index ba4a5c8e0..f33a134e1 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.new
@@ -32,6 +32,7 @@ uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag);
uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue);
bool ScrewCurrentDirection = false; //holds current screw direction
+bool BusyfirstCall = true; //Ignores first call after activating the screw - too early
double ScrewSpeed = 0;
double ScrewRunningTime = 0;
bool ScrewDirection = false;
@@ -210,6 +211,12 @@ uint32_t ScrewDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
{
uint32_t Steps;
double temp;
+ if (BusyfirstCall)
+ {
+ BusyfirstCall = false;
+ DirectionChangeCounter++;
+ return OK;
+ }
//ScrewCurrentDirection: false moves out, true moves home
if (BusyFlag == NOTBUSY)
{