Browse Source

sensor: cast variable as UNUSED and prevent intended assignment warnings

master
Maxim Prokhorov 5 years ago
parent
commit
0f2226e177
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      code/espurna/sensor.ino

+ 4
- 3
code/espurna/sensor.ino View File

@ -238,6 +238,7 @@ void _sensorWebSocketOnConnected(JsonObject& root) {
for (unsigned char i=0; i<_sensors.size(); i++) { for (unsigned char i=0; i<_sensors.size(); i++) {
BaseSensor * sensor = _sensors[i]; BaseSensor * sensor = _sensors[i];
UNUSED(sensor);
#if EMON_ANALOG_SUPPORT #if EMON_ANALOG_SUPPORT
if (sensor->getID() == SENSOR_EMON_ANALOG_ID) { if (sensor->getID() == SENSOR_EMON_ANALOG_ID) {
@ -1378,17 +1379,17 @@ void _sensorConfigure() {
double value; double value;
HLW8012Sensor * sensor = (HLW8012Sensor *) _sensors[i]; HLW8012Sensor * sensor = (HLW8012Sensor *) _sensors[i];
if (value = getSetting("pwrExpectedC", 0).toFloat()) {
if ((value = getSetting("pwrExpectedC", 0).toFloat())) {
sensor->expectedCurrent(value); sensor->expectedCurrent(value);
setSetting("pwrRatioC", sensor->getCurrentRatio()); setSetting("pwrRatioC", sensor->getCurrentRatio());
} }
if (value = getSetting("pwrExpectedV", 0).toInt()) {
if ((value = getSetting("pwrExpectedV", 0).toInt())) {
sensor->expectedVoltage(value); sensor->expectedVoltage(value);
setSetting("pwrRatioV", sensor->getVoltageRatio()); setSetting("pwrRatioV", sensor->getVoltageRatio());
} }
if (value = getSetting("pwrExpectedP", 0).toInt()) {
if ((value = getSetting("pwrExpectedP", 0).toInt())) {
sensor->expectedPower(value); sensor->expectedPower(value);
setSetting("pwrRatioP", sensor->getPowerRatio()); setSetting("pwrRatioP", sensor->getPowerRatio());
} }


Loading…
Cancel
Save