diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-02-19 10:32:48 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-02-19 10:32:48 +0200 |
| commit | 685b1da155bda741a3378a1c19a04ffd110a0a33 (patch) | |
| tree | e38a3740bf4727dfa9368c6010c6cd55d6910ffb /Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | |
| parent | 94fccc66fd2b8b6aed1371546dfd8cef68d5e60d (diff) | |
| parent | bb51ac752b58b3d64e86a8150e7a9b1f5749e379 (diff) | |
| download | Tango-685b1da155bda741a3378a1c19a04ffd110a0a33.tar.gz Tango-685b1da155bda741a3378a1c19a04ffd110a0a33.zip | |
merge conflict
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index fd48e799a..1dd101f82 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -28,6 +28,7 @@ #include "drivers/Heater/Heater.h" #include "drivers/Motors/Motor.h" #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" +#include "drivers/FPGA/FPGA_SPI_Comm.h" #include "modules/heaters/heaters.h" #include "modules/General/process.h" #include "modules/ids/ids_ex.h" @@ -117,8 +118,8 @@ uint32_t Control_Delta_Position_Pass(uint32_t Current_Read,uint32_t Previous_Rea if (Current_Read < Previous_Read) { - ReportWithPackageFilter(ThreadFilter,"Length rollover",__FILE__,__LINE__,(int)Current_Read,RpWarning,(int)Previous_Read,0); Time_Pass = (MAX_COUNTER - Previous_Read) + Current_Read + 1; + ReportWithPackageFilter(ThreadFilter,"Length rollover",__FILE__,Time_Pass,(int)Current_Read,RpWarning,(int)Previous_Read,0); } else Time_Pass = Current_Read - Previous_Read; @@ -178,7 +179,10 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) initialpos = 0; } prevprev = PreviousPosition; - positionDiff = Control_Delta_Position_Pass(CurrentPosition,PreviousPosition); + if (Extended_Motor_Param[ThreadMotorIdToMotorId[index]] == true) //powerstep driver reverses the direction + positionDiff = Control_Delta_Position_Pass(PoolerPreviousPosition,PoolerCurrentPosition); + else + positionDiff = Control_Delta_Position_Pass(PoolerCurrentPosition,PoolerPreviousPosition); //positionDiff = positionDiff / MotorsCfg[ThreadMotorIdToMotorId[index]].microstep; PreviousPosition = CurrentPosition; @@ -268,7 +272,10 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) Poolerinitialpos = 0; } prevprev = PoolerPreviousPosition; - positionDiff = Control_Delta_Position_Pass(PoolerCurrentPosition,PoolerPreviousPosition); + if (Extended_Motor_Param[ThreadMotorIdToMotorId[index]] == true) //powerstep driver reverses the direction + positionDiff = Control_Delta_Position_Pass(PoolerPreviousPosition,PoolerCurrentPosition); + else + positionDiff = Control_Delta_Position_Pass(PoolerCurrentPosition,PoolerPreviousPosition); //positionDiff = positionDiff / MotorsCfg[ThreadMotorIdToMotorId[index]].microstep; PoolerPreviousPosition = PoolerCurrentPosition; |
