variables name refactoring

This commit is contained in:
Emanuele Trabattoni
2025-07-23 22:39:40 +02:00
parent 8f5615a034
commit 59d8c2c2d4
12 changed files with 98 additions and 100 deletions

View File

@@ -20,9 +20,9 @@ namespace drivers
LOG_ERROR("Invalid Temperature Channel number", ch);
return MAXFLOAT;
}
auto lock = m_bus.getLock();
while (retries++ < maxRetries)
{
auto lock = m_bus.getLock();
if (m_bus.readHoldingRegisters(m_address, REG_TEMP + ch, 1, rawT) && !rawT.empty())
{
return rawT.front() / 10.0f;
@@ -39,9 +39,9 @@ namespace drivers
uint8_t retries(0);
std::vector<uint16_t> rawT;
std::vector<float> out;
auto lock = m_bus.getLock();
while (retries++ < maxRetries)
{
auto lock = m_bus.getLock();
if (m_bus.readHoldingRegisters(m_address, REG_TEMP, getNum(), rawT) && !rawT.empty())
{
out.reserve(rawT.size());
@@ -65,12 +65,12 @@ namespace drivers
uint8_t channel(0);
corr.resize(getNum()); // max number of temperature correction values is equal to number of sensors
auto lock = m_bus.getLock();
for (auto v : corr)
{ // convert to decimal degreees to register value
{
while (retries++ < maxRetries)
{
auto lock = m_bus.getLock();
if (m_bus.writeRegister(m_address, REG_TEMPCORR + channel, v*10))
if (m_bus.writeRegister(m_address, REG_TEMPCORR + channel, v * 10)) // convert to decimal degreees to register value
{
channel++;
delay(50);
@@ -97,7 +97,7 @@ namespace drivers
out.reserve(rawV.size());
for (auto v : rawV)
{
out.push_back(v/10.0f);
out.push_back(v / 10.0f);
}
return out;
}