From bd7f39ac68ed0810c5e4591f9ff3da7ab8b957a9 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 13 Oct 2026 16:42:54 +0200 Subject: [PATCH] minor --- .../slsDetectorFunctionList.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index efd4f0d06..516ff50be 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -2956,15 +2956,18 @@ void updateHDRActivationTime() { double percentage = (isSynchrotron ? HDR_SYNC_ACTIVATION_TIME_PERCENT : HDR_FEL_ACTIVATION_TIME_PERCENT) / 100; - uint32_t activationTime = (uint32_t)(expTimeInClks * percentage); - if (activationTime > HDR_MAX_ACTIVATION_TIME_VAL) { - activationTime = HDR_MAX_ACTIVATION_TIME_VAL; + uint32_t activationTimeInClks = (uint32_t)(expTimeInClks * percentage); + if (activationTimeInClks > HDR_MAX_ACTIVATION_TIME_VAL) { + LOG(logWARNING, ("HDR Activation Time (%u clocks) exceeds maximum " + "value. Capping to %d clocks\n", + activationTimeInClks, HDR_MAX_ACTIVATION_TIME_VAL)); + activationTimeInClks = HDR_MAX_ACTIVATION_TIME_VAL; } LOG(logINFO, ("Updating HDR Activation Time to %d clocks (%.2f%% of " "exposure time)\n", - activationTime, percentage * 100.00)); + activationTimeInClks, percentage * 100.00)); bus_w(HDR_REG, bus_r(HDR_REG) & ~HDR_ACTIVATION_TIME_MSK); - bus_w(HDR_REG, (activationTime << HDR_ACTIVATION_TIME_OFST) & + bus_w(HDR_REG, (activationTimeInClks << HDR_ACTIVATION_TIME_OFST) & HDR_ACTIVATION_TIME_MSK); }