fprintf should return 2 including terminating character as well. formatting.
Some checks failed
Build on RHEL9 / build (push) Failing after 31s
Build on RHEL8 / build (push) Successful in 4m58s

This commit is contained in:
2026-01-06 09:53:55 +01:00
parent c154164eff
commit 66f9664bc4
6 changed files with 28 additions and 24 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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"