gotthard server works

This commit is contained in:
maliakal_d 2019-01-10 10:35:49 +01:00
parent 0a2c1d1406
commit 52785c6642
5 changed files with 7 additions and 5 deletions

View File

@ -27,6 +27,7 @@
#define LTC2620_PWR_DOWN_VAL (-100)
#define LTC2620_MIN_VAL (0)
#define LTC2620_MAX_VAL (4095) // 12 bits
#define LTC2620_MAX_STEPS (LTC2620_MAX_VAL + 1)
uint32_t LTC2620_Reg = 0x0;
uint32_t LTC2620_CsMask = 0x0;

View File

@ -28,8 +28,8 @@ int ConvertToDifferentRange(int inputMin, int inputMax, int outputMin, int outpu
return FAIL;
}
double value = double((inputValue - inputMin) * (outputMax - outputMin))
/ double(inputMax - inputMin) + outputMin;
double value = (double)((inputValue - inputMin) * (outputMax - outputMin))
/ (double)(inputMax - inputMin) + outputMin;
// double to integer conversion (if decimal places, round to integer)
if ((value - (int)value) > 0.0001) {
@ -40,3 +40,4 @@ int ConvertToDifferentRange(int inputMin, int inputMax, int outputMin, int outpu
FILE_LOG(logDEBUG1, ("\tConverted Ouput Value: %d\n", *outputValue));
return OK;
}

View File

@ -835,9 +835,9 @@ int set_dac(int file_des) {
// dacs
default:
if (mV && val > DAC_MAX_VOLTAGE_MV) {
if (mV && val > DAC_MAX_MV) {
ret = FAIL;
sprintf(mess,"Could not set dac %d to value %d. Allowed limits (0 - %d mV).\n", ind, val, DAC_MAX_VOLTAGE_MV);
sprintf(mess,"Could not set dac %d to value %d. Allowed limits (0 - %d mV).\n", ind, val, DAC_MAX_MV);
FILE_LOG(logERROR,(mess));
} else if (!mV && val > getMaxDacSteps() ) {
ret = FAIL;

View File

@ -2,7 +2,7 @@
#define APIRECEIVER 0x180927
#define APIEIGER 0x181031
#define APIJUNGFRAU 0x181102
#define APIGOTTHARD 0x181009
#define APIGOTTHARD 0x190108
#define APICTB 0x180101
#define APIMOENCH 0x180101