aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-05-12 18:24:22 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-05-12 18:24:22 +0300
commitce0fe045c8dc0f005c4e70da5e71729d0c986165 (patch)
tree4b16aa41b0ad3d555780b6d4b3283b46c7ac9276 /Software/Embedded_SW
parent524bc43f07339979eda1c812354a9a2e8e0f7e09 (diff)
downloadTango-ce0fe045c8dc0f005c4e70da5e71729d0c986165.tar.gz
Tango-ce0fe045c8dc0f005c4e70da5e71729d0c986165.zip
fix double report issue. improve IDS pressure build
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c2
-rw-r--r--Software/Embedded_SW/Embedded/Common/report/distributor.c5
-rw-r--r--Software/Embedded_SW/Embedded/Communication/Container.c1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c32
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c7
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c2
7 files changed, 40 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
index 81a34b7ac..84791face 100644
--- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
+++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
@@ -20,7 +20,7 @@ typedef struct
} TangoVersion_t;
-TangoVersion_t _gTangoVersion = {1,3,9,10};
+TangoVersion_t _gTangoVersion = {1,3,9,11};
#define BUILD_DATE __DATE__
char Dat[50] = BUILD_DATE;
char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d
diff --git a/Software/Embedded_SW/Embedded/Common/report/distributor.c b/Software/Embedded_SW/Embedded/Common/report/distributor.c
index f011653ec..e4ab5fa36 100644
--- a/Software/Embedded_SW/Embedded/Common/report/distributor.c
+++ b/Software/Embedded_SW/Embedded/Common/report/distributor.c
@@ -618,6 +618,11 @@ STATUS ReportFunc(ReportFunction func, uint32_t SwitchAddRemove, DistributorHand
}
if (SwitchAddRemove == REPORT_ADD)
{
+ if ((func == ReportFunc1)||(func == ReportFunc2))
+ {
+ REPORT_MSG (REPORT_ADD,"Report function already exist");
+ return OK;
+ }
if (ReportFunc1 == NULL)
{
ReportFunc1 = func;
diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c
index 480060791..9fb21d6d9 100644
--- a/Software/Embedded_SW/Embedded/Communication/Container.c
+++ b/Software/Embedded_SW/Embedded/Communication/Container.c
@@ -137,6 +137,7 @@ void receive_callback(char* buffer, size_t length)
resetIdleCounter();
REPORT_MSG(requestContainer->type,"Message received");
}
+ KeepAliveOneSecondCounter = 0;
msgId[index] = requestContainer->type;
Length[index] = length;
DataLength[index] = requestContainer->data.len;
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index 916d33772..4cd56df56 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -477,6 +477,11 @@ int MillisecGetTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId)
{
return TemperatureCalc[SensorId];
}
+bool RapidPressureRead = false;
+void setRapidPressureRead(bool value)
+{
+ RapidPressureRead = value;
+}
uint32_t MillisecLowLoop(uint32_t tick)
{
uint8_t Motor_i,Disp_i,Heater_i,temp;
@@ -528,18 +533,30 @@ uint32_t MillisecLowLoop(uint32_t tick)
//LOG_ERROR (1111, "Control_WD");
}
}
+ if (RapidPressureRead == true)
+ {
+ for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++)
+ {
+ CalculateDispenserPressure(Disp_i);
+ //Read_MidTank_Pressure_Sensor(Disp_i);
+ }
+ ADC_TriggerCollection();
+ }
}
- if (O900Millisecond_Tick)
+ if ((O900Millisecond_Tick)&&(RapidPressureRead == false))
{
ADC_TriggerCollection();
}
if (Onesecond_Tick)
{
- for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++)
+ if (RapidPressureRead == false)
{
- CalculateDispenserPressure(Disp_i);
- //Read_MidTank_Pressure_Sensor(Disp_i);
+ for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++)
+ {
+ CalculateDispenserPressure(Disp_i);
+ //Read_MidTank_Pressure_Sensor(Disp_i);
+ }
}
FPGA_GetAllDispensersValveBusyOCD();
temp = Read_Fans_Tacho();
@@ -553,9 +570,12 @@ uint32_t MillisecLowLoop(uint32_t tick)
if (isMotorConfigured(Motor_i))
MotorGetStatusFromFPGA(Motor_i);
}
- for (Heater_i = 0;Heater_i < NUM_OF_CURRENT_HEATERS;Heater_i++)
+ if (!(OneMinute_Tick))
{
- Read_Heaters_Current(Heater_i);
+ for (Heater_i = 0;Heater_i < NUM_OF_CURRENT_HEATERS;Heater_i++)
+ {
+ Read_Heaters_Current(Heater_i);
+ }
}
Gas_PPM = Calculate_Gas_Power_Consumption();
for (Sensor_i = 0;Sensor_i < MAX_TEMPERATURE_SENSOR_ID;Sensor_i++)
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
index be82d9e98..4edc1a8ed 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
@@ -34,6 +34,7 @@ uint32_t getDrawerFansStatus(void);
uint32_t getSystemFansStatus(void);
uint8_t getGasReading(void);
int MillisecGetTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId);
+void setRapidPressureRead(bool value);
void MillisecInit(void);
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
index cd748fd5c..6bf587980 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
@@ -553,6 +553,7 @@ c. Go to step 2.a x Segment.BrushStopsCount.
double PrepeareSpeed = 0;
int NumOfActiveDispensers = 0;
int DispenserBuildTimeCounter = 0;
+#define PRESSURE_READ_TIME_GAP 100
//********************************************************************************************************************
uint32_t IDS_Prepare_Callback(uint32_t DispenserId, uint32_t ReadValue)
{
@@ -561,7 +562,7 @@ c. Go to step 2.a x Segment.BrushStopsCount.
int NumofReadyDispensers = 0;
//REPORT_MSG((int)DispenserPrepareControlId, "Prepare Callback");
- DispenserBuildTimeCounter+=500;
+ DispenserBuildTimeCounter+=PRESSURE_READ_TIME_GAP;
if (DispenserBuildTimeCounter<(2*eOneSecond))
{
@@ -587,6 +588,7 @@ c. Go to step 2.a x Segment.BrushStopsCount.
if ((DispenserBuildTimeCounter >= DispenserPrepareTimeout)||(pressureReady == true))
{
SafeRemoveControlCallback(DispenserPrepareControlId, IDS_Prepare_Callback );
+ setRapidPressureRead(false);
//DispenserPrepareReady();
PrepareReady(Module_IDS,ModuleDone);
}
@@ -679,7 +681,8 @@ c. Go to step 2.a x Segment.BrushStopsCount.
}
}
DispenserBuildTimeCounter = 0;
- DispenserPrepareControlId = AddControlCallback( IDS_Prepare_Callback, 500,TemplateDataReadCBFunction ,0, 0, 0 );
+ DispenserPrepareControlId = AddControlCallback( IDS_Prepare_Callback, PRESSURE_READ_TIME_GAP,TemplateDataReadCBFunction ,0, 0, 0 );
+ setRapidPressureRead(true);
}
//********************************************************************************************************************
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
index df88db3f9..b29f24f73 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c
@@ -479,7 +479,7 @@ void ScrewTimerInterrupt(int ARG0)
TimerDisable(Screw_timerBase, TIMER_A);
}
ROM_IntMasterEnable();
- Rotations+=0.03;
+ Rotations+=0.01;
return ;