diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index acfb7a51..02f0322e 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -590,7 +590,7 @@ #endif #ifndef PULSEMETER_PIN -#define PULSEMETERL_PIN 5 +#define PULSEMETER_PIN 5 #endif #ifndef PULSEMETER_ENERGY_RATIO diff --git a/code/espurna/config/types.h b/code/espurna/config/types.h index 76033026..41d5b74f 100644 --- a/code/espurna/config/types.h +++ b/code/espurna/config/types.h @@ -285,6 +285,7 @@ //-------------------------------------------------------------------------------- // Magnitudes +// These should remain over time, do not modify their values, only add new ones at the end //-------------------------------------------------------------------------------- #define MAGNITUDE_NONE 0 diff --git a/code/espurna/sensors/PulseMeterSensor.h b/code/espurna/sensors/PulseMeterSensor.h index dc293880..0183392e 100644 --- a/code/espurna/sensors/PulseMeterSensor.h +++ b/code/espurna/sensors/PulseMeterSensor.h @@ -80,7 +80,7 @@ class PulseMeterSensor : public BaseSensor { // Address of the sensor (it could be the GPIO or I2C address) String address(unsigned char index) { - return String(gpio); + return String(_gpio); } // Pre-read hook (usually to populate registers with up-to-date data) @@ -169,7 +169,7 @@ class PulseMeterSensor : public BaseSensor { PulseMeterSensor * _pulsemeter_sensor_instance[10] = {NULL}; -void ICACHE_RAM_ATTR _pulseMeter_sensor_isr(unsigned char gpio) { +void ICACHE_RAM_ATTR _pulsemeter_sensor_isr(unsigned char gpio) { unsigned char index = gpio > 5 ? gpio-6 : gpio; if (_pulsemeter_sensor_instance[index]) { _pulsemeter_sensor_instance[index]->handleInterrupt(gpio);