Clean up code and functionality

Clean up code and functionality
This commit is contained in:
Theo Arends 2019-05-18 16:17:05 +02:00
parent c54bcf4b9a
commit 866c9c4b1f

View File

@ -240,7 +240,7 @@ void HlwDrvInit(void)
hlw_model_type = 1; // HJL-01/BL0937
}
if (pin[GPIO_HLW_CF] < 99) { // HLW8012 or HJL-01 based device
if (pin[GPIO_HLW_CF] < 99) { // HLW8012 or HJL-01 based device Power monitor
hlw_ui_flag = 1; // Voltage on high
if (pin[GPIO_NRG_SEL_INV] < 99) {
@ -249,10 +249,11 @@ void HlwDrvInit(void)
hlw_ui_flag = 0; // Voltage on low
}
if (99 == pin[GPIO_NRG_SEL]) {
energy_current_available = false;
if (pin[GPIO_NRG_CF1] < 99) { // Voltage and/or Current monitor
if (99 == pin[GPIO_NRG_SEL]) { // Voltage and/or Current selector
energy_current_available = false; // Assume Voltage
}
if (99 == pin[GPIO_NRG_CF1]) {
} else {
energy_current_available = false;
energy_voltage_available = false;
}