From 08a588bb016d0de1b149e9f9e0438d232f90b842 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 9 Jun 2021 12:31:26 +0200 Subject: [PATCH] wip: eiger stop acquisition send complete frmes --- .../eigerDetectorServer/FebControl.c | 16 +++++++++++++++- .../eigerDetectorServer/FebRegisterDefs.h | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.c b/slsDetectorServers/eigerDetectorServer/FebControl.c index 82440f60b..71f8816a6 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.c +++ b/slsDetectorServers/eigerDetectorServer/FebControl.c @@ -996,7 +996,21 @@ int Feb_Control_StartAcquisition() { return 1; } -int Feb_Control_StopAcquisition() { return Feb_Control_Reset(); } +int Feb_Control_StopAcquisition() { + if (!Feb_Control_Reset()) { + return 0; + } + if (Feb_Control_activated) { + if (!Feb_Interface_WriteRegister(Feb_Control_AddressToAll(), + DAQ_REG_CTRL, DAQ_CTRL_STOP, 0, 0)) { + LOG(logERROR, + ("Trouble stopping acquisition to send complete frames\n")); + return 0; + } + } + LOG(logINFO, ("Acquisition stop command sent!\n")); + return 1; +} int Feb_Control_SoftwareTrigger() { if (Feb_Control_activated) { diff --git a/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h b/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h index 5c8d1db9c..a5ecd79ff 100644 --- a/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h +++ b/slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h @@ -38,7 +38,7 @@ #define DAQ_CTRL_RESET 0x80000000 #define DAQ_CTRL_START 0x40000000 #define ACQ_CTRL_START 0x50000000 // this is 0x10000000 (acq) | 0x40000000 (daq) -#define DAQ_CTRL_STOP 0x00000000 +#define DAQ_CTRL_STOP 0x08000000 // sends last complete frame // direct chip commands to the DAQ_REG_CHIP_CMDS register #define DAQ_SET_STATIC_BIT 0x00000001