From fc2455831422725ebbff0ee8a03de8e9671f6420 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 17 Mar 2023 14:42:11 +0100 Subject: [PATCH] formatting --- .../eigerDetectorServer/FebControl.c | 4 +- .../slsDetectorFunctionList.c | 53 ++++++++++--------- slsReceiverSoftware/src/Arping.cpp | 11 ++-- slsReceiverSoftware/src/MasterAttributes.cpp | 2 +- slsSupportLib/include/sls/versionAPI.h | 2 +- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.c b/slsDetectorServers/eigerDetectorServer/FebControl.c index 075942063..27acb91a0 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.c +++ b/slsDetectorServers/eigerDetectorServer/FebControl.c @@ -1742,7 +1742,7 @@ int Feb_Control_WriteRegister_BitMask(uint32_t offset, uint32_t data, int Feb_Control_ReadRegister_BitMask(uint32_t offset, uint32_t *retval, uint32_t bitmask) { - + uint32_t actualOffset = offset; char side[2][10] = {"right", "left"}; unsigned int addr[2] = {Feb_Control_rightAddress, Feb_Control_leftAddress}; @@ -2213,7 +2213,7 @@ int Feb_Control_GetFPGAHardwareVersion(int *retval) { } unsigned int value = 0; if (!Feb_Control_ReadRegister_BitMask(FEB_REG_STATUS, &value, - FEB_REG_STATUS_FX30_MSK)) { + FEB_REG_STATUS_FX30_MSK)) { LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to feb hardware version\n")); return 0; diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index 06771b537..11f2d7155 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -133,8 +133,8 @@ void basictests() { "Software Version : %s\n" "********************************************************\n", (unsigned int)ipadd, (long long unsigned int)macadd, - (long long int)fwversion, - (long long int)sw_fw_apiversion, REQUIRED_FIRMWARE_VERSION, swversion)); + (long long int)fwversion, (long long int)sw_fw_apiversion, + REQUIRED_FIRMWARE_VERSION, swversion)); // update default udpdstip and udpdstmac (1g is hardware ip and hardware // mac) @@ -406,35 +406,36 @@ void initControlServer() { Beb_Beb(); LOG(logDEBUG1, ("Control server: BEB Initialization done\n")); - // Getting the feb versions after initialization - char hversion[MAX_STR_LENGTH] = {0}; - memset(hversion, 0, MAX_STR_LENGTH); - getHardwareVersion(hversion); - int64_t fwversion = getFirmwareVersion(); - int64_t feblfwversion = getFrontEndFirmwareVersion(FRONT_LEFT); - int64_t febrfwversion = getFrontEndFirmwareVersion(FRONT_RIGHT); - LOG(logINFOBLUE, - ("\n********************************************************\n" - "Feb Versions\n" - "Hardware Version : %s\n" - "Firmware (Febl) Version : %lld\n" - "Firmware (Febr) Version : %lld\n" - "********************************************************\n", - hversion, (long long int)feblfwversion, - (long long int)febrfwversion)); + // Getting the feb versions after initialization + char hversion[MAX_STR_LENGTH] = {0}; + memset(hversion, 0, MAX_STR_LENGTH); + getHardwareVersion(hversion); + int64_t fwversion = getFirmwareVersion(); + int64_t feblfwversion = getFrontEndFirmwareVersion(FRONT_LEFT); + int64_t febrfwversion = getFrontEndFirmwareVersion(FRONT_RIGHT); + LOG(logINFOBLUE, + ("\n********************************************************\n" + "Feb Versions\n" + "Hardware Version : %s\n" + "Firmware (Febl) Version : %lld\n" + "Firmware (Febr) Version : %lld\n" + "********************************************************\n", + hversion, (long long int)feblfwversion, + (long long int)febrfwversion)); - // ensure febl, febr and beb fw versions are the same - if (fwversion != feblfwversion || fwversion != febrfwversion) { - sprintf(initErrorMessage, + // ensure febl, febr and beb fw versions are the same + if (fwversion != feblfwversion || fwversion != febrfwversion) { + sprintf( + initErrorMessage, "Inconsistent firmware versions in feb and beb. [Beb: %lld, " "Febl: %lld Febr: %lld]\n", (long long int)fwversion, (long long int)feblfwversion, (long long int)febrfwversion); - LOG(logERROR, (initErrorMessage)); - initError = FAIL; - return; - } - + LOG(logERROR, (initErrorMessage)); + initError = FAIL; + return; + } + #endif // also reads config file and deactivates setupDetector(); diff --git a/slsReceiverSoftware/src/Arping.cpp b/slsReceiverSoftware/src/Arping.cpp index edc1f4b93..7633e041b 100644 --- a/slsReceiverSoftware/src/Arping.cpp +++ b/slsReceiverSoftware/src/Arping.cpp @@ -5,9 +5,9 @@ #include #include +#include #include #include -#include namespace sls { @@ -17,9 +17,7 @@ namespace sls { #define gettid() syscall(SYS_gettid) #endif -void func(int signum) { - wait(NULL); -} +void func(int signum) { wait(NULL); } Arping::Arping() {} @@ -122,7 +120,8 @@ std::string Arping::ExecuteCommands() { FILE *sysFile = popen(cmd.c_str(), "r"); if (sysFile == NULL) { std::ostringstream os; - os << "Could not Arping (" << cmd << " ) : Popen fail (" << strerror(errno) << ')'; + os << "Could not Arping (" << cmd << " ) : Popen fail (" + << strerror(errno) << ')'; return os.str(); } @@ -134,7 +133,7 @@ std::string Arping::ExecuteCommands() { // check exit status of command if (pclose(sysFile)) { std::ostringstream os; - os << "Could not arping (" << cmd << ") : " << strerror(errno); + os << "Could not arping (" << cmd << ") : " << strerror(errno); return os.str(); } else { LOG(logDEBUG) << output; diff --git a/slsReceiverSoftware/src/MasterAttributes.cpp b/slsReceiverSoftware/src/MasterAttributes.cpp index ea65e41e2..ca7836eb7 100644 --- a/slsReceiverSoftware/src/MasterAttributes.cpp +++ b/slsReceiverSoftware/src/MasterAttributes.cpp @@ -636,7 +636,7 @@ void MasterAttributes::GetMoenchBinaryAttributes( #ifdef HDF5C void MasterAttributes::WriteMoenchHDF5Attributes(H5::H5File *fd, - H5::Group *group) { + H5::Group *group) { MasterAttributes::WriteHDF5Exptime(fd, group); MasterAttributes::WriteHDF5Period(fd, group); MasterAttributes::WriteHDF5NumUDPInterfaces(fd, group); diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index a079a110f..5a1a5fee8 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -10,4 +10,4 @@ #define APIMOENCH "developer 0x230224" #define APILIB "developer 0x230224" #define APIRECEIVER "developer 0x230224" -#define APIEIGER "developer 0x230224" +#define APIEIGER "developer 0x230224"