aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Communication
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-01-31 10:31:57 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-01-31 10:31:57 +0200
commitbf69a053dcec41d2a38ea63d5e0cb10453190136 (patch)
treea0e3d0ddbe6164e0016caf46a1b1b733811a6f93 /Software/Embedded_SW/Embedded/Communication
parent6704280804a6d1cebd5ee13050ba18950cdb83ec (diff)
downloadTango-bf69a053dcec41d2a38ea63d5e0cb10453190136.tar.gz
Tango-bf69a053dcec41d2a38ea63d5e0cb10453190136.zip
SW info FPGA version fixed
Diffstat (limited to 'Software/Embedded_SW/Embedded/Communication')
-rw-r--r--Software/Embedded_SW/Embedded/Communication/Connection.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c
index 1669dd6a3..b1ee3bda3 100644
--- a/Software/Embedded_SW/Embedded/Communication/Connection.c
+++ b/Software/Embedded_SW/Embedded/Communication/Connection.c
@@ -29,7 +29,12 @@
#include "Modules/AlarmHandling/AlarmHandling.h"
#include "Modules/Stubs_Handler/Stub_HW_Version.h"
-
+char HexToDecimal(char hex)
+{
+ int i = hex % 0x10;
+ int j = hex / 0x10;
+ return j*10+i;
+}
void ConnectionRequest(MessageContainer* requestContainer)
{
MessageContainer responseContainer;
@@ -43,12 +48,12 @@ void ConnectionRequest(MessageContainer* requestContainer)
unsigned char Month = 0;
unsigned char Day = 0;
- char Version[20] = {0};
- char FPGA1Version[20] = {0};
- char FPGA2Version[20] = {0};
- char FPGA3Version[20] = {0};
- char BoardVersion[20] = {0};
- char AssyVersion[20] = {0};
+ char Version[30] = {0};
+ char FPGA1Version[30] = {0};
+ char FPGA2Version[30] = {0};
+ char FPGA3Version[30] = {0};
+ char BoardVersion[30] = {0};
+ char AssyVersion[30] = {0};
response.deviceinformation = &DevInfo;
/*
extern TangoVersion_t _gTangoVersion;
@@ -57,19 +62,19 @@ void ConnectionRequest(MessageContainer* requestContainer)
*/
DevInfo.builddate = Dat;
DevInfo.name = _gTangoName;
- usnprintf(Version, 20, "%d.%d.%d.%d",_gTangoVersion.m_major,_gTangoVersion.m_minor,_gTangoVersion.m_patch,_gTangoVersion.m_build);
+ usnprintf(Version, 30, "%d.%d.%d.%d",_gTangoVersion.m_major,_gTangoVersion.m_minor,_gTangoVersion.m_patch,_gTangoVersion.m_build);
DevInfo.version = Version;
FPGA_ReadVersion(1, &Major, &Year, &Month, &Day);
- usnprintf(FPGA1Version, 20, "%d.%d.%d.%d",Major,Year, Month, Day);
+ usnprintf(FPGA1Version, 30, "FPGA1: Ver %d %d/%d/20%d",HexToDecimal(Major), HexToDecimal(Day),HexToDecimal(Month),HexToDecimal(Year));
DevInfo.fpga1version = FPGA1Version;
FPGA_ReadVersion(2, &Major, &Year, &Month, &Day);
- usnprintf(FPGA2Version, 20, "%d.%d.%d.%d",Major,Year, Month, Day);
+ usnprintf(FPGA2Version, 30, "FPGA2: Ver %d %d/%d/20%d",HexToDecimal(Major), HexToDecimal(Day),HexToDecimal(Month),HexToDecimal(Year));
DevInfo.fpga2version = FPGA2Version;
FPGA_ReadVersion(3, &Major, &Year, &Month, &Day);
- usnprintf(FPGA3Version, 20, "%d.%d.%d.%d",Major,Year, Month, Day);
+ usnprintf(FPGA3Version, 30, "FPGA3: Ver %d %d/%d/20%d",HexToDecimal(Major), HexToDecimal(Day),HexToDecimal(Month),HexToDecimal(Year));
DevInfo.fpga3version = FPGA3Version;
Read_HW_Version(BoardVersion, AssyVersion);