|
|
@ -21,6 +21,7 @@ void WaterCoolingTemperatureControlModule::initialize(int32_t id, config_t* cfg, |
|
|
|
ZGPIO::OutputGpioCfg_t ext_input[10]; |
|
|
|
ZGPIO::InputGpioCfg_t ext_output[10]; |
|
|
|
#endif
|
|
|
|
m_id = id; |
|
|
|
|
|
|
|
for (int32_t i = 0; i < ZARRAY_SIZE(hardwaredconfig->temperature_sensor); i++) { |
|
|
|
if (!hardwaredconfig->temperature_sensor[i]) break; |
|
|
@ -58,6 +59,7 @@ void WaterCoolingTemperatureControlModule::initialize(int32_t id, config_t* cfg, |
|
|
|
|
|
|
|
m_pidmodule.initialize(&cfg->pid_cfg); |
|
|
|
m_thread.init("WaterCoolingTemperatureControlModule"); |
|
|
|
m_cfg = *cfg; |
|
|
|
|
|
|
|
ZLOGI(TAG, "WaterCoolingTemperatureControlModule initialized..."); |
|
|
|
} |
|
|
@ -103,6 +105,8 @@ int32_t WaterCoolingTemperatureControlModule::module_xxx_reg(int32_t param_id, b |
|
|
|
PROCESS_REG(kreg_compute_interval, REG_GET(m_cfg.pidcompute_periodms), REG_SET(m_cfg.pidcompute_periodms)); |
|
|
|
PROCESS_REG(kreg_pid_target, REG_GET_FLOAT(m_target_temperature, 0.1), REG_SET_FLOAT(m_target_temperature, 0.1)); |
|
|
|
|
|
|
|
PROCESS_REG(kreg_module_private0, gettemperature_sensor_state(val), ACTION_NONE); |
|
|
|
|
|
|
|
PROCESS_REG(kreg_pid_nowoutput, REG_GET(m_pidmodule.get_output()), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_pid_feedbackval, REG_GET(read_pid_temperature()), ACTION_NONE); |
|
|
|
|
|
|
@ -112,10 +116,6 @@ int32_t WaterCoolingTemperatureControlModule::module_xxx_reg(int32_t param_id, b |
|
|
|
PROCESS_REG(kreg_module_errorcode, REG_GET(m_errorcode), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_module_initflag, REG_GET(module_get_inited_flag()), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_module_errorbitflag0, REG_GET(geterrorbitflag0()), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_module_errorbitflag1, REG_GET(geterrorbitflag1()), ACTION_NONE); |
|
|
|
|
|
|
|
PROCESS_REG(kreg_module_input_state, REG_GET(read_input_state()), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_module_output_state, REG_GET(read_output_io_state()), ACTION_NONE); |
|
|
|
|
|
|
|
PROCESS_REG(kreg_sensor_temperature0, REG_GET(getTemperatureSensorVal(0)), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_sensor_temperature1, REG_GET(getTemperatureSensorVal(1)), ACTION_NONE); |
|
|
@ -129,6 +129,13 @@ int32_t WaterCoolingTemperatureControlModule::module_xxx_reg(int32_t param_id, b |
|
|
|
} |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t WaterCoolingTemperatureControlModule::gettemperature_sensor_state(int32_t& state) { |
|
|
|
for (int32_t i = 0; i < m_n_temperature_sensor; i++) { |
|
|
|
state |= m_temperature_sensor[i]->isOnline() << i; |
|
|
|
} |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t WaterCoolingTemperatureControlModule::do_action(int32_t actioncode) { |
|
|
|
if (actioncode == ACTION_TEST_PELTIER_SET_POWER_LEVEL) { |
|
|
|
return test_peltier_set_power_level(m_reg.module_action_param1); |
|
|
|