UART in Progress

This commit is contained in:
Dmitry Borisenko
2020-12-06 00:59:47 +03:00
parent 4436991205
commit 8dd4d8491c
2 changed files with 56 additions and 3 deletions

View File

@@ -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"
}
]
}

View File

@@ -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 = "";
}
}
}