diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 13c81fb39..89ff63363 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -10,6 +10,9 @@ #include "../control/pidalgo.h" #include "PMR/Hardware/HardwareMotor.pb-c.h" #include "PMR/Hardware/HardwareMotorType.pb-c.h" +#include "drivers/Motors/Motor.h" +#include "drivers/Heater/TemperatureSensor.h" +#include "drivers/Heater/Heater.h" ////////////////////////////////State machine operation//////////////////////////////////// //the state machine operation is used to operate in runtime correct profile flow execution //by recieved esign flow of the user from the UI @@ -23,6 +26,9 @@ typedef enum Stop } ReturnCode; + +uint32_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM] = {MOTOR_RDRIVING,MOTOR_DRYER_DRIVING,MOTOR_LDRIVING,MOTOR_WINDER,MOTOR_SCREW}; + /******************************************************************************************** * functions describes motor operation flow and movement state during profile execution * used to operate in runtime correct profileflow execution @@ -186,8 +192,9 @@ static ReturnCode PrepareState(void *JobDetails) MotorControlConfig[Motor_i].m_mesuredParam = 0; MotorControlConfig[Motor_i].m_preError = 0; MotorControlConfig[Motor_i].m_SetParam = 0;//need to update SetParams on presegment stage - AddControlCallback(DeviceId2Motor[Motor_i], ThreadControlCBFunction, eOneMillisecond,TemplateDataReadCBFunction,Motor_i); + AddControlCallback(ThreadControlCBFunction, eOneMillisecond,TemplateDataReadCBFunction,Motor_i,0); } + //set 3 dancers to the profile positions return NextState; } @@ -196,10 +203,10 @@ static ReturnCode PrepareState(void *JobDetails) static ReturnCode PreSegmentState(void *JobDetails) { - int Motor_i; + TimerMotors_t Motor_i; for (Motor_i = 0;Motor_i < MAX_THREAD_MOTORS_NUM;Motor_i++) { - MotorControlConfig[Motor_i].m_SetParam = getMotorFreq(Motor_i);//need to update SetParams on presegment stage + MotorControlConfig[Motor_i].m_SetParam = MotorGetSpeed(getMotorId(Motor_i));//need to update SetParams on presegment stage } // set the new speed in the dryer motor to the speed of the new segment // activate control fr all motors @@ -278,20 +285,9 @@ bool ThreadPrintingIterate(void *JobDetails) // screw_movement[gPrintingState[_motorId]]++; ReturnCode returnCode = state_fun(JobDetails); - /*if ((_motorId == SCREW_MOTOR)&&(pause_active)) - { - tick = UsersysTickGet(); - len = usnprintf(str, 60, "\r\n PrintingIterate tick %d state %d retcode %d ",tick, gPrintingState[_motorId],returnCode); - cb_push_back (str, len); - //SendInterruptMessageToHost(10+gPrintingState[_motorId],returnCode); - }*/ gPrintingState = LookupTransitions(gPrintingState, returnCode); - if (keepstate != gPrintingState){ - tick = UsersysTickGet(); - len = usnprintf(str, 60, "\r\n changed state tick %d state %d retcode %d ", tick, gPrintingState,returnCode); - cb_push_back (str, len); - - } +// if (keepstate != gPrintingState){ +// } // // Enable all interrupts. |
