diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-15 14:18:08 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-15 14:18:08 +0300 |
| commit | 63bf8b3ac3186b43cf7703254d489106566aa9b5 (patch) | |
| tree | fbe39b2e56caf503bb0f55cd35a3d98e8fe07acc /Software/Embedded_SW/Embedded/Modules/Control | |
| parent | 4fa27a868376a0371bab0628b122444e2919a964 (diff) | |
| parent | 3f6ff04da7c8c3fb2d41ee0d5f355d9bd449492a (diff) | |
| download | Tango-63bf8b3ac3186b43cf7703254d489106566aa9b5.tar.gz Tango-63bf8b3ac3186b43cf7703254d489106566aa9b5.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
4 files changed, 12 insertions, 8 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 6bbf1efc3..2fe813395 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -31,6 +31,7 @@ #include "modules/thread/thread_ex.h" +Task_Handle Millisecond_Task_Handle; /******************** Definitions ********************************************/ #define INVALID_MSG_ID 0xFFFF #define MAX_TANGO_CONTROL_DEVICES 200 @@ -231,12 +232,13 @@ uint32_t MillisecLoop(uint32_t tick) //gather Motor data from FPGA #ifndef EVALUATION_BOARD FPGA_GetBusy(); //load the busy motor information to all motors + FPGA_Read_limit_Switches(); #endif 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 +298,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) { } @@ -370,7 +372,7 @@ void MillisecTask(UArg arg0, UArg arg1) //Clock_setTimeout(HostKAClock, 1000); //Clock_start(HostKAClock); MillisecInit(); - + Millisecond_Task_Handle = Task_self(); while(1) { Mailbox_pend(MillisecMsgQ , &Message, BIOS_WAIT_FOREVER); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h index f0009b43b..6949a4abe 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h @@ -30,4 +30,5 @@ void MillisecInit(void); void MillisecStop(void); void MillisecStart(void); +extern Task_Handle Millisecond_Task_Handle; #endif /* MODULES_CONTROL_MILLISECTASK_H_ */ diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 08001cf01..40eee95c8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -90,7 +90,7 @@ int ControlPhaseDelay = 300; //the control task enters only after data gathering Mailbox_Handle ControlMsgQ = NULL; bool ControlRestart; static GateMutex_Handle gateControlDB; - +Task_Handle Control_Task_Handle; ControlDeviceStruc ControlArray[MAX_TANGO_CONTROL_DEVICES]; uint32_t ControlDatalog[MAX_TANGO_CONTROL_DEVICES]; uint32_t Control_timerBase = TIMER0_BASE; //Timer handle @@ -321,7 +321,7 @@ void controlTask(UArg arg0, UArg arg1) //uint16_t length; //Clock_setTimeout(HostKAClock, 1000); //Clock_start(HostKAClock); - + Control_Task_Handle = Task_self(); while(1) { diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.h b/Software/Embedded_SW/Embedded/Modules/Control/control.h index 76e90ed2e..853393739 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.h @@ -40,5 +40,6 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM Ctr int RemoveControlCallback(uint32_t deviceId, ControlCBFunction Callback ); uint32_t TemplateDataReadCBFunction (uint32_t deviceId, uint32_t Parameter1, uint32_t Parameter2); +extern Task_Handle Control_Task_Handle; #endif |
