diff --git a/components/sensors/i2ceeprom/m24lrxxe_i2c_eeprom.cpp b/components/sensors/i2ceeprom/m24lrxxe_i2c_eeprom.cpp index 028fdd4..904e06e 100644 --- a/components/sensors/i2ceeprom/m24lrxxe_i2c_eeprom.cpp +++ b/components/sensors/i2ceeprom/m24lrxxe_i2c_eeprom.cpp @@ -1,5 +1,6 @@ #include "m24lrxxe_i2c_eeprom.hpp" using namespace iflytop; +#ifdef HAL_I2C_MODULE_ENABLED #define DATA_ADD 0x53 #define CONFIG_ADD 0x57 @@ -62,3 +63,5 @@ int32_t M24LRXXE_I2C_EEPROM::read_reg(int32_t add, uint32_t* regval) { return halstatustoerr(status); } #endif + +#endif \ No newline at end of file diff --git a/components/sensors/i2ceeprom/p24c16_eeprom.cpp b/components/sensors/i2ceeprom/p24c16_eeprom.cpp index db14325..1eb5e13 100644 --- a/components/sensors/i2ceeprom/p24c16_eeprom.cpp +++ b/components/sensors/i2ceeprom/p24c16_eeprom.cpp @@ -1,5 +1,6 @@ #include "p24c16_eeprom.hpp" using namespace iflytop; +#ifdef HAL_I2C_MODULE_ENABLED #define DATA_ADD 0x50 @@ -61,3 +62,4 @@ int32_t P24C16::read32(uint16_t add, uint32_t* val) { HAL_StatusTypeDef status = HAL_I2C_Mem_Read(m_i2c_handle, deviceadd << 1, regadd, I2C_MEMADD_SIZE_8BIT, (uint8_t*)val, 4, 10); return halstatustoerr(status); } +#endif \ No newline at end of file diff --git a/components/water_cooling_temperature_control_module/water_cooling_temperature_control_module.cpp b/components/water_cooling_temperature_control_module/water_cooling_temperature_control_module.cpp index cdaaa6b..1e93208 100644 --- a/components/water_cooling_temperature_control_module/water_cooling_temperature_control_module.cpp +++ b/components/water_cooling_temperature_control_module/water_cooling_temperature_control_module.cpp @@ -14,6 +14,14 @@ using namespace iflytop; #define ACTION_TEST_ENABLE_LOG 5 #define ACTION_TEST_DISABLE_LOG 6 +static int32_t prvabs(int32_t v){ + if(v<0){ + return -v; + }else{ + return v; + } +} + void WaterCoolingTemperatureControlModule::initialize(int32_t id, config_t* cfg, hardwared_config_t* hardwaredconfig) { m_id = id; m_hardwared_config = *hardwaredconfig; @@ -197,7 +205,7 @@ void WaterCoolingTemperatureControlModule::workloop() { peltier_set_power_level(out); i++; if (i % 10 == 0) { - int32_t fanspeed = abs(out) * 2; + int32_t fanspeed = prvabs(out) * 2; if (fanspeed > 100) fanspeed = 100; if (fanspeed < m_cfg.min_fanlevel) fanspeed = m_cfg.min_fanlevel; fan_start(fanspeed); diff --git a/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp b/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp index 6fbb2e2..8c102ad 100644 --- a/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp +++ b/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp @@ -58,7 +58,7 @@ void MicroComputerModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, }); deviceManager->regOnRegValChangeEvent([this](int32_t moduleid, int32_t regindex, int32_t oldval, int32_t toval) { // - ZLOGI(TAG, "onRegValChangeEvent(%d,%d,%d->%d)", moduleid, regindex, oldval, toval); + ZLOGI(TAG, "onRegValChangeEvent(moduleId[%d], reg[%x], %d->%d)", moduleid, regindex, oldval, toval); }); }