aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-10-29 13:19:45 +0200
committerAvi Levkovich <avi@twine-s.com>2020-10-29 13:19:45 +0200
commitf07e100bb3fd2feb41e3e1b6ff8c5e2b5e82cc86 (patch)
tree6a1cdd0f9db18c24d64ab6675eeca7e79f628037 /Software/Embedded_SW/Embedded/Drivers
parent902139314c4d406236de4eec79ba7364d09e68d0 (diff)
parent6d2c4fb1e5834a7a74bdd5399e9ba82f403a52eb (diff)
downloadTango-f07e100bb3fd2feb41e3e1b6ff8c5e2b5e82cc86.tar.gz
Tango-f07e100bb3fd2feb41e3e1b6ff8c5e2b5e82cc86.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c10
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h4
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c17
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c9
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c4
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h2
6 files changed, 26 insertions, 20 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c
index 627ad45b9..f9092c889 100644
--- a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c
+++ b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c
@@ -430,14 +430,14 @@ void ADCAcquireStop(void)
double VPressure_0 = 0;
double A_offset =-2.429, B_slope_coefficient = 0.267;//A - offset, B - slope coefficient
-double Calculate_Pitot_Pressure(bool flow ) // WHS - AN_AIRPRESS_1
+/*double Calculate_Pitot_Pressure(bool flow ) // WHS - AN_AIRPRESS_1
{
//MPXV7002 (NXP)
uint32_t VsampleInBits;
- double Pressure = 0.0, temp, /*PKpa,PBar,*/VADC = 0.0 ,VSensor/*,PMicroBar*/;
+ double Pressure = 0.0, temp, /`*PKpa,PBar,*`/VADC = 0.0 ,VSensor/`*,PMicroBar*`/;
VsampleInBits = ADC_GetReading(ADC_AIR_PRESSURE_1);
@@ -465,18 +465,18 @@ double Calculate_Pitot_Pressure(bool flow ) // WHS - AN_AIRPRESS_1
{
Pressure = A_offset + B_slope_coefficient * (sqrt(VSensor - VPressure_0));
- /*
+ /`*
PKpa = 5 * VSensor;
// ---- P[Kpa] -> BAR ----
PBar = PKpa / 100.0;
PMicroBar = PBar/1000;
- Pressure = PMicroBar;*/
+ Pressure = PMicroBar;*`/
return Pressure;
}
-}
+}*/
uint32_t Read_Dryer_Heaters_Current(HEATERS_CURRENT Heater_ID) //
{
diff --git a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h
index d7efd45d4..0dc1523fa 100644
--- a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h
+++ b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.h
@@ -60,8 +60,8 @@ void ADCAcquireStop(void);
void ADC0SS0Handler(void);
-double Calculate_Pitot_Pressure(bool flow ) ;
-uint8_t Calculate_Gas_Power_Consumption();
+//double Calculate_Pitot_Pressure(bool flow ) ;
+//uint8_t Calculate_Gas_Power_Consumption();
uint32_t Read_Dryer_Heaters_Current(HEATERS_CURRENT Heater_ID);
void CheckAcInputVoltage();
diff --git a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c
index e6a20904e..ea2f5a050 100644
--- a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c
+++ b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC_VOC_Sensor.c
@@ -31,9 +31,9 @@ void VOCAlarmsInit(void)
memset(Gas_PPM,0,sizeof(Gas_PPM));
}
-void CalculateVOCAlarms(void)
+/*void CalculateVOCAlarms(void)
{
- int i,slope1=0,/*slope2=0,*/slopeindex=0;
+ int i,slope1=0,/`*slope2=0,*`/slopeindex=0;
double a;
bool alarmstate = false;
for (i = 0; i< MAX_VOC_SAMPLES; i++)
@@ -46,13 +46,13 @@ void CalculateVOCAlarms(void)
if ((slope1>0)&&(slope1 > VOC_Slope))
{
slopeindex++;
- if (slopeindex>=VOC_Slope_Time)
+ /`*if (slopeindex>=VOC_Slope_Time)
{
AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE,true);
Report("CalculateVOCAlarms slope on",__FILE__,__LINE__,(int)slope1,RpWarning,slopeindex,0);
alarmstate = true;
VOC_SlopeAlarm = true;
- }
+ }*`/
}
else
{
@@ -67,7 +67,7 @@ void CalculateVOCAlarms(void)
AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_SLOPE,false);
}
- if (a/MAX_VOC_SAMPLES > VOC_AverageLimit)
+ /`*if (a/MAX_VOC_SAMPLES > VOC_AverageLimit)
{
AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_TIME,true);
Report("CalculateVOCAlarms time on",__FILE__,__LINE__,(int)a,RpWarning,VOC_AverageLimit,0);
@@ -75,7 +75,7 @@ void CalculateVOCAlarms(void)
else if (VOC_TimeAlarm == true)
{
AlarmHandlingSetAlarm(EVENT_TYPE__VOC_SENSOR_ALARM_TIME,false);
- }
+ }*`/
}
@@ -84,14 +84,14 @@ uint8_t Calculate_Gas_Power_Consumption() // WHS
// TGS 2602 (FIGARO)
-/* Concentrtion Sensor
+/`* Concentrtion Sensor
[ppm] [v]
0 0.353
18 0.438
33 2.919
100 4.196
316 4.571
-*/
+*`/
double VOC_Vsensor[] =
{
@@ -182,3 +182,4 @@ uint8_t Calculate_Gas_Power_Consumption() // WHS
return 0xFF;//out of scale
}
+*/
diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c
index 9d20d37a4..2ebaa4732 100644
--- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c
+++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c
@@ -166,8 +166,7 @@ void Read_Motors_Driver_ADC(void)
}
else
{
- ReportWithPackageFilter(GeneralFilter,"the motor's combined driver adc",__FILE__,__LINE__,i,RpMessage,MotorDriverResponse[i].ADC,0);
-
+ //ReportWithPackageFilter(GeneralFilter,"the motor's combined driver adc",__FILE__,__LINE__,i,RpMessage,MotorDriverResponse[i].ADC,0);
}
}
@@ -192,9 +191,7 @@ void Read_Motors_Driver_ADC(void)
{
FPGA_Get_Res(i);
MotorDriverResponse[i].ADC = Fpga_Spi[i].RX_MISO;
- LOG_ERROR (i, "the motor's driver type");
- ReportWithPackageFilter(GeneralFilter,"the motor's driver adc",__FILE__,__LINE__,i,RpMessage,MotorDriverResponse[i].ADC,0);
-
+ //ReportWithPackageFilter(GeneralFilter,"the motor's driver adc",__FILE__,__LINE__,i,RpMessage,MotorDriverResponse[i].ADC,0);
}
}
}
@@ -491,6 +488,8 @@ void FPGA_SetMotorsInit()
{
uint8_t i=0;
+ MotorConfiguredTimeout = 100;
+
//since powerstep in stby on powerup)
F1_Moto_Driver_NSTBYRST1 = 0xFFFF;
F1_Moto_Driver_NSTBYRST2 = 0xFFFF;
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
index ce6b34dd9..aef2be5fe 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
@@ -439,9 +439,11 @@ void SendLimitedBlowerControl(int mV)
if (JobIsActive())
{
JobEndReason = JOB_SAFETY_CRITICAL_ALARM;
+ usnprintf(AlarmReasonStr, 100, "Waste airflow Error %d",mV);
SendJobProgress(0.0,0,false, "Waste airflow Error");
AbortJob("Waste airflow Error");
//SegmentReady(Module_Heaters,ModuleFail);
+
ReportWithPackageFilter(HeatersFilter, "Waste airflow Error",__FILE__,__LINE__,mV,RpError, 0,0);
HeatersEnd();
return;
@@ -592,6 +594,8 @@ void WHS_Start_Blower_Control_Closed_Loop ()
return; //do not start before controller is initialized and running
if (EnableControlLoop == false)
return; //do not start loop
+ if (WHS_Type == WHS_TYPE_NEW)
+ return; //do not start loop
if (count == close_loop_time)
{
diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h
index 655a980db..7da9f92a7 100644
--- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h
+++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.h
@@ -26,6 +26,8 @@
#define FLASH_SIZE 0X8000
+extern int base_flashErased;
+
//*****************************************************************************
//
// Read application data from a buffer and program it into flash.