diff --git a/README.md b/README.md index c30534c4..ca73c982 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ ESPurna ("spark" in Catalan) is a custom firmware for ESP8285/ESP8266 based smar It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries. [![version](https://img.shields.io/badge/version-1.13.4-brightgreen.svg)](CHANGELOG.md) -[![branch](https://img.shields.io/badge/branch-master-orange.svg)](https://github.com/xoseperez/espurna/tree/master/) +[![branch](https://img.shields.io/badge/branch-dev-orange.svg)](https://github.com/xoseperez/espurna/tree/dev/) [![license](https://img.shields.io/github/license/xoseperez/espurna.svg)](LICENSE) -[![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=master)](https://travis-ci.org/xoseperez/espurna) +[![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=dev)](https://travis-ci.org/xoseperez/espurna) [![codacy](https://api.codacy.com/project/badge/Grade/c9496e25cf07434cba786b462cb15f49)](https://www.codacy.com/app/xoseperez/espurna/dashboard) [![downloads](https://img.shields.io/github/downloads/xoseperez/espurna/total.svg)](https://github.com/xoseperez/espurna/releases)
diff --git a/code/espurna/debug.ino b/code/espurna/debug.ino index 2969d0ee..3c6671c2 100644 --- a/code/espurna/debug.ino +++ b/code/espurna/debug.ino @@ -19,9 +19,9 @@ char _udp_syslog_header[40] = {0}; #if DEBUG_SERIAL_SUPPORT void _debugSendSerial(const char* prefix, const char* data) { if (prefix && (prefix[0] != '\0')) { - Serial.print(prefix); + DEBUG_PORT.print(prefix); } - Serial.print(data); + DEBUG_PORT.print(data); } #endif diff --git a/code/espurna/sensors/PZEM004TSensor.h b/code/espurna/sensors/PZEM004TSensor.h index 8f5fda3f..9c775539 100644 --- a/code/espurna/sensors/PZEM004TSensor.h +++ b/code/espurna/sensors/PZEM004TSensor.h @@ -247,7 +247,11 @@ class PZEM004TSensor : public BaseSensor { _busy = true; // Clear buffer in case of late response(Timeout) - while(Serial.available() > 0) Serial.read(); + if (_serial) { + while(_serial.available() > 0) _serial.read(); + } else { + // This we cannot do it from outside the library + } float read; float* readings_p; diff --git a/code/espurna/terminal.ino b/code/espurna/terminal.ino index e7b1eb66..b87918eb 100644 --- a/code/espurna/terminal.ino +++ b/code/espurna/terminal.ino @@ -221,7 +221,7 @@ void _terminalLoop() { #if SERIAL_RX_ENABLED while (SERIAL_RX_PORT.available() > 0) { - char rc = Serial.read(); + char rc = SERIAL_RX_PORT.read(); _serial_rx_buffer[_serial_rx_pointer++] = rc; if ((_serial_rx_pointer == TERMINAL_BUFFER_SIZE) || (rc == 10)) { terminalInject(_serial_rx_buffer, (size_t) _serial_rx_pointer);