Merge branch 'developer' into jf_json_rxroi

This commit is contained in:
2023-07-28 12:18:29 +02:00
8 changed files with 46 additions and 62 deletions

View File

@ -1,16 +1,24 @@
--- ---
Checks: '*, Checks: '*,
-altera-*,
-android-cloexec-fopen, -android-cloexec-fopen,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic, -cppcoreguidelines-pro-bounds-pointer-arithmetic,
-fuchsia*, -fuchsia*,
-readability-else-after-return, -readability-else-after-return,
-readability-avoid-const-params-in-decls, -readability-avoid-const-params-in-decls,
-readability-identifier-length,
-cppcoreguidelines-pro-bounds-constant-array-index, -cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-type-reinterpret-cast, -cppcoreguidelines-pro-type-reinterpret-cast,
-llvm-header-guard, -llvm-header-guard,
-modernize-use-nodiscard,
-misc-non-private-member-variables-in-classes,
-readability-static-accessed-through-instance, -readability-static-accessed-through-instance,
-readability-braces-around-statements, -readability-braces-around-statements,
-readability-isolate-declaration,
-readability-implicit-bool-conversion,
-readability-identifier-length,
-readability-identifier-naming,
-hicpp-signed-bitwise, -hicpp-signed-bitwise,
-hicpp-no-array-decay, -hicpp-no-array-decay,
-hicpp-braces-around-statements, -hicpp-braces-around-statements,
@ -18,8 +26,6 @@ Checks: '*,
-google-readability-todo, -google-readability-todo,
-google-readability-braces-around-statements, -google-readability-braces-around-statements,
-modernize-use-trailing-return-type, -modernize-use-trailing-return-type,
-readability-isolate-declaration,
-readability-implicit-bool-conversion,
-llvmlibc-*' -llvmlibc-*'
HeaderFilterRegex: \.h HeaderFilterRegex: \.h

View File

@ -316,8 +316,8 @@
#define CONFIG_LED_DSBL_OFST (0) #define CONFIG_LED_DSBL_OFST (0)
#define CONFIG_LED_DSBL_MSK (0x00000001 << CONFIG_LED_DSBL_OFST) #define CONFIG_LED_DSBL_MSK (0x00000001 << CONFIG_LED_DSBL_OFST)
#define CONFIG_DSBL_ANLG_OTPT_OFST (8) #define CONFIG_ENBLE_ANLG_OTPT_OFST (8)
#define CONFIG_DSBL_ANLG_OTPT_MSK (0x00000001 << CONFIG_DSBL_ANLG_OTPT_OFST) #define CONFIG_ENBLE_ANLG_OTPT_MSK (0x00000001 << CONFIG_ENBLE_ANLG_OTPT_OFST)
#define CONFIG_ENBLE_DGTL_OTPT_OFST (9) #define CONFIG_ENBLE_DGTL_OTPT_OFST (9)
#define CONFIG_ENBLE_DGTL_OTPT_MSK (0x00000001 << CONFIG_ENBLE_DGTL_OTPT_OFST) #define CONFIG_ENBLE_DGTL_OTPT_MSK (0x00000001 << CONFIG_ENBLE_DGTL_OTPT_OFST)
#define CONFIG_ENBLE_TRNSCVR_OTPT_OFST (10) #define CONFIG_ENBLE_TRNSCVR_OTPT_OFST (10)

View File

@ -785,13 +785,8 @@ int setADCEnableMask(uint32_t mask) {
uint32_t getADCEnableMask() { return adcEnableMask_1g; } uint32_t getADCEnableMask() { return adcEnableMask_1g; }
void setADCEnableMask_10G(uint32_t mask) { void setADCEnableMask_10G(uint32_t mask) {
if (mask == 0u) {
LOG(logERROR, ("Cannot set 10gb adc mask to 0\n"));
return;
}
// convert 32 bit mask to 8 bit mask // convert 32 bit mask to 8 bit mask
uint8_t actualMask = 0; uint8_t actualMask = 0;
if (mask != 0) {
int ival = 0; int ival = 0;
for (int ich = 0; ich < NCHAN_ANALOG; ich = ich + 4) { for (int ich = 0; ich < NCHAN_ANALOG; ich = ich + 4) {
if ((1 << ich) & mask) { if ((1 << ich) & mask) {
@ -799,7 +794,6 @@ void setADCEnableMask_10G(uint32_t mask) {
} }
++ival; ++ival;
} }
}
LOG(logINFO, ("Setting adcEnableMask 10G to 0x%x (from 0x%08x)\n", LOG(logINFO, ("Setting adcEnableMask 10G to 0x%x (from 0x%08x)\n",
actualMask, mask)); actualMask, mask));
@ -919,15 +913,15 @@ int setReadoutMode(enum readoutMode mode) {
uint32_t addr = CONFIG_REG; uint32_t addr = CONFIG_REG;
uint32_t addr_readout_10g = READOUT_10G_ENABLE_REG; uint32_t addr_readout_10g = READOUT_10G_ENABLE_REG;
bus_w(addr, (bus_r(addr) | CONFIG_DSBL_ANLG_OTPT_MSK) & bus_w(addr,
(~CONFIG_ENBLE_DGTL_OTPT_MSK) & (bus_r(addr) & (~CONFIG_ENBLE_ANLG_OTPT_MSK) &
(~CONFIG_ENBLE_TRNSCVR_OTPT_MSK)); (~CONFIG_ENBLE_DGTL_OTPT_MSK) & (~CONFIG_ENBLE_TRNSCVR_OTPT_MSK)));
bus_w(addr_readout_10g, bus_r(addr_readout_10g) & bus_w(addr_readout_10g, bus_r(addr_readout_10g) &
(~READOUT_10G_ENABLE_ANLG_MSK) & (~READOUT_10G_ENABLE_ANLG_MSK) &
~(READOUT_10G_ENABLE_DGTL_MSK) & ~(READOUT_10G_ENABLE_DGTL_MSK) &
~(READOUT_10G_ENABLE_TRNSCVR_MSK)); ~(READOUT_10G_ENABLE_TRNSCVR_MSK));
if (analogEnable) { if (analogEnable) {
bus_w(addr, bus_r(addr) & ~(CONFIG_DSBL_ANLG_OTPT_MSK)); bus_w(addr, bus_r(addr) | (CONFIG_ENBLE_ANLG_OTPT_MSK));
bus_w(addr_readout_10g, bus_w(addr_readout_10g,
bus_r(addr_readout_10g) | bus_r(addr_readout_10g) |
((adcEnableMask_10g << READOUT_10G_ENABLE_ANLG_OFST) & ((adcEnableMask_10g << READOUT_10G_ENABLE_ANLG_OFST) &
@ -2240,16 +2234,6 @@ int startStateMachine() {
LOG(logINFO, ("Status Register: %08x\n", bus_r(STATUS_REG))); LOG(logINFO, ("Status Register: %08x\n", bus_r(STATUS_REG)));
// TODO: Temporary Matternhorn Specific ( will be moved to the pattern )
if (transceiverEnable) {
uint32_t addr = 0x202 << MEM_MAP_SHIFT;
bus_w(addr, bus_r(addr) | (1 << 1));
LOG(logINFOBLUE, ("Writing 1 to reg 0x202\n"))
usleep(1);
cleanFifos();
usleep(1);
}
return OK; return OK;
} }

View File

@ -4345,12 +4345,6 @@ int set_adc_enable_mask_10g(int file_des) {
#else #else
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
if (arg == 0u) {
ret = FAIL;
sprintf(mess,
"Not allowed to set adc mask of 0 due to data readout \n");
LOG(logERROR, (mess));
} else {
setADCEnableMask_10G(arg); setADCEnableMask_10G(arg);
uint32_t retval = getADCEnableMask_10G(); uint32_t retval = getADCEnableMask_10G();
if (arg != retval) { if (arg != retval) {
@ -4362,7 +4356,6 @@ int set_adc_enable_mask_10g(int file_des) {
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} }
} }
}
#endif #endif
return Server_SendResult(file_des, INT32, NULL, 0); return Server_SendResult(file_des, INT32, NULL, 0);
} }

View File

@ -30,7 +30,8 @@
// C includes // C includes
#include <stdint.h> #include <stdint.h>
#endif #endif
//Need macros for C compatibility
//NOLINTBEGIN(cppcoreguidelines-macro-usage)
#define BIT32_MASK 0xFFFFFFFF #define BIT32_MASK 0xFFFFFFFF
#define MAX_RX_DBIT 64 #define MAX_RX_DBIT 64
@ -79,7 +80,7 @@
#define DEFAULT_STREAMING_TIMER_IN_MS 500 #define DEFAULT_STREAMING_TIMER_IN_MS 500
#define NUM_RX_THREAD_IDS 9 #define NUM_RX_THREAD_IDS 9
//NOLINTEND(cppcoreguidelines-macro-usage)
#ifdef __cplusplus #ifdef __cplusplus
class slsDetectorDefs { class slsDetectorDefs {
public: public:

View File

@ -5,46 +5,46 @@
namespace sls { namespace sls {
struct RuntimeError : public std::runtime_error { class RuntimeError : public std::runtime_error {
public: public:
RuntimeError(); RuntimeError();
RuntimeError(const std::string &msg); explicit RuntimeError(const std::string &msg);
RuntimeError(const char *msg); explicit RuntimeError(const char *msg);
}; };
struct SharedMemoryError : public RuntimeError { class SharedMemoryError : public RuntimeError {
public: public:
SharedMemoryError(const std::string &msg); explicit SharedMemoryError(const std::string &msg);
}; };
struct SocketError : public RuntimeError { class SocketError : public RuntimeError {
public: public:
SocketError(const std::string &msg); explicit SocketError(const std::string &msg);
}; };
struct ZmqSocketError : public RuntimeError { class ZmqSocketError : public RuntimeError {
public: public:
ZmqSocketError(const std::string &msg); explicit ZmqSocketError(const std::string &msg);
}; };
struct NotImplementedError : public RuntimeError { class NotImplementedError : public RuntimeError {
public: public:
NotImplementedError(const std::string &msg); explicit NotImplementedError(const std::string &msg);
}; };
struct DetectorError : public RuntimeError { class DetectorError : public RuntimeError {
public: public:
DetectorError(const std::string &msg); explicit DetectorError(const std::string &msg);
}; };
struct ReceiverError : public RuntimeError { class ReceiverError : public RuntimeError {
public: public:
ReceiverError(const std::string &msg); explicit ReceiverError(const std::string &msg);
}; };
struct GuiError : public RuntimeError { class GuiError : public RuntimeError {
public: public:
GuiError(const std::string &msg); explicit GuiError(const std::string &msg);
}; };
} // namespace sls } // namespace sls

View File

@ -7,7 +7,7 @@
#define APIEIGER "developer 0x230525" #define APIEIGER "developer 0x230525"
#define APIGOTTHARD "developer 0x230615" #define APIGOTTHARD "developer 0x230615"
#define APIGOTTHARD2 "developer 0x230615" #define APIGOTTHARD2 "developer 0x230615"
#define APICTB "developer 0x230629"
#define APIMYTHEN3 "developer 0x230621" #define APIMYTHEN3 "developer 0x230621"
#define APIMOENCH "developer 0x230707" #define APIMOENCH "developer 0x230707"
#define APIJUNGFRAU "developer 0x230720" #define APIJUNGFRAU "developer 0x230720"
#define APICTB "developer 0x230720"