mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-20 15:46:39 +01:00
fprintf should return 2 including terminating character as well. formatting.
This commit is contained in:
@@ -38,13 +38,15 @@ int XILINX_FMC_enable_all(char* error_message, int message_size) {
|
||||
snprintf(full_path, sizeof(full_path), "%s%s", FMC_BASE_PATH, file);
|
||||
FILE *fp = fopen(full_path, "w");
|
||||
if (fp == NULL) {
|
||||
snprintf(error_message, message_size, "XILINX_FMC: Couuld not enable.\n");
|
||||
snprintf(error_message, message_size,
|
||||
"XILINX_FMC: Couuld not enable.\n");
|
||||
LOG(logERROR, (error_message));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fprintf(fp, "1\n") != 1) {
|
||||
snprintf(error_message, message_size, "XILINX_FMC: Could not write enable.\n");
|
||||
if (fprintf(fp, "1\n") != 2) {
|
||||
snprintf(error_message, message_size,
|
||||
"XILINX_FMC: Could not write enable.\n");
|
||||
LOG(logERROR, (error_message));
|
||||
return 1;
|
||||
}
|
||||
@@ -64,12 +66,14 @@ int XILINX_FMC_disable_all(char* error_message, int message_size) {
|
||||
snprintf(full_path, sizeof(full_path), "%s%s", FMC_BASE_PATH, file);
|
||||
FILE *fp = fopen(full_path, "w");
|
||||
if (fp == NULL) {
|
||||
snprintf(error_message, message_size, "XILINX_FMC: Could not disable\n");
|
||||
snprintf(error_message, message_size,
|
||||
"XILINX_FMC: Could not disable\n");
|
||||
LOG(logERROR, (error_message));
|
||||
return 1;
|
||||
}
|
||||
if (fprintf(fp, "0\n") != 1) {
|
||||
snprintf(error_message, message_size, "XILINX_FMC: Could not write disable.\n");
|
||||
if (fprintf(fp, "0\n") != 2) {
|
||||
snprintf(error_message, message_size,
|
||||
"XILINX_FMC: Could not write disable.\n");
|
||||
LOG(logERROR, (error_message));
|
||||
return 1;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -9,8 +9,8 @@
|
||||
#include "sls/versionAPI.h"
|
||||
|
||||
#include "LTC2620_Driver.h"
|
||||
#include "XILINX_PLL.h"
|
||||
#include "XILINX_FMC.h"
|
||||
#include "XILINX_PLL.h"
|
||||
#include "loadPattern.h"
|
||||
#ifdef VIRTUAL
|
||||
#include "communication_funcs_UDP.h"
|
||||
@@ -266,8 +266,8 @@ int testFixedFPGAPattern() {
|
||||
return FAIL;
|
||||
}
|
||||
#endif
|
||||
LOG(logINFO,
|
||||
("\tSuccessfully read FPGA Fixed Pattern (0x%x)\n", FIXEDPATTERNREG_PRESET));
|
||||
LOG(logINFO, ("\tSuccessfully read FPGA Fixed Pattern (0x%x)\n",
|
||||
FIXEDPATTERNREG_PRESET));
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
#define APIGOTTHARD2 "0.0.0 0x250909"
|
||||
#define APIMOENCH "0.0.0 0x250909"
|
||||
#define APIEIGER "0.0.0 0x250909"
|
||||
#define APIXILINXCTB "0.0.0 0x260105"
|
||||
#define APIXILINXCTB "0.0.0 0x260106"
|
||||
#define APIJUNGFRAU "0.0.0 0x250909"
|
||||
#define APIMYTHEN3 "0.0.0 0x250922"
|
||||
|
||||
Reference in New Issue
Block a user