mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-24 23:07:17 +00:00
Revert "Merge pull request #11722 from Lovett1991/development"
This reverts commit 1da04746fd240e24df1616e9d221d8a934dffaed, reversing changes made to 638e016a47b1b43776217ba421f8ee024577dcb6.
This commit is contained in:
parent
b6b0ca1b6c
commit
e2b5df08f1
@ -47,9 +47,7 @@ struct HLW {
|
||||
uint32_t debug[HLW_SAMPLE_COUNT];
|
||||
#endif
|
||||
volatile uint32_t cf_pulse_length = 0;
|
||||
volatile uint32_t cf_summed_pulse_length = 0;
|
||||
volatile uint32_t cf_pulse_last_time = 0;
|
||||
volatile uint32_t cf_pulse_counter = 0;
|
||||
uint32_t cf_power_pulse_length = 0;
|
||||
|
||||
volatile uint32_t cf1_pulse_length = 0;
|
||||
@ -88,9 +86,7 @@ void HlwCfInterrupt(void) // Service Power
|
||||
Hlw.load_off = false;
|
||||
} else {
|
||||
Hlw.cf_pulse_length = us - Hlw.cf_pulse_last_time;
|
||||
Hlw.cf_summed_pulse_length += Hlw.cf_pulse_length;
|
||||
Hlw.cf_pulse_last_time = us;
|
||||
Hlw.cf_pulse_counter++;
|
||||
Hlw.energy_period_counter++;
|
||||
}
|
||||
Energy.data_valid[0] = 0;
|
||||
@ -128,14 +124,7 @@ void HlwEvery200ms(void)
|
||||
Hlw.cf_pulse_length = 0; // No load for some time
|
||||
Hlw.load_off = true;
|
||||
}
|
||||
|
||||
if(Hlw.cf_pulse_counter){
|
||||
Hlw.cf_power_pulse_length = Hlw.cf_summed_pulse_length/Hlw.cf_pulse_counter;
|
||||
Hlw.cf_summed_pulse_length=0;
|
||||
Hlw.cf_pulse_counter=0;
|
||||
} else {
|
||||
Hlw.cf_power_pulse_length=0;
|
||||
}
|
||||
Hlw.cf_power_pulse_length = Hlw.cf_pulse_length;
|
||||
|
||||
if (Hlw.cf_power_pulse_length && Energy.power_on && !Hlw.load_off) {
|
||||
hlw_w = (Hlw.power_ratio * Settings.energy_power_calibration) / Hlw.cf_power_pulse_length ; // W *10
|
||||
|
Loading…
x
Reference in New Issue
Block a user