mirror of https://github.com/arendst/Tasmota.git
Bump version to 6.6.0.9
Change theoretical baudrate range to 300..19660500 bps in 300 increments (#6294)
This commit is contained in:
parent
387c10f118
commit
9af67a5278
|
@ -1,4 +1,7 @@
|
|||
/*********************************************************************************************\
|
||||
* 6.6.0.9 20190828
|
||||
* Change theoretical baudrate range to 300..19660500 bps in 300 increments (#6294)
|
||||
*
|
||||
* 6.6.0.8 20190827
|
||||
* Add Tuya Energy monitoring by Shantur Rathore
|
||||
* Add phase 1 Domoticz P1 Smart Meter support using energy sensors handled by xdrv_03_energy.ino based on an idea by pablozg
|
||||
|
|
|
@ -205,7 +205,7 @@ struct SYSCFG {
|
|||
int8_t timezone; // 016
|
||||
char ota_url[101]; // 017
|
||||
char mqtt_prefix[3][11]; // 07C
|
||||
uint8_t baudrate; // 09D
|
||||
uint8_t ex_baudrate; // 09D - Free since 6.6.0.9
|
||||
uint8_t seriallog_level; // 09E
|
||||
uint8_t sta_config; // 09F
|
||||
uint8_t sta_active; // 0A0
|
||||
|
@ -288,7 +288,7 @@ struct SYSCFG {
|
|||
char friendlyname[MAX_FRIENDLYNAMES][33]; // 3AC
|
||||
char switch_topic[33]; // 430
|
||||
char serial_delimiter; // 451
|
||||
uint8_t sbaudrate; // 452
|
||||
uint8_t ex_sbaudrate; // 452 - Free since 6.6.0.9
|
||||
uint8_t sleep; // 453
|
||||
uint16_t domoticz_switch_idx[MAX_DOMOTICZ_IDX]; // 454
|
||||
uint16_t domoticz_sensor_idx[MAX_DOMOTICZ_SNS_IDX]; // 45C
|
||||
|
@ -345,11 +345,9 @@ struct SYSCFG {
|
|||
uint8_t web_color[18][3]; // 73E
|
||||
uint16_t display_width; // 774
|
||||
uint16_t display_height; // 776
|
||||
|
||||
uint8_t free_778[4]; // 778
|
||||
|
||||
uint16_t baudrate; // 778
|
||||
uint16_t sbaudrate; // 77A
|
||||
EnergyUsage energy_usage; // 77C
|
||||
|
||||
// uint32_t drivers[3]; // 794 - 6.5.0.12 replaced by below three entries
|
||||
uint32_t adc_param1; // 794
|
||||
uint32_t adc_param2; // 798
|
||||
|
|
|
@ -596,8 +596,8 @@ void SettingsDefaultSet2(void)
|
|||
// for (uint32_t i = 1; i < MAX_PULSETIMERS; i++) { Settings.pulse_timer[i] = 0; }
|
||||
|
||||
// Serial
|
||||
Settings.baudrate = APP_BAUDRATE / 1200;
|
||||
Settings.sbaudrate = SOFT_BAUDRATE / 1200;
|
||||
Settings.baudrate = APP_BAUDRATE / 300;
|
||||
Settings.sbaudrate = SOFT_BAUDRATE / 300;
|
||||
Settings.serial_delimiter = 0xff;
|
||||
Settings.seriallog_level = SERIAL_LOG_LEVEL;
|
||||
|
||||
|
@ -960,10 +960,10 @@ void SettingsDelta(void)
|
|||
}
|
||||
}
|
||||
if (Settings.version < 0x050C0007) {
|
||||
Settings.baudrate = APP_BAUDRATE / 1200;
|
||||
Settings.baudrate = APP_BAUDRATE / 300;
|
||||
}
|
||||
if (Settings.version < 0x050C0008) {
|
||||
Settings.sbaudrate = SOFT_BAUDRATE / 1200;
|
||||
Settings.sbaudrate = SOFT_BAUDRATE / 300;
|
||||
Settings.serial_delimiter = 0xff;
|
||||
}
|
||||
if (Settings.version < 0x050C000A) {
|
||||
|
@ -1091,6 +1091,10 @@ void SettingsDelta(void)
|
|||
Settings.param[P_ENERGY_TARIFF2] = ENERGY_TARIFF2_HOUR;
|
||||
Settings.flag3.energy_weekend = ENERGY_TARIFF_WEEKEND;
|
||||
}
|
||||
if (Settings.version < 0x06060009) {
|
||||
Settings.baudrate = Settings.ex_baudrate * 4;
|
||||
Settings.sbaudrate = Settings.ex_sbaudrate * 4;
|
||||
}
|
||||
|
||||
Settings.version = VERSION;
|
||||
SettingsSave(1);
|
||||
|
|
|
@ -1476,7 +1476,7 @@ void setup(void)
|
|||
XdrvCall(FUNC_SETTINGS_OVERRIDE);
|
||||
}
|
||||
|
||||
baudrate = Settings.baudrate * 1200;
|
||||
baudrate = Settings.baudrate * 300;
|
||||
// mdns_delayed_start = Settings.param[P_MDNS_DELAYED_START];
|
||||
seriallog_level = Settings.seriallog_level;
|
||||
seriallog_timer = SERIALLOG_TIMER;
|
||||
|
|
|
@ -20,6 +20,6 @@
|
|||
#ifndef _SONOFF_VERSION_H_
|
||||
#define _SONOFF_VERSION_H_
|
||||
|
||||
const uint32_t VERSION = 0x06060008;
|
||||
const uint32_t VERSION = 0x06060009;
|
||||
|
||||
#endif // _SONOFF_VERSION_H_
|
||||
|
|
|
@ -774,7 +774,7 @@ int GetStateNumber(char *state_text)
|
|||
|
||||
void SetSerialBaudrate(int baudrate)
|
||||
{
|
||||
Settings.baudrate = baudrate / 1200;
|
||||
Settings.baudrate = baudrate / 300;
|
||||
if (Serial.baudRate() != baudrate) {
|
||||
if (seriallog_level) {
|
||||
AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_SET_BAUDRATE_TO " %d"), baudrate);
|
||||
|
@ -793,7 +793,7 @@ void ClaimSerial(void)
|
|||
AddLog_P(LOG_LEVEL_INFO, PSTR("SNS: Hardware Serial"));
|
||||
SetSeriallog(LOG_LEVEL_NONE);
|
||||
baudrate = Serial.baudRate();
|
||||
Settings.baudrate = baudrate / 1200;
|
||||
Settings.baudrate = baudrate / 300;
|
||||
}
|
||||
|
||||
void SerialSendRaw(char *codes)
|
||||
|
|
|
@ -961,12 +961,12 @@ void CmndSwitchDebounce(void)
|
|||
|
||||
void CmndBaudrate(void)
|
||||
{
|
||||
if (XdrvMailbox.payload > 1200) {
|
||||
XdrvMailbox.payload /= 1200; // Make it a valid baudrate
|
||||
baudrate = (XdrvMailbox.payload & 0xFF) * 1200;
|
||||
if (XdrvMailbox.payload >= 300) {
|
||||
XdrvMailbox.payload /= 300; // Make it a valid baudrate
|
||||
baudrate = (XdrvMailbox.payload & 0xFFFF) * 300;
|
||||
SetSerialBaudrate(baudrate);
|
||||
}
|
||||
ResponseCmndNumber(Settings.baudrate * 1200);
|
||||
ResponseCmndNumber(Settings.baudrate * 300);
|
||||
}
|
||||
|
||||
void CmndSerialSend(void)
|
||||
|
|
|
@ -86,7 +86,7 @@ void SerialBridgeInit(void)
|
|||
serial_bridge_active = false;
|
||||
if ((pin[GPIO_SBR_RX] < 99) && (pin[GPIO_SBR_TX] < 99)) {
|
||||
SerialBridgeSerial = new TasmotaSerial(pin[GPIO_SBR_RX], pin[GPIO_SBR_TX]);
|
||||
if (SerialBridgeSerial->begin(Settings.sbaudrate * 1200)) { // Baud rate is stored div 1200 so it fits into one byte
|
||||
if (SerialBridgeSerial->begin(Settings.sbaudrate * 300)) { // Baud rate is stored div 300 so it fits into 16 bits
|
||||
if (SerialBridgeSerial->hardwareSerial()) {
|
||||
ClaimSerial();
|
||||
serial_bridge_buffer = serial_in_buffer; // Use idle serial buffer to save RAM
|
||||
|
@ -141,12 +141,12 @@ void CmndSSerialSend(void)
|
|||
|
||||
void CmndSBaudrate(void)
|
||||
{
|
||||
if (XdrvMailbox.payload > 1200) {
|
||||
XdrvMailbox.payload /= 1200; // Make it a valid baudrate
|
||||
if (XdrvMailbox.payload >= 300) {
|
||||
XdrvMailbox.payload /= 300; // Make it a valid baudrate
|
||||
Settings.sbaudrate = XdrvMailbox.payload;
|
||||
SerialBridgeSerial->begin(Settings.sbaudrate * 1200); // Reinitialize serial port with new baud rate
|
||||
SerialBridgeSerial->begin(Settings.sbaudrate * 300); // Reinitialize serial port with new baud rate
|
||||
}
|
||||
ResponseCmndNumber(Settings.sbaudrate * 1200);
|
||||
ResponseCmndNumber(Settings.sbaudrate * 300);
|
||||
}
|
||||
|
||||
/*********************************************************************************************\
|
||||
|
|
Loading…
Reference in New Issue