Merge branch '6.0.1.rc1' of github.com:slsdetectorgroup/slsDetectorPackage into 6.0.1.rc1

This commit is contained in:
2021-11-25 08:42:46 +01:00
42 changed files with 134 additions and 52 deletions

View File

@ -8,6 +8,8 @@
#include <stdio.h>
#include <sys/types.h>
#define BLACKFIN_DEFINED
int defineGPIOpins(char *mess);
int FPGAdontTouchFlash(char *mess);
int FPGATouchFlash(char *mess);

View File

@ -10,7 +10,6 @@
#include <sys/sysinfo.h>
#include <unistd.h> // usleep
#define BLACKFIN_DEFINED
/* global variables */
// clang-format off
#define MAX_TIME_FPGA_TOUCH_FLASH_US (10 * 1000 * 1000) // 10s
@ -275,7 +274,7 @@ int allowUpdate(char *mess, char *functionType) {
getKernelVersion(retvals);
snprintf(mess, MAX_STR_LENGTH,
"Could not update %s. Kernel version %s is too old to "
"update the Amd flash\n",
"update the Amd flash/ root directory. Most likely, blackfin needs rescue or replacement. Please contact us.\n",
functionType, retvals);
LOG(logERROR, (mess));
return FAIL;

View File

@ -4143,7 +4143,7 @@ int copy_detector_server(int file_des) {
LOG(logINFOBLUE, ("Copying server %s from host %s\n", sname, hostname));
char cmd[MAX_STR_LENGTH] = {0};
#if BLACKFIN_DEFINED
#ifdef BLACKFIN_DEFINED
// check update is allowed (Non Amd OR AMD + current kernel)
ret = allowUpdate(mess, "copy detector server");
#endif
@ -4663,6 +4663,13 @@ int set_read_n_rows(int file_des) {
"of %d\n",
arg, READ_N_ROWS_MULTIPLE);
LOG(logERROR, (mess));
}
// only for HW 2.0 (version = 3)
else if (isHardwareVersion2()) {
ret = FAIL;
strcpy(mess, "Could not set number of rows. Only available for "
"Hardware Board version 2.0.\n");
LOG(logERROR, (mess));
} else
#endif
{
@ -4702,7 +4709,7 @@ int get_read_n_rows(int file_des) {
retval = getReadNRows();
if (retval == -1) {
ret = FAIL;
sprintf(mess, "Could not get numbr of rows. \n");
sprintf(mess, "Could not get number of rows. \n");
LOG(logERROR, (mess));
} else {
LOG(logDEBUG1, ("number of rows retval: %u\n", retval));
@ -9389,11 +9396,14 @@ void receive_program_via_blackfin(int file_des, enum PROGRAM_INDEX index,
functionType);
LOG(logERROR, (mess));
#else
// check update is allowed (Non Amd OR AMD + current kernel)
ret = allowUpdate(mess, functionType);
if (ret == FAIL) {
Server_SendResult(file_des, INT32, NULL, 0);
return;
// only when writing to kernel flash or root directory
if (index != PROGRAM_FPGA) {
// check update is allowed (Non Amd OR AMD + current kernel)
ret = allowUpdate(mess, functionType);
if (ret == FAIL) {
Server_SendResult(file_des, INT32, NULL, 0);
return;
}
}
// open file and allocate memory for part program
@ -9615,9 +9625,9 @@ int set_update_mode(int file_des) {
return printSocketReadError();
LOG(logDEBUG1, ("Setting update mode to \n", arg));
#if BLACKFIN_DEFINED
#ifdef BLACKFIN_DEFINED
// check update is allowed (Non Amd OR AMD + current kernel)
ret = allowUpdate(mess, "copy detector server");
ret = allowUpdate(mess, "set/unset update mode");
#endif
if (ret == OK) {