aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-11-22 16:55:53 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-11-22 16:55:53 +0200
commit51b913dbffe9f0bb3b1a3a0ce00cef6720ba9a5e (patch)
tree21ee7d4236c5d4aafbb093fc3502abfb405c84ba /Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
parent389d8c71bdf3af88d4a02f041e42ca4945608b73 (diff)
downloadTango-51b913dbffe9f0bb3b1a3a0ce00cef6720ba9a5e.tar.gz
Tango-51b913dbffe9f0bb3b1a3a0ce00cef6720ba9a5e.zip
some changes in spikes
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index 8beab771d..3de362af9 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -524,11 +524,13 @@ int TemperatureSum[MAX_HEAD_CARD_TEMP_SENS_ID];
int TemperatureMin[MAX_HEAD_CARD_TEMP_SENS_ID];
int TemperatureMax[MAX_HEAD_CARD_TEMP_SENS_ID];
int TemperatureCount[MAX_HEAD_CARD_TEMP_SENS_ID];
-int TemperatureCalc[MAX_HEAD_CARD_TEMP_SENS_ID];
+int TemperatureCalc[MAX_HEAD_CARD_TEMP_SENS_ID] = {2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1,2.1};
void MillisecUpdateTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId,int temperature)
{
//if(TemperatureCount[SensorId]++>=10)
// TemperatureCount[SensorId] = 0;
+ if ((temperature>28000)||(temperature<900))
+ return;
TemperatureCount[SensorId]++;
if (TemperatureMax[SensorId]<temperature) TemperatureMax[SensorId]=temperature;
if (TemperatureMin[SensorId]>temperature) TemperatureMin[SensorId]=temperature;
@@ -540,8 +542,11 @@ int MillisecCalculateTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId)
TemperatureSum[SensorId]-=TemperatureMax[SensorId];
TemperatureSum[SensorId]-=TemperatureMin[SensorId];
calc = TemperatureSum[SensorId] / (TemperatureCount[SensorId]-2);
- if (abs(TemperatureMax[SensorId]-TemperatureMin[SensorId])>2000)
- Report("Millisec Temp spike",__FILE__,SensorId,(int)TemperatureMax[SensorId],RpWarning,(int) TemperatureMin[SensorId],0);
+ if (TemperatureSum[SensorId]>10)
+ {
+ if(abs(TemperatureMax[SensorId]-TemperatureMin[SensorId])>2000)
+ Report("Millisec Temp spike",__FILE__,SensorId,(int)TemperatureMax[SensorId],RpWarning,(int) TemperatureMin[SensorId],0);
+ }
TemperatureSum[SensorId] = 0;
TemperatureCount[SensorId] = 0;
TemperatureMin[SensorId] = 30000;