From 3dae7b71a0390d7e333db2d22aa65a2a62fb0edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Fri, 25 May 2018 11:25:37 +0200 Subject: [PATCH 1/2] Added UART_MQTT_TERMINATION setting --- README.md | 2 +- code/espurna/config/general.h | 4 ++++ code/espurna/uartmqtt.ino | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4732fbda..b5d79f23 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ESPurna ("spark" in Catalan) is a custom firmware for ESP8285/ESP8266 based smart switches, lights and sensors. It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries. -[![version](https://img.shields.io/badge/version-1.12.6-brightgreen.svg)](CHANGELOG.md) +[![version](https://img.shields.io/badge/version-1.12.7a-brightgreen.svg)](CHANGELOG.md) [![branch](https://img.shields.io/badge/branch-dev-orange.svg)](https://github.org/xoseperez/espurna/tree/dev/) [![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=dev)](https://travis-ci.org/xoseperez/espurna) [![codacy](https://img.shields.io/codacy/grade/c9496e25cf07434cba786b462cb15f49/dev.svg)](https://www.codacy.com/app/xoseperez/espurna/dashboard) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 245792aa..2ca143ab 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -511,6 +511,10 @@ #define UART_MQTT_BAUDRATE 115200 // Serial speed #endif +#ifndef UART_MQTT_TERMINATION +#define UART_MQTT_TERMINATION '\n' // Termination character +#endif + #define UART_MQTT_BUFFER_SIZE 100 // UART buffer size // ----------------------------------------------------------------------------- diff --git a/code/espurna/uartmqtt.ino b/code/espurna/uartmqtt.ino index bc96878a..ed3132e6 100644 --- a/code/espurna/uartmqtt.ino +++ b/code/espurna/uartmqtt.ino @@ -32,15 +32,17 @@ void _uartmqttReceiveUART() { char rc = UART_MQTT_PORT.read(); - if (rc != '\n') { + if (rc != UART_MQTT_TERMINATION) { _uartmqttBuffer[ndx] = rc; if (ndx < UART_MQTT_BUFFER_SIZE - 1) ndx++; } else { + _uartmqttBuffer[ndx] = '\0'; _uartmqttNewData = true; ndx = 0; + } } From ea98f99fbc9151ef889333b191c4def2aeaf84df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Fri, 25 May 2018 11:25:47 +0200 Subject: [PATCH 2/2] Version 1.12.7a --- code/espurna/config/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/espurna/config/version.h b/code/espurna/config/version.h index 92575561..13b490d2 100644 --- a/code/espurna/config/version.h +++ b/code/espurna/config/version.h @@ -1,5 +1,5 @@ #define APP_NAME "ESPURNA" -#define APP_VERSION "1.12.6" +#define APP_VERSION "1.12.7a" #define APP_REVISION "db84006" #define APP_AUTHOR "xose.perez@gmail.com" #define APP_WEBSITE "http://tinkerman.cat"