mirror of https://github.com/arendst/Tasmota.git
Merge branch 'development' of https://github.com/arendst/Tasmota into development
This commit is contained in:
commit
9da9866fd8
|
@ -195,7 +195,9 @@ const uint8_t OTA_ATTEMPTS = 10; // Number of times to try fetching t
|
|||
const uint8_t OTA_ATTEMPTS = 5; // Number of times to try fetching the new firmware
|
||||
#endif // ESP8266
|
||||
|
||||
const uint16_t INPUT_BUFFER_SIZE = 520; // Max number of characters in serial command buffer
|
||||
const uint16_t INPUT_BUFFER_SIZE = 520; // Max number of characters in Tasmota serial command buffer
|
||||
const uint16_t MIN_INPUT_BUFFER_SIZE = 256; // Max number of characters in Tasmota serial command buffer
|
||||
const uint16_t MAX_INPUT_BUFFER_SIZE = 2048; // Max number of characters in Arduino serial command buffer
|
||||
const uint16_t FLOATSZ = 16; // Max number of characters in float result from dtostrfd (max 32)
|
||||
const uint16_t CMDSZ = 24; // Max number of characters in command
|
||||
const uint16_t TOPSZ = 151; // Max number of characters in topic string
|
||||
|
|
|
@ -1830,16 +1830,19 @@ void CmndSerialConfig(void)
|
|||
|
||||
void CmndSerialBuffer(void) {
|
||||
// Allow non-pesistent serial receive buffer size change
|
||||
// between 256 (default) and 520 (INPUT_BUFFER_SIZE) characters
|
||||
// between MIN_INPUT_BUFFER_SIZE and MAX_INPUT_BUFFER_SIZE characters
|
||||
size_t size = 0;
|
||||
if (XdrvMailbox.data_len > 0) {
|
||||
size = XdrvMailbox.payload;
|
||||
if (XdrvMailbox.payload < 256) {
|
||||
size = 256;
|
||||
}
|
||||
if ((1 == XdrvMailbox.payload) || (XdrvMailbox.payload > INPUT_BUFFER_SIZE)) {
|
||||
if (1 == XdrvMailbox.payload) {
|
||||
size = INPUT_BUFFER_SIZE;
|
||||
}
|
||||
else if (XdrvMailbox.payload < MIN_INPUT_BUFFER_SIZE) {
|
||||
size = MIN_INPUT_BUFFER_SIZE;
|
||||
}
|
||||
else if (XdrvMailbox.payload > MAX_INPUT_BUFFER_SIZE) {
|
||||
size = MAX_INPUT_BUFFER_SIZE;
|
||||
}
|
||||
Serial.setRxBufferSize(size);
|
||||
}
|
||||
#ifdef ESP8266
|
||||
|
|
Loading…
Reference in New Issue