diff --git a/data/set.utilities.json b/data/set.utilities.json index 9314cd8b..c5d7ebc8 100644 --- a/data/set.utilities.json +++ b/data/set.utilities.json @@ -34,6 +34,59 @@ "title": "Сканировать", "action": "/set?i2c", "class": "btn btn-block btn-default" + }, + { + "type": "hr" + }, + { + "type": "h3", + "title": "UART" + }, + { + "type": "checkbox", + "name": "uart", + "title": "Включить UART", + "action": "/set?uart=[[uart]]", + "state": "{{uart}}" + }, + { + "type": "hr" + }, + { + "type": "h4", + "title": "Скорость", + "style": "width:60%;float:left;" + }, + { + "type": "input", + "title": "", + "name": "uartS-arg", + "state": "{{uartS}}", + "style": "width:40%;float:right" + }, + { + "type": "h4", + "title": "Пин TX", + "style": "width:60%;float:left;" + }, + { + "type": "input", + "title": "", + "name": "uartTX-arg", + "state": "{{uartTX}}", + "style": "width:40%;float:right" + }, + { + "type": "h4", + "title": "Пин RX", + "style": "width:60%;float:left;" + }, + { + "type": "input", + "title": "", + "name": "uartTX-arg", + "state": "{{uartRX}}", + "style": "width:40%;float:right" } ] } \ No newline at end of file diff --git a/src/SoftUART.cpp b/src/SoftUART.cpp index 1b6b0e7b..bf399adb 100644 --- a/src/SoftUART.cpp +++ b/src/SoftUART.cpp @@ -24,9 +24,9 @@ void uartHandle() { char inc; inc = myUART->read(); incStr += inc; - if (inc == 0x0A) { - parse(incStr); - incStr = ""; + if (inc == '\n') { + parse(incStr); + incStr = ""; } } }