diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-05-08 13:32:57 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-05-08 13:32:57 +0300 |
| commit | 706b7f128efe759c7f8efe5379b572aca45e8c7e (patch) | |
| tree | bf8b92d567f9d0958af037de99fbdb1a82ba4cd1 /Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | |
| parent | ac176ba544f9936f4d4e1fb3ceb8762d21c86b11 (diff) | |
| parent | e55b98655d1efb66e87f254f8c8869debd4900ba (diff) | |
| download | Tango-706b7f128efe759c7f8efe5379b572aca45e8c7e.tar.gz Tango-706b7f128efe759c7f8efe5379b572aca45e8c7e.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 18 |
1 files changed, 9 insertions, 9 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) { |
