Browse Source

Fully fit unsigned char in the format

master
Max Prokhorov 5 years ago
parent
commit
4ef069abb0
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      code/espurna/sensors/HLW8012Sensor.h

+ 2
- 2
code/espurna/sensors/HLW8012Sensor.h View File

@ -158,7 +158,7 @@ class HLW8012Sensor : public BaseSensor {
// Descriptive name of the sensor
String description() {
char buffer[25];
char buffer[28];
snprintf(buffer, sizeof(buffer), "HLW8012 @ GPIO(%u,%u,%u)", _sel, _cf, _cf1);
return String(buffer);
}
@ -170,7 +170,7 @@ class HLW8012Sensor : public BaseSensor {
// Address of the sensor (it could be the GPIO or I2C address)
String address(unsigned char index) {
char buffer[10];
char buffer[12];
snprintf(buffer, sizeof(buffer), "%u:%u:%u", _sel, _cf, _cf1);
return String(buffer);
}


Loading…
Cancel
Save