diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-07 15:01:32 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-07 15:01:32 +0300 |
| commit | e55b98655d1efb66e87f254f8c8869debd4900ba (patch) | |
| tree | 612844e50db89bef37667d7b9672d4c4fa29654e /Software/Embedded_SW/Embedded/Modules/Thread | |
| parent | 5a0f1a75ea1443f50f600baaa7413a4d4fbbfb90 (diff) | |
| download | Tango-e55b98655d1efb66e87f254f8c8869debd4900ba.tar.gz Tango-e55b98655d1efb66e87f254f8c8869debd4900ba.zip | |
unify hardware motor type and remove some warnings
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
3 files changed, 16 insertions, 16 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 83068666b..5e81e4543 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -37,8 +37,8 @@ uint32_t Winder_Prepare(void) else { Winder_ScrewHoming = true; - status = MotorSetDirection(MOTOR_SCREW,1);//make sur to move the cart home - status |= MotorSetSpeed(MOTOR_SCREW, ScrewSpeed, MotorsCfg[SCREW_MOTOR].microstep); + status = MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,1);//make sur to move the cart home + status |= MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_SCREW, ScrewSpeed, MotorsCfg[SCREW_MOTOR].microstep); } return status; } @@ -51,8 +51,8 @@ uint32_t Winder_PrepareStage2(void) * 2. move back x steps - according to thehw specifications and bobine definitions in the job. move for a predefined number of steps. get a callback when done * report ready to the job STM */ - status = MotorSetDirection(MOTOR_SCREW,0);//make sur to move the cart out - //status |= MotorMoveSteps (MOTOR_SCREW, numOfSteps, Winder_ScrewAtOffsetCallback); + status = MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,0);//make sur to move the cart out + //status |= MotorMoveSteps (HARDWARE_MOTOR_TYPE__MOTO_SCREW, numOfSteps, Winder_ScrewAtOffsetCallback); //set motor location 0 here return status; @@ -97,7 +97,7 @@ uint32_t Winder_Presegment(void *JobDetails) // * 5. register motor nBusy callback. this callback will flip between move(traverse length, hardstop) and goto(0), with handline og the coneshape and adjusting maxspeed //MotorMove (InternalWinderCfg.segmentoffsetpulses,screw_speed); process: set point 0, set max speed, move to the specified length, return back. - MotorSetSpeedWithCallback (MOTOR_SCREW, screw_speed, MotorsCfg[SCREW_MOTOR].microstep,WinderPresegmentReady); + MotorSetSpeedWithCallback (HARDWARE_MOTOR_TYPE__MOTO_SCREW, screw_speed, MotorsCfg[SCREW_MOTOR].microstep,WinderPresegmentReady); //in a callback: calculate backing rate for top and bottom, update point 0, update passing length, call the appropriate move to 0 / move; return OK; @@ -105,21 +105,21 @@ uint32_t Winder_Presegment(void *JobDetails) uint32_t Winder_End(void) { //stop screw - return StopMotor (MOTOR_SCREW,Hard_Hiz); + return StopMotor (HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); } void Winder_ScrewHomeLimitSwitchInterrupt(void) { uint32_t status; if (Winder_ScrewHoming) { - StopMotor(MOTOR_SCREW,Hard_Stop); //stop ASAP + StopMotor(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Stop); //stop ASAP } - status = MotorSetDirection(MOTOR_SCREW,MotorsCfg[SCREW_MOTOR].directionthreadwize);//make sure to move the cart out + status = MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,MotorsCfg[SCREW_MOTOR].directionthreadwize);//make sure to move the cart out } void Winder_ScrewOutLimitSwitchInterrupt(void) { uint32_t status; - status = MotorSetDirection(MOTOR_SCREW,1-MotorsCfg[SCREW_MOTOR].directionthreadwize);//make sure to move the cart out + status = MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_SCREW,1-MotorsCfg[SCREW_MOTOR].directionthreadwize);//make sure to move the cart out } uint32_t Winder_ScrewAtOffsetCallback(uint32_t NumberOfSteps) { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index 6c97c2e8f..5a8c3df76 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -50,7 +50,7 @@ uint32_t InternalWindingConfigMessage(JobSpool* request) uint32_t MotorsConfigMessage(HardwareMotor * request) { uint32_t status = PASSED; - int Motor_i; + TimerMotors_t Motor_i; MotorDriverConfigStruc MotorDriverConfig; Motor_i = request->hardwaremotortype; /*for (i=0;i<MAX_THREAD_MOTORS_NUM;i++) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 2af3a699d..0e68a6406 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -26,7 +26,7 @@ /////////////////////////////////////////////////////////////////////////////////////////// -TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM] = {MOTOR_RDRIVING,MOTOR_DRYER_DRIVING,MOTOR_LDRIVING,MOTOR_WINDER,MOTOR_SCREW}; +TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM] = {HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,HARDWARE_MOTOR_TYPE__MOTO_WINDER,HARDWARE_MOTOR_TYPE__MOTO_SCREW}; DANCER_ENUM ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM] = {FEEDER_DANCER,NUM_OF_DANCERS,POOLER_DANCER,WINDER_DANCER,NUM_OF_DANCERS}; uint32_t ControlIdtoMotorId [MAX_THREAD_MOTORS_NUM] = {0xFF}; int OriginalMotorSpd_2PPS[MAX_THREAD_MOTORS_NUM] = {0}; @@ -328,9 +328,9 @@ uint32_t ThreadPreSegmentState(void *JobDetails) } //ControlStart(); // set the new speed in the dryer motor to the speed of the new segment - MotorSetSpeed(MOTOR_DRYER_DRIVING, OriginalMotorSpd_2PPS[DRYER_MOTOR], MotorsCfg[MOTOR_DRYER_DRIVING].microstep); - MotorSetSpeed(MOTOR_RLOADING, 1, 1); - MotorSetSpeed(MOTOR_LLOADING, 1,1); + MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING, OriginalMotorSpd_2PPS[DRYER_MOTOR], MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING].microstep); + MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, 1, 1); + MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 1,1); // activate control fr all motors @@ -377,8 +377,8 @@ uint32_t ThreadSegmentState(void *JobDetails, int SegmentId) { StopMotor(ThreadMotorIdToMotorId[Motor_i],Hard_Hiz); } - StopMotor(MOTOR_RLOADING,Hard_Hiz); - StopMotor(MOTOR_LLOADING,Hard_Hiz); + StopMotor(HARDWARE_MOTOR_TYPE__MOTO_RLOADING,Hard_Hiz); + StopMotor(HARDWARE_MOTOR_TYPE__MOTO_LLOADING,Hard_Hiz); return OK; } |
