Регистр модбас Resolution переименован в Config регистр
This commit is contained in:
@@ -44,7 +44,7 @@ typedef struct
|
||||
{
|
||||
uint16_t Location;
|
||||
uint16_t ROM[4];
|
||||
uint16_t Resolution;
|
||||
uint16_t Config;
|
||||
uint16_t Status;
|
||||
}MB_SensorParamsTypeDef;
|
||||
/**
|
||||
|
||||
@@ -112,7 +112,7 @@ void PYModule_ReadSensor(DALLAS_HandleTypeDef *hdallas, PCHSens_TypeDef *pchsens
|
||||
if(Dallas_ReadScratchpad(&sensor->sens) == HAL_OK)
|
||||
{
|
||||
MB_DATA.InRegs.Response.Location = *(uint16_t *)&sensor->sens.hdallas->scratchpad.tHighRegister;
|
||||
MB_DATA.InRegs.Response.Resolution = sensor->sens.hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.Config = sensor->sens.hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.ROM[0] = __REV16((sensor->sens.sensROM) & 0xFFFF);
|
||||
MB_DATA.InRegs.Response.ROM[1] = __REV16((sensor->sens.sensROM >> 16) & 0xFFFF);
|
||||
MB_DATA.InRegs.Response.ROM[2] = __REV16((sensor->sens.sensROM >> 32) & 0xFFFF);
|
||||
@@ -122,7 +122,7 @@ void PYModule_ReadSensor(DALLAS_HandleTypeDef *hdallas, PCHSens_TypeDef *pchsens
|
||||
else
|
||||
{
|
||||
MB_DATA.InRegs.Response.Location = MB_DATA.HoldRegs.InitStruct.Location;
|
||||
MB_DATA.InRegs.Response.Resolution = 0;
|
||||
MB_DATA.InRegs.Response.Config = 0;
|
||||
MB_DATA.InRegs.Response.ROM[0] = 0;
|
||||
MB_DATA.InRegs.Response.ROM[1] = 0;
|
||||
MB_DATA.InRegs.Response.ROM[2] = 0;
|
||||
@@ -137,7 +137,7 @@ void PYModule_ReadSensor(DALLAS_HandleTypeDef *hdallas, PCHSens_TypeDef *pchsens
|
||||
if(DS18B20_ReadScratchpad(hdallas->onewire, (uint8_t *)MB_DATA.HoldRegs.InitStruct.ROM, (uint8_t *)&hdallas->scratchpad) == HAL_OK)
|
||||
{
|
||||
MB_DATA.InRegs.Response.Location = *(uint16_t *)&hdallas->scratchpad.tHighRegister;
|
||||
MB_DATA.InRegs.Response.Resolution = hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.Config = hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.ROM[0] = MB_DATA.HoldRegs.InitStruct.ROM[0];
|
||||
MB_DATA.InRegs.Response.ROM[1] = MB_DATA.HoldRegs.InitStruct.ROM[1];
|
||||
MB_DATA.InRegs.Response.ROM[2] = MB_DATA.HoldRegs.InitStruct.ROM[2];
|
||||
@@ -147,7 +147,7 @@ void PYModule_ReadSensor(DALLAS_HandleTypeDef *hdallas, PCHSens_TypeDef *pchsens
|
||||
else
|
||||
{
|
||||
MB_DATA.InRegs.Response.Location = 0;
|
||||
MB_DATA.InRegs.Response.Resolution = 0;
|
||||
MB_DATA.InRegs.Response.Config = 0;
|
||||
MB_DATA.InRegs.Response.ROM[0] = MB_DATA.HoldRegs.InitStruct.ROM[0];
|
||||
MB_DATA.InRegs.Response.ROM[1] = MB_DATA.HoldRegs.InitStruct.ROM[1];
|
||||
MB_DATA.InRegs.Response.ROM[2] = MB_DATA.HoldRegs.InitStruct.ROM[2];
|
||||
@@ -177,7 +177,7 @@ void PYModule_InitSensor(PCHSens_TypeDef *pchsens)
|
||||
if(PCHSens_InitNewSensor(&hdallas1, sensor, connectROM) == HAL_OK)
|
||||
{
|
||||
MB_DATA.InRegs.Response.Location = *(uint16_t *)&sensor->sens.hdallas->scratchpad.tHighRegister;
|
||||
MB_DATA.InRegs.Response.Resolution = sensor->sens.hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.Config = sensor->sens.hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.ROM[0] = __REV16((sensor->sens.sensROM) & 0xFFFF);
|
||||
MB_DATA.InRegs.Response.ROM[1] = __REV16((sensor->sens.sensROM >> 16) & 0xFFFF);
|
||||
MB_DATA.InRegs.Response.ROM[2] = __REV16((sensor->sens.sensROM >> 32) & 0xFFFF);
|
||||
@@ -187,7 +187,7 @@ void PYModule_InitSensor(PCHSens_TypeDef *pchsens)
|
||||
else
|
||||
{
|
||||
MB_DATA.InRegs.Response.Location = MB_DATA.HoldRegs.InitStruct.Location;
|
||||
MB_DATA.InRegs.Response.Resolution = 0;
|
||||
MB_DATA.InRegs.Response.Config = 0;
|
||||
MB_DATA.InRegs.Response.ROM[0] = MB_DATA.HoldRegs.InitStruct.ROM[0];
|
||||
MB_DATA.InRegs.Response.ROM[1] = MB_DATA.HoldRegs.InitStruct.ROM[1];
|
||||
MB_DATA.InRegs.Response.ROM[2] = MB_DATA.HoldRegs.InitStruct.ROM[2];
|
||||
@@ -209,7 +209,7 @@ void PYModule_DeInitSensor(PCHSens_TypeDef *pchsens)
|
||||
if(PCHSens_UndefineSensor(sensor) != HAL_OK)
|
||||
{
|
||||
MB_DATA.InRegs.Response.Location = *(uint16_t *)&sensor->sens.hdallas->scratchpad.tHighRegister;
|
||||
MB_DATA.InRegs.Response.Resolution = sensor->sens.hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.Config = sensor->sens.hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.ROM[0] = __REV16((sensor->sens.sensROM) & 0xFFFF);
|
||||
MB_DATA.InRegs.Response.ROM[1] = __REV16((sensor->sens.sensROM >> 16) & 0xFFFF);
|
||||
MB_DATA.InRegs.Response.ROM[2] = __REV16((sensor->sens.sensROM >> 32) & 0xFFFF);
|
||||
@@ -219,7 +219,7 @@ void PYModule_DeInitSensor(PCHSens_TypeDef *pchsens)
|
||||
else
|
||||
{
|
||||
MB_DATA.InRegs.Response.Location = *(uint16_t *)&sensor->sens.hdallas->scratchpad.tHighRegister;
|
||||
MB_DATA.InRegs.Response.Resolution = sensor->sens.hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.Config = sensor->sens.hdallas->scratchpad.ConfigRegister;
|
||||
MB_DATA.InRegs.Response.ROM[0] = __REV16((sensor->sens.sensROM) & 0xFFFF);
|
||||
MB_DATA.InRegs.Response.ROM[1] = __REV16((sensor->sens.sensROM >> 16) & 0xFFFF);
|
||||
MB_DATA.InRegs.Response.ROM[2] = __REV16((sensor->sens.sensROM >> 32) & 0xFFFF);
|
||||
|
||||
Reference in New Issue
Block a user