espressif/esp8266-platformio-device-nilm-power-meter/src/main.cpp
void ICACHE_RAM_ATTR measure(){
    digitalWrite(led_pin,HIGH);
    ttemp = t1;
    t2 = t1;
    t1 = millis();
    dt = t1 - t2;
    if (dt < bounce_value)
    {
        t1 = ttemp;
        digitalWrite(led_pin,LOW);
        return;
    }
    elpow = 3600.*1000.*1000./(electric_meter_pulses*dt);
    interrupt_counter++;
    digitalWrite(led_pin,LOW);
}
// Interrupt function for measuring the time between pulses and number of pulses
// Always stored in RAM
Interrupt function for measuring the time between pulses and number of pulses
Always stored in RAM
Interrupt function for measuring the time between pulses and number of pulses Always stored in RAM
void ICACHE_RAM_ATTR measure(){
    digitalWrite(led_pin,HIGH);
    ttemp = t1;
    t2 = t1;
    t1 = millis();
    dt = t1 - t2;
    if (dt < bounce_value)
    {
        t1 = ttemp;
        digitalWrite(led_pin,LOW);
        return;
    }
    elpow = 3600.*1000.*1000./(electric_meter_pulses*dt);
    interrupt_counter++;
    digitalWrite(led_pin,LOW);
}
void ICACHE_RAM_ATTR measure ( ) { digitalWrite ( led_pin , HIGH ) ; ttemp = t1 ; t2 = t1 ; t1 = millis ( ) ; dt = t1 - t2 ; if ( dt < bounce_value ) { t1 = ttemp ; digitalWrite ( led_pin , LOW ) ; return ; } elpow = 3600. * 1000. * 1000. / ( electric_meter_pulses * dt ) ; interrupt_counter ++ ; digitalWrite ( led_pin , LOW ) ; }
Interrupt function for measuring the time between pulses and number of pulses
Always stored in RAM
Interrupt function for measuring the time between pulses and number of pulses Always stored in RAM