From e55b98655d1efb66e87f254f8c8869debd4900ba Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 7 May 2018 15:01:32 +0300 Subject: unify hardware motor type and remove some warnings --- .../Embedded/Modules/Thread/Thread_Winder.c | 18 +++++++++--------- .../Embedded_SW/Embedded/Modules/Thread/Thread_init.c | 2 +- .../Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') 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