aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-08-10 00:25:19 +0300
committerShlomo Hecht <shlomo@twine-s.com>2020-08-10 00:25:19 +0300
commitee2c20c777478b178de879ff6c827fc90ed86e27 (patch)
tree3f7ff711c3de466905c38f9983927122830d5b73 /Software/Embedded_SW/Embedded
parent7df13a1ef1e22fcf61c316badc23dc593177ad01 (diff)
downloadTango-ee2c20c777478b178de879ff6c827fc90ed86e27.tar.gz
Tango-ee2c20c777478b178de879ff6c827fc90ed86e27.zip
logs, handle prepare counter
Diffstat (limited to 'Software/Embedded_SW/Embedded')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c10
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
index 03138399c..6e0deec97 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
@@ -190,7 +190,7 @@ uint32_t MotorMoveWithCallback (TimerMotors_t MotorId,bool direction, uint32_t S
//MotorStop(MotorId,Hard_Hiz );
MotorMove(MotorId,direction,Steps );
- MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,MotorId, MotorId, 0 );
MotorControlCallback[MotorId] = MotorMoveCallBackFunction;
return MotorControlId[MotorId];
}
@@ -439,12 +439,13 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO
{
uint32_t MotorId;
uint32_t Busy = BusyFlag;
- if (IfIndex>>8 != IfTypeMotors)
+ /*if (IfIndex>>8 != IfTypeMotors)
{
LOG_ERROR (IfIndex, "Wrong Interface type");
return 0xFFFFFFFF;
- }
+ }*/
+ MotorId = IfIndex;
CallbackCalls++;
if (CallbackCalls%200 == 0)
{
@@ -455,7 +456,6 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO
MotorId = Read_Dryer_ENC_Position(0,0);
Report("MotorMoveCallBackFunction",__FILE__,__LINE__,DrierZeroPosition,RpWarning,MotorId,0);
}
- MotorId = IfIndex&0xFF;
MotorTimeout[MotorId]+=MotorTimeLag[MotorId];
if ((BusyFlag == NOTBUSY)||((MotorTimeout[MotorId]>=MotorTimeLimit[MotorId])&&(MotorTimeLimit[MotorId]>0)))
@@ -463,9 +463,9 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO
/*if (MotorId == HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM)
{
printBusy = false;
- Report("MotorControlGetnBusyState stop",__FILE__,__LINE__,MotorDriverResponse[MotorId].Busy,RpMessage,0,0);
}*/
//stop this control loop
+ Report("MotorControlGetnBusyState stop",__FILE__,__LINE__,BusyFlag,RpMessage,MotorTimeout[MotorId],0);
SafeRemoveControlCallback(MotorControlId[MotorId], MotorMoveCallBackFunction );
MotorControlCallback[MotorId] = 0;
MotorControlId[MotorId] = 0xFF;
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 64425256f..b6a4a455f 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -888,9 +888,9 @@ uint32_t Adjust_Right_TFU_Tension(double tension)
uint32_t status = OK;
if (tension > 0.5) //0 = lower position, 1 = high position
{
- //PrepareWaitCount++;
if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP) == NO_LIMIT)
{
+ PrepareWaitCount++;
MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize, 15, GPI_LS_RDANCER_UP, Adjust_Right_TFU_Tension_Callback,15000);
Report("Adjust_Right_TFU_Tension",__FILE__,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,GPI_LS_RDANCER_UP,0);
}
@@ -901,9 +901,9 @@ uint32_t Adjust_Right_TFU_Tension(double tension)
uint32_t ThreadPrepare_TensionCallback (int MotorId, double tension)
{
//MotorStop(MotorId,Hard_Hiz);
+ ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_TensionCallback",__FILE__,__LINE__,MotorId,RpWarning,PrepareWaitCount,0);
if (PrepareWaitCount)
{
- ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_TensionCallback",__FILE__,__LINE__,MotorId,RpWarning,PrepareWaitCount,0);
PrepareWaitCount--;
}
if ((PrepareWaitCount == 0)&&(PrepareState == true))