Commit b9cf8eae authored by Abdelali Elaazzouzi's avatar Abdelali Elaazzouzi

bugs

parent c8c9ab86
......@@ -56,6 +56,8 @@ static const int32 D_COEF_05HC_REGISTER = 4972;
static const int32 C_COEF_06HC_REGISTER = 4970;
static const int32 D_COEF_06HC_REGISTER = 4973;
static const float64 FACTOR = 10000.;
/*
* Status
*/
......
......@@ -54,17 +54,17 @@ void RealD16EurothermHumidityDriver::init() {
* writeParam
*/
void RealD16EurothermHumidityDriver::writeParam() {
int16 value = (int16) (owner()->cCoef04HC() * 1000.);
int16 value = (int16) (owner()->cCoef04HC() * FACTOR);
owner()->writeSingleRegister(C_COEF_04HC_REGISTER, value);
value = (int16) (owner()->dCoef04HC() * 1000.);
value = (int16) (owner()->dCoef04HC() * FACTOR);
owner()->writeSingleRegister(D_COEF_04HC_REGISTER, value);
value = (int16) (owner()->cCoef05HC() * 1000.);
value = (int16) (owner()->cCoef05HC() * FACTOR);
owner()->writeSingleRegister(C_COEF_05HC_REGISTER, value);
value = (int16) (owner()->dCoef05HC() * 1000.);
value = (int16) (owner()->dCoef05HC() * FACTOR);
owner()->writeSingleRegister(D_COEF_05HC_REGISTER, value);
value = (int16) (owner()->cCoef06HC() * 1000.);
value = (int16) (owner()->cCoef06HC() * FACTOR);
owner()->writeSingleRegister(C_COEF_06HC_REGISTER, value);
value = (int16) (owner()->dCoef06HC() * 1000.);
value = (int16) (owner()->dCoef06HC() * FACTOR);
owner()->writeSingleRegister(D_COEF_06HC_REGISTER, value);
}
......@@ -85,17 +85,17 @@ void RealD16EurothermHumidityDriver::readParam() {
break;
}
value = owner()->readInputRegister(C_COEF_04HC_REGISTER);
owner()->cCoef04HC = (float64) value / 1000.0;
owner()->cCoef04HC = (float64) value / FACTOR;
value = owner()->readInputRegister(D_COEF_04HC_REGISTER);
owner()->dCoef04HC = (float64) value / 1000.0;
owner()->dCoef04HC = (float64) value / FACTOR;
value = owner()->readInputRegister(C_COEF_05HC_REGISTER);
owner()->cCoef05HC = (float64) value / 1000.0;
owner()->cCoef05HC = (float64) value / FACTOR;
value = owner()->readInputRegister(D_COEF_05HC_REGISTER);
owner()->dCoef05HC = (float64) value / 1000.0;
owner()->dCoef05HC = (float64) value / FACTOR;
value = owner()->readInputRegister(C_COEF_06HC_REGISTER);
owner()->cCoef06HC = (float64) value / 1000.0;
owner()->cCoef06HC = (float64) value / FACTOR;
value = owner()->readInputRegister(D_COEF_06HC_REGISTER);
owner()->dCoef06HC = (float64) value / 1000.0;
owner()->dCoef06HC = (float64) value / FACTOR;
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment