|
|
@ -23,6 +23,8 @@ void ZCanBoardModule::initialize(int32_t moduleId, hardware_config_t *hcfg) { |
|
|
|
m_output[i].initAsOutput(cfg->pin, cfg->mode, cfg->mirror, cfg->initLevel); |
|
|
|
m_output_num++; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
int32_t ZCanBoardModule::getid(int32_t *id) { |
|
|
|
*id = module_id; |
|
|
@ -109,14 +111,14 @@ int32_t ZCanBoardModule::readoutput() { |
|
|
|
} |
|
|
|
|
|
|
|
int32_t ZCanBoardModule::readTemperature(int32_t sensorId, int32_t &temperature_val) { |
|
|
|
if (sensorId < 0 || sensorId >= ZARRAY_SIZE(temperature_sensor)) { |
|
|
|
if (sensorId < 0 || sensorId >= ZARRAY_SIZE(m_cfg.temperature_sensor)) { |
|
|
|
return err::kmodule_not_find_config_index; |
|
|
|
} |
|
|
|
|
|
|
|
if (temperature_sensor[sensorId] == nullptr) { |
|
|
|
if (m_cfg.temperature_sensor[sensorId] == nullptr) { |
|
|
|
return err::kmodule_not_find_config_index; |
|
|
|
} |
|
|
|
return temperature_sensor[sensorId]->getTemperature(temperature_val); |
|
|
|
return m_cfg.temperature_sensor[sensorId]->getTemperature(temperature_val); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t ZCanBoardModule::readPwmDuty(int32_t pwmId, int32_t &duty) { |
|
|
|