Browse Source

Merge branch 'master' of 192.168.1.3:manufacturer_stm32/iflytop_stm32_os_sdk

master
zhaohe 2 years ago
parent
commit
9bfe3d4be8
  1. 3
      components/sensors/i2ceeprom/m24lrxxe_i2c_eeprom.cpp
  2. 2
      components/sensors/i2ceeprom/p24c16_eeprom.cpp
  3. 10
      components/water_cooling_temperature_control_module/water_cooling_temperature_control_module.cpp
  4. 2
      components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp

3
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

2
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

10
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);

2
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);
});
}

Loading…
Cancel
Save