Serial active on create

This commit is contained in:
Yuri Trikoz
2020-06-24 02:49:44 +03:00
parent cc3c17dfb2
commit e400de1e1c
3 changed files with 3 additions and 2 deletions

View File

@@ -153,7 +153,7 @@ class Terminal : public Print {
uint8_t curX = 0xff; uint8_t curX = 0xff;
unsigned long _lastReceived = 0; unsigned long _lastReceived = 0;
State state = ST_INACTIVE; State state;
Stream *_stream; Stream *_stream;
EditLine _line; EditLine _line;
char _cc_buf[32] = {0}; char _cc_buf[32] = {0};

View File

@@ -540,6 +540,7 @@ void serialBegin() {
term->setOnReadLine([](const char *str) { term->setOnReadLine([](const char *str) {
String line = String(str); String line = String(str);
pm.info("serial read: " + line); pm.info("serial read: " + line);
line.replace("#", " ");
order_loop += line + ","; order_loop += line + ",";
}); });
} }

View File

@@ -10,7 +10,7 @@ Terminal::Terminal(Stream *stream) : _stream{stream},
_color(false), _color(false),
_controlCodes(false), _controlCodes(false),
_echo(false), _echo(false),
_eol(CRLF){}; _eol(CRLF) { state = ST_NORMAL; };
void Terminal::setStream(Stream *stream) { void Terminal::setStream(Stream *stream) {
_stream = stream; _stream = stream;