Sync to Tasmota

Sync to Tasmota
This commit is contained in:
Adrian Scillato 2018-05-27 20:01:11 -03:00 committed by GitHub
commit da3c00c218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -371,7 +371,12 @@ bool CseSerialInput()
return 1;
}
} else {
if (0x5A == serial_in_byte) { // 0x5A - Packet header 2
if ((0x5A == serial_in_byte) && (serial_in_byte_counter)) { // 0x5A - Packet header 2
if (serial_in_byte_counter > 1) { // Sync buffer with data (issue #1907)
serial_in_buffer[0] = serial_in_buffer[--serial_in_byte_counter];
serial_in_byte_counter = 1;
AddLog_P(LOG_LEVEL_DEBUG, PSTR("CSE: Fixed out-of-sync"));
}
cse_receive_flag = 1;
} else {
serial_in_byte_counter = 0;

View File

@ -262,8 +262,8 @@ void SDM120Show(boolean json)
#ifdef USE_WEBSERVER
} else {
snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_SDM120_DATA, mqtt_data, voltage, current, active_power, apparent_power, reactive_power, power_factor, frequency, energy_total);
}
#endif // USE_WEBSERVER
}
}
/*********************************************************************************************\

View File

@ -317,8 +317,8 @@ void SDM630Show(boolean json)
active_power_l1, active_power_l2, active_power_l3,
reactive_power_l1, reactive_power_l2, reactive_power_l3,
power_factor_l1, power_factor_l2, power_factor_l3, energy_total);
}
#endif // USE_WEBSERVER
}
}
/*********************************************************************************************\