From e400de1e1c3237a2eb1350ebeab12b37bfd176d8 Mon Sep 17 00:00:00 2001 From: Yuri Trikoz Date: Wed, 24 Jun 2020 02:49:44 +0300 Subject: [PATCH] Serial active on create --- include/Module/Terminal.h | 2 +- src/Cmd.cpp | 1 + src/Module/Terminal.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/Module/Terminal.h b/include/Module/Terminal.h index eb47417c..3d3234d8 100644 --- a/include/Module/Terminal.h +++ b/include/Module/Terminal.h @@ -153,7 +153,7 @@ class Terminal : public Print { uint8_t curX = 0xff; unsigned long _lastReceived = 0; - State state = ST_INACTIVE; + State state; Stream *_stream; EditLine _line; char _cc_buf[32] = {0}; diff --git a/src/Cmd.cpp b/src/Cmd.cpp index cd8d7c97..85b7e48e 100644 --- a/src/Cmd.cpp +++ b/src/Cmd.cpp @@ -540,6 +540,7 @@ void serialBegin() { term->setOnReadLine([](const char *str) { String line = String(str); pm.info("serial read: " + line); + line.replace("#", " "); order_loop += line + ","; }); } diff --git a/src/Module/Terminal.cpp b/src/Module/Terminal.cpp index b5321810..4de12887 100644 --- a/src/Module/Terminal.cpp +++ b/src/Module/Terminal.cpp @@ -10,7 +10,7 @@ Terminal::Terminal(Stream *stream) : _stream{stream}, _color(false), _controlCodes(false), _echo(false), - _eol(CRLF){}; + _eol(CRLF) { state = ST_NORMAL; }; void Terminal::setStream(Stream *stream) { _stream = stream;