aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/control.c
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-05-06 09:08:10 +0300
committerAvi Levkovich <avi@twine-s.com>2018-05-06 09:08:10 +0300
commit1259efb89a2bbb17b7b1d42762737aa2c79fa020 (patch)
tree56b361012f42bd3eadd65fc062ac7cbf1d35d822 /Software/Embedded_SW/Embedded/Modules/Control/control.c
parent38b612fcb41def85693cb54c4ebc65a648c8a32f (diff)
downloadTango-1259efb89a2bbb17b7b1d42762737aa2c79fa020.tar.gz
Tango-1259efb89a2bbb17b7b1d42762737aa2c79fa020.zip
integration changes
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index 0a4a8b791..a56457bdb 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -254,10 +254,12 @@ uint32_t ControlLoop(uint32_t tick)
//test dancers and speed encoders
//check all callback units (state machine waiting for completion of a change)
uint32_t Device_i;
- bool Ten_msTick, Hundred_msTick, Onesecond_Tick;
+ bool Ten_msTick, Hundred_msTick, Onesecond_Tick,Tick98,Tick998;
Ten_msTick = (tick%eTenMilliSecond == 0) ?true:false;
- Hundred_msTick = (tick%eHunderdMillisecond == 0) ?true:false;
+ Hundred_msTick = (tick%eHundredMillisecond == 0) ?true:false;
Onesecond_Tick = (tick%eOneSecond == 0) ?true:false;
+ Tick98 = (tick%eHundredMillisecond == 98) ?true:false;
+ Tick998 = (tick%eOneSecond == 998) ?true:false;
for (Device_i = 0; Device_i < MAX_TANGO_CONTROL_DEVICES;Device_i++)
{
@@ -276,17 +278,25 @@ uint32_t ControlLoop(uint32_t tick)
ControlArray[Device_i].ControlCallbackPtr(ControlArray[Device_i].IfIndex, ControlDatalog[Device_i]);
}
break;
- case eHunderdMillisecond:
- if (Hundred_msTick)
+ case eHundredMillisecond:
+ if (Tick98)
{
+ //there is a need to trigger the data collection from FPGA, from I2C or from ADC 1.5 milliseconds to collect the data
ControlDatalog[Device_i] = ControlArray[Device_i].ControlDataReadPtr( ControlArray[Device_i].Parameter1,ControlArray[Device_i].Parameter2);
+ }
+ if (Hundred_msTick)
+ {
+ //there is a need to trigger the data collection from FPGA, from I2C or from ADC 1.5 milliseconds to collect the data
ControlArray[Device_i].ControlCallbackPtr(ControlArray[Device_i].IfIndex, ControlDatalog[Device_i]);
}
break;
case eOneSecond:
- if (Onesecond_Tick)
+ if (Tick998)
{
ControlDatalog[Device_i] = ControlArray[Device_i].ControlDataReadPtr( ControlArray[Device_i].Parameter1,ControlArray[Device_i].Parameter2);
+ }
+ if (Onesecond_Tick)
+ {
ControlArray[Device_i].ControlCallbackPtr(ControlArray[Device_i].IfIndex, ControlDatalog[Device_i]);
}
break;