aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c
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/FPGA/FPGA.c
parent7256fe1c07cf5ecbe485c3cdac238b88dfc2cd1d (diff)
downloadTango-eaeb19841e1d5195362ec1bd1fa8fb70557932cc.tar.gz
Tango-eaeb19841e1d5195362ec1bd1fa8fb70557932cc.zip
Fix bug in fans status
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c44
1 files changed, 22 insertions, 22 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 ----------------------