aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2019-03-11 12:09:05 +0200
committerAvi Levkovich <avi@twine-s.com>2019-03-11 12:09:05 +0200
commiteaeb19841e1d5195362ec1bd1fa8fb70557932cc (patch)
treedc975531ace5e20c87b5800639a60b441dcd60d6 /Software/Embedded_SW/Embedded/Drivers
parent7256fe1c07cf5ecbe485c3cdac238b88dfc2cd1d (diff)
downloadTango-eaeb19841e1d5195362ec1bd1fa8fb70557932cc.tar.gz
Tango-eaeb19841e1d5195362ec1bd1fa8fb70557932cc.zip
Fix bug in fans status
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c44
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.c10
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.h21
4 files changed, 54 insertions, 23 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c
index 454e82c28..0b98891c5 100644
--- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c
+++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c
@@ -195,7 +195,7 @@ uint32_t Calculate_Tacho_Fan_Speed(uint32_t OSC_IN, uint8_t PPR, uint16_t Presca
uint32_t Fans_Speed_RPM[MAX_FANS];
-FANS_STATUS Read_Fans_Tacho()
+uint8_t Read_Fans_Tacho()
{
FANS_STATUS Fans_Status;
@@ -212,9 +212,9 @@ FANS_STATUS Read_Fans_Tacho()
Fans_Speed_RPM[SYSTEM_2] = Calculate_Tacho_Fan_Speed(29166666, 0X02, F1_Prescaler1_reg5, F1_Tacho_reg7);
if( Fans_Speed_RPM[DRAWER_B] < 1000 ) // need to work around 3000 RPM
- Fans_Status.DRAWER_BIG = ERROR;// not working / Low Speed
+ Fans_Status.bit.DRAWER_BIG = ERROR;// not working / Low Speed
else
- Fans_Status.DRAWER_BIG = OK;//working (Speed ~0x400)
+ Fans_Status.bit.DRAWER_BIG = OK;//working (Speed ~0x400)
// The 4 small Fans in the drawer
// F1_gpi_FANS
@@ -222,10 +222,10 @@ FANS_STATUS Read_Fans_Tacho()
// “1” Fan working
if (F1_gpi_FANS == 0x0F )
{
- Fans_Status.DRAWER_SMALL0 = OK;//working
- Fans_Status.DRAWER_SMALL1 = OK;//working
- Fans_Status.DRAWER_SMALL2 = OK;//working
- Fans_Status.DRAWER_SMALL3 = OK;//working
+ Fans_Status.bit.DRAWER_SMALL0 = OK;//working
+ Fans_Status.bit.DRAWER_SMALL1 = OK;//working
+ Fans_Status.bit.DRAWER_SMALL2 = OK;//working
+ Fans_Status.bit.DRAWER_SMALL3 = OK;//working
}
else
{
@@ -236,70 +236,70 @@ FANS_STATUS Read_Fans_Tacho()
if(( Fans_Speed_RPM[DRAWER_S0] < 3000 ) && ( F1_FAN1_TACH == 0)) // need to work around 5000 RPM
{
- Fans_Status.DRAWER_SMALL0 = ERROR;/// not working / Low Speed
+ Fans_Status.bit.DRAWER_SMALL0 = ERROR;/// not working / Low Speed
}
else
{
- Fans_Status.DRAWER_SMALL0 = OK;//working (Speed ~0x400)
+ Fans_Status.bit.DRAWER_SMALL0 = OK;//working (Speed ~0x400)
}
if(( Fans_Speed_RPM[DRAWER_S1] < 3000 ) && ( F1_FAN2_TACH == 0)) // Small Fan in the drawer // need to work around 5000 RPM
{
- Fans_Status.DRAWER_SMALL1 = ERROR;// not working / Low Speed
+ Fans_Status.bit.DRAWER_SMALL1 = ERROR;// not working / Low Speed
}
else
{
- Fans_Status.DRAWER_SMALL1 = OK;//working (Speed ~0x400)
+ Fans_Status.bit.DRAWER_SMALL1 = OK;//working (Speed ~0x400)
}
if(( Fans_Speed_RPM[DRAWER_S2] < 3000 ) && ( F1_FAN3_TACH == 0)) // Small Fan in the drawer // need to work around 5000 RPM
{
- Fans_Status.DRAWER_SMALL2 = ERROR;// not working / Low Speed
+ Fans_Status.bit.DRAWER_SMALL2 = ERROR;// not working / Low Speed
}
else
{
- Fans_Status.DRAWER_SMALL2 = OK;//working (Speed ~0x400)
+ Fans_Status.bit.DRAWER_SMALL2 = OK;//working (Speed ~0x400)
}
if(( Fans_Speed_RPM[DRAWER_S3] < 3000 ) && ( F1_FAN4_TACH == 0)) // Small Fan in the drawer // need to work around 3050 RPM
{
- Fans_Status.DRAWER_SMALL3 = ERROR;// not working / Low Speed
+ Fans_Status.bit.DRAWER_SMALL3 = ERROR;// not working / Low Speed
}
else
{
- Fans_Status.DRAWER_SMALL3 = OK;//working (Speed ~0x400) < 1000 ) // need to work around 5000 RPM
+ Fans_Status.bit.DRAWER_SMALL3 = OK;//working (Speed ~0x400) < 1000 ) // need to work around 5000 RPM
}
}
if( Fans_Speed_RPM[SYSTEM_0] < 1000 ) // need to work around 3050 RPM
{
- Fans_Status.SYSTEM_FAN0 = ERROR;// not working / Low Speed
+ Fans_Status.bit.SYSTEM_FAN0 = ERROR;// not working / Low Speed
}
else
{
- Fans_Status.SYSTEM_FAN0 = OK;//working (Speed ~0x400)
+ Fans_Status.bit.SYSTEM_FAN0 = OK;//working (Speed ~0x400)
}
if( Fans_Speed_RPM[SYSTEM_1] < 1000 ) // need to work around 3050 RPM
{
- Fans_Status.SYSTEM_FAN1 = ERROR;// not working / Low Speed
+ Fans_Status.bit.SYSTEM_FAN1 = ERROR;// not working / Low Speed
}
else
{
- Fans_Status.SYSTEM_FAN1 = OK;//working (Speed ~0x400)
+ Fans_Status.bit.SYSTEM_FAN1 = OK;//working (Speed ~0x400)
}
if( Fans_Speed_RPM[SYSTEM_2] < 1000 ) // need to work around 3050 RPM
{
- Fans_Status.SYSTEM_FAN2 = ERROR;// not working / Low Speed
+ Fans_Status.bit.SYSTEM_FAN2 = ERROR;// not working / Low Speed
}
else
{
- Fans_Status.SYSTEM_FAN2 = OK;//working (Speed ~0x400)
+ Fans_Status.bit.SYSTEM_FAN2 = OK;//working (Speed ~0x400)
}
#endif
- return Fans_Status;
+ return Fans_Status.Uchar;
}
//------------------------- WHS ----------------------
diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h
index 93e0046b6..1c2bbfb1a 100644
--- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h
+++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h
@@ -6,7 +6,7 @@ int FPGA_Test_ReadBack(unsigned char FPGA_NUM, unsigned short Value, unsigned sh
int FPGA_ReadVersion(unsigned char FPGA_NUM, unsigned char *Version, unsigned char *Year, unsigned char *Month, unsigned char *Day);
void FPGA_Init();
//void FPGA_Read_limit_Switches(void);
-uint32_t Read_Fans_Tacho();
+uint8_t Read_Fans_Tacho();
//uint32_t WHS_Read_Blower_Tach();
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.c
new file mode 100644
index 000000000..4eb388d39
--- /dev/null
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.c
@@ -0,0 +1,10 @@
+/*
+ * IO.c
+ *
+ * Created on: Mar 11, 2019
+ * Author: avi
+ */
+
+
+
+
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.h
new file mode 100644
index 000000000..5f79c7bcd
--- /dev/null
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispensers_IO_Port/IO.h
@@ -0,0 +1,21 @@
+/*
+ * IO.h
+ *
+ * Created on: Mar 11, 2019
+ * Author: avi
+ *
+ */
+
+
+
+
+#ifndef DRIVERS_I2C_COMMUNICATION_DISPENSERS_IO_PORT_IO_H_
+#define DRIVERS_I2C_COMMUNICATION_DISPENSERS_IO_PORT_IO_H_
+
+ /*===============================================================================================================*
+ I2C ADDRESS
+ *===============================================================================================================*/
+
+
+
+#endif /* DRIVERS_I2C_COMMUNICATION_DISPENSERS_IO_PORT_IO_H_ */