diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-14 08:05:06 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-14 08:05:06 +0300 |
| commit | d62893c320429b1fc50c9b86cfaa3345850e46a4 (patch) | |
| tree | 4580556f84ce6ba20b5eacc5313e329c1baa2c87 /Software/Embedded_SW/Embedded/Modules | |
| parent | 2f510ce9b99796ac95510980b9b8e8ea6ca57591 (diff) | |
| download | Tango-d62893c320429b1fc50c9b86cfaa3345850e46a4.tar.gz Tango-d62893c320429b1fc50c9b86cfaa3345850e46a4.zip | |
Dancers Enum changed - unified
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
5 files changed, 19 insertions, 16 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 6bbf1efc3..eaf7e81d8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -235,8 +235,8 @@ uint32_t MillisecLoop(uint32_t tick) for (Motor_i = 0;Motor_i < NUM_OF_MOTORS;Motor_i++) { -// if (MotorDriverResponse[Motor_i].Busy == true) -// continue; + if (MotorDriverResponse[Motor_i].Busy == true) + continue; if (MotorData[Motor_i].WaitForData == true) //Read request sent, data is waiting { if (MotorGetFPGAResponse(Motor_i,&MotorInfo) == OK) //got the data from the FPGA @@ -296,9 +296,9 @@ uint32_t MillisecLoop(uint32_t tick) } } } - Dancer_Data[FEEDER_DANCER] = Read_Dancer_Position(ROTENC_RDANCER); - Dancer_Data[POOLER_DANCER] = Read_Dancer_Position(ROTENC_LDANCER1); - Dancer_Data[WINDER_DANCER] = Read_Dancer_Position(ROTENC_LDANCER2); + Dancer_Data[FEEDER_DANCER] = Read_Dancer_Position(FEEDER_DANCER); + Dancer_Data[POOLER_DANCER] = Read_Dancer_Position(POOLER_DANCER); + Dancer_Data[WINDER_DANCER] = Read_Dancer_Position(WINDER_DANCER); if (Hundred_msTick) { } diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c index e36eea05d..1fc637029 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c @@ -53,7 +53,7 @@ void Stub_DancerPositionRequest(MessageContainer* requestContainer) response.dancer_id = request->dancer_id; response.has_dancer_id = true; - RotEnc_t Dancer_Id = (RotEnc_t)request->dancer_id;//to remove warning + HardwareDancerType Dancer_Id = (HardwareDancerType)request->dancer_id;//to remove warning if(Dancer_Id < NUM_OF_ROTENC) { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index 0bda4964b..db3bfc46e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -43,7 +43,7 @@ typedef enum threadMotorsEnum #define MAX_SYSTEM_DANCERS HARDWARE_DANCER_TYPE__RightDancer+1 extern TimerMotors_t ThreadMotorIdToMotorId[MAX_THREAD_MOTORS_NUM]; -extern DANCER_ENUM ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM]; +extern HardwareDancerType ThreadMotorIdToDancerId[MAX_THREAD_MOTORS_NUM]; extern HardwarePidControlType ThreadMotorIdToControlId[MAX_THREAD_MOTORS_NUM]; extern HardwareMotor MotorsCfg[NUM_OF_MOTORS]; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h index 3fb78d2f0..e957b0efc 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h @@ -2,13 +2,13 @@ #ifndef MODULES_THREAD_THREAD_EX_H_ #define MODULES_THREAD_THREAD_EX_H_ -typedef enum -{ - WINDER_DANCER, - POOLER_DANCER, - FEEDER_DANCER, - NUM_OF_DANCERS -} DANCER_ENUM; +//typedef enum +//{ +#define WINDER_DANCER HARDWARE_DANCER_TYPE__LeftDancer +#define POOLER_DANCER HARDWARE_DANCER_TYPE__MiddleDancer +#define FEEDER_DANCER HARDWARE_DANCER_TYPE__RightDancer +#define NUM_OF_DANCERS HARDWARE_DANCER_TYPE__RightDancer+1 +//} DANCER_ENUM; uint32_t ThreadPrepareState(void *JobDetails); uint32_t ThreadPreSegmentState(void *JobDetails); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 92939dfe4..48c985321 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -11,6 +11,7 @@ #include "../control/pidalgo.h" #include "PMR/Hardware/HardwareMotor.pb-c.h" #include "PMR/Hardware/HardwareMotorType.pb-c.h" +#include "PMR/Hardware/HardwareDancerType.pb-c.h" #include "PMR/Printing/JobSegment.pb-c.h" #include "PMR/Printing/JobTicket.pb-c.h" @@ -27,7 +28,7 @@ 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}; +HardwareDancerType 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}; @@ -281,9 +282,11 @@ bool InitialProcess = false; MotorSetDirection((TimerMotors_t)HW_Motor_Id,MotorsCfg[HW_Motor_Id].directionthreadwize); #ifdef DEBUG_TEST_FUNCTIONS -/* + if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled ControlIdtoMotorId[Motor_i] = AddControlCallback(ThreadLengthCBFunction, eOneMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToDancerId[Motor_i],Motor_i); + if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled + ControlIdtoMotorId[Motor_i] = AddControlCallback(ThreadControlCBFunction, eHundredMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToDancerId[Motor_i],Motor_i); if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled ControlIdtoMotorId[Motor_i] = AddControlCallback(ThreadControlCBFunction, eHundredMillisecond,Control_Read_Dancer_Position,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToDancerId[Motor_i],Motor_i); /*if (HW_Motor_Id == HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled |
