diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-02 10:24:54 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-02 10:24:54 +0300 |
| commit | 66aa9beeec79e5f828fc13ce7a5e41c15227ec9a (patch) | |
| tree | a74f7e1b4da57063046177139a5e2db188b13f48 /Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | |
| parent | ad93ce8b0f13540aafe55bc3ba9d7d72aa1fc7e2 (diff) | |
| parent | 9e979a9b18727fdc9f128da5a7d2347dff2d0705 (diff) | |
| download | Tango-66aa9beeec79e5f828fc13ce7a5e41c15227ec9a.tar.gz Tango-66aa9beeec79e5f828fc13ce7a5e41c15227ec9a.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 83c20f769..8243c5faa 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -12,7 +12,7 @@ ////////////////////////////////State machine operation//////////////////////////////////// //the state machine operation is used to operate in runtime correct profile flow execution -//by recieved esign flow of the user from the UI +//by recieved design flow of the user from the UI /////////////////////////////////////////////////////////////////////////////////////////// #include "include.h" #include "Modules/General/GeneralHardware.h" @@ -226,7 +226,7 @@ int32_t MillisecWriteToMotor(TimerMotors_t MotorId, unsigned long Data, int Leng MSBacklog[MsecLogindex]=Data; Motor_Id[MsecLogindex]=MotorId; MsecLogindex++; - if (MsecLogindex>=999) + if (MsecLogindex>=199) MsecLogindex = 0; //========================== if (MotorId >= NUM_OF_MOTORS) return -1; @@ -247,7 +247,7 @@ int32_t MillisecReadFromMotor(TimerMotors_t MotorId, unsigned long Data, int Len MSBacklog[MsecLogindex]=Data; Motor_Id[MsecLogindex]=MotorId; MsecLogindex++; - if (MsecLogindex>=999) + if (MsecLogindex>=199) MsecLogindex = 0; //========================== MotorActivity++; @@ -269,11 +269,12 @@ uint32_t MillisecLoop(uint32_t tick) //call all modules Millisec functions //test dancers and speed encoders //check all callback units (state machine waiting for completion of a change) - bool Ten_msTick, Hundred_msTick, Onesecond_Tick,O900Millisecond_Tick; + bool Ten_msTick, Hundred_msTick, Onesecond_Tick,O900Millisecond_Tick,Tick98; Ten_msTick = (tick%eTenMillisecond == 0) ?true:false; Hundred_msTick = (tick%eHundredMillisecond == 0) ?true:false; O900Millisecond_Tick = (tick%eOneSecond == 900) ?true:false; Onesecond_Tick = (tick%eOneSecond == 0) ?true:false; + Tick98 = (tick%eHundredMillisecond == 99) ?true:false; //gather Motor data from FPGA //ROM_IntMasterDisable(); @@ -386,10 +387,23 @@ uint32_t MillisecLoop(uint32_t tick) { Speed_Data = Read_Speed_Sensor(); } + if (Tick98) + { + MotorGetSpeedFromFPGA(HARDWARE_MOTOR_TYPE__MOTO_RDRIVING); + MotorGetSpeedFromFPGA(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING); + MotorGetSpeedFromFPGA(HARDWARE_MOTOR_TYPE__MOTO_LDRIVING); + MotorGetSpeedFromFPGA(HARDWARE_MOTOR_TYPE__MOTO_WINDER); + MotorGetSpeedFromFPGA(HARDWARE_MOTOR_TYPE__MOTO_SCREW); + } if (Hundred_msTick) { for (Sensor_i = 0;Sensor_i < MAX_TEMPERATURE_SENSOR_ID;Sensor_i++) MillisecReadFromTempSensor(Sensor_i, NULL); + MotorGetSpeedFromFPGA_Res(HARDWARE_MOTOR_TYPE__MOTO_RDRIVING); + MotorGetSpeedFromFPGA_Res(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING); + MotorGetSpeedFromFPGA_Res(HARDWARE_MOTOR_TYPE__MOTO_LDRIVING); + MotorGetSpeedFromFPGA_Res(HARDWARE_MOTOR_TYPE__MOTO_WINDER); + MotorGetSpeedFromFPGA_Res(HARDWARE_MOTOR_TYPE__MOTO_SCREW); } if (O900Millisecond_Tick) |
