aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-10-28 11:32:07 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-10-28 11:32:07 +0200
commit4973c8ff53c8758852f707af5cc7f4a6a82151e0 (patch)
tree591862014f96dadcf7e009ccad9bc4e671b7a382 /Software/Embedded_SW/Embedded/Modules/Thread
parent40a06a448d838e62d75694a3a6227c67a1ce5fdf (diff)
parentf0d41b9666c4c2289b7456e17d697334117557bd (diff)
downloadTango-4973c8ff53c8758852f707af5cc7f4a6a82151e0.tar.gz
Tango-4973c8ff53c8758852f707af5cc7f4a6a82151e0.zip
MERGE!
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c14
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c10
2 files changed, 6 insertions, 18 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index effa8b2c7..eb04cadaf 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -8,8 +8,6 @@
#include "thread.h"
#include "drivers/Motors/Motor.h"
-#include <drivers/FPGA/FPGA_INTERRUPTS/fpga_interrupts.h>
-
#include "StateMachines/Printing/PrintingSTM.h"
#include "Modules/Control/Control.h"
#include "Modules/Control/MillisecTask.h"
@@ -23,8 +21,6 @@
#include "drivers/FPGA/FPGA_SPI_Comm.h"
#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"
-
-
bool Winder_ScrewHoming = false;
//bool Winder_Active = false;
@@ -132,7 +128,7 @@ uint32_t Winder_ScrewAtOffsetCallback(uint32_t deviceID, uint32_t BusyFlag)
ScrewNumberOfSteps = 0;
DirectionChangeCounter = 0;
REPORT_MSG(BusyFlag, "Winder_ScrewAtOffsetCallback");
- //Screw_Interrupt(true,ScrewFreeInterrupt);
+
PrepareReady(Module_Winder, ModuleDone);
return OK;
}
@@ -263,13 +259,6 @@ uint32_t ScrewDirectionChange(uint32_t deviceID, uint32_t BusyFlag)
MotorMove (HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewCurrentDirection,Steps); //process: set point 0, set max speed, move to the specified length, return back.
REPORT_MSG(ScrewCurrentDirection, "ScrewDirectionChange");
}
-/*
- * calculate new ScrewSpeed and call MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_SCREW,ScrewSpeed);
- *
- */
- /*
- * calculate cone shape according to DirectionChangeCounter and update ScrewNumberOfSteps
- */
return OK;
}
@@ -342,7 +331,6 @@ uint32_t Winder_End(void)
RemoveControlCallback(ScrewControlId,ScrewDirectionChange);
CurrentControlledSpeed[SCREW_MOTOR] = 0;
pend = MillisecFlushMsgQ(HARDWARE_MOTOR_TYPE__MOTO_SCREW);
- //Screw_Interrupt(false,NULL);
return MotorStop (HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz);
}
void Winder_ScrewHomeLimitSwitchInterrupt(void)
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index ec2ba407a..6c58e1645 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -201,7 +201,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue)
}
}
- if (CurrentProcessedLength>=CurrentRequestedLength )
+ if ((CurrentProcessedLength>=CurrentRequestedLength )&&(CurrentRequestedLength > 0.0))
{
usnprintf(Lenstr, 100, "Total processed length: Feeder: %d Pooler %d",(int)TotalProcessedLength,(int)PoolerTotalProcessedLength);
SendJobProgress(0.0,0,false, Lenstr);
@@ -467,17 +467,17 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
calculated_speed = (1-MotorControlConfig[index].m_calculatedError)*OriginalMotorSpd_2PPS[index];
if (abs(calculated_speed-CurrentControlledSpeed[index])>2)
{
- /*if (keepdata == true)
+ if (keepdata == true)
{
- calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError;
+ /* calculatedError[controlIndex] = MotorControlConfig[index].m_calculatedError;
MotorId[controlIndex] = index;
readValue[controlIndex] = ReadValue;
AveragereadValue[controlIndex] = avreageSampleValue;
calculatedspeed[controlIndex] = calculated_speed;
timestamp[controlIndex] = HibernateRTCSSGet();
if (controlIndex++>=999)
- controlIndex = 0;
- }*/
+ controlIndex = 0;*/
+ }
CurrentControlledSpeed[index] = calculated_speed;
MotorSetSpeed(ThreadMotorIdToMotorId[index], calculated_speed);
}