diff --git a/README.md b/README.md index 804c0bb..8df8bc6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ssh-copy-id iflytop@板子IP 编译: - ./build.sh + ./sh/build.sh 部署: ./sh/deploy.sh username ip diff --git a/demo/uart/test_uart232_1.cpp b/demo/uart/test_uart232_1.cpp index cdec78c..9526034 100644 --- a/demo/uart/test_uart232_1.cpp +++ b/demo/uart/test_uart232_1.cpp @@ -21,7 +21,13 @@ using namespace iflytop; int main(int argc, char const* argv[]) { Uart uart; - uart.open(UART_NAME, "115200"); + int ret = uart.open(UART_NAME, "115200"); + if (ret != 0) { + perror("open uart error"); + exit(1); + + } + thread th([&]() { // diff --git a/demo/uart/test_uart232_2.cpp b/demo/uart/test_uart232_2.cpp index 9edf997..9893684 100644 --- a/demo/uart/test_uart232_2.cpp +++ b/demo/uart/test_uart232_2.cpp @@ -21,7 +21,13 @@ using namespace iflytop; int main(int argc, char const* argv[]) { Uart uart; - uart.open(UART_NAME, "115200"); + int ret = uart.open(UART_NAME, "115200"); + if (ret != 0) { + perror("open uart error"); + exit(1); + + } + thread th([&]() { // diff --git a/demo/uart/test_uart485.cpp b/demo/uart/test_uart485.cpp index c693f69..bf24d69 100644 --- a/demo/uart/test_uart485.cpp +++ b/demo/uart/test_uart485.cpp @@ -21,7 +21,12 @@ using namespace iflytop; int main(int argc, char const* argv[]) { Uart uart; - uart.open(UART_NAME, "115200"); + int ret = uart.open(UART_NAME, "115200"); + if (ret != 0) { + perror("open uart error"); + exit(1); + + } thread th([&]() { // diff --git a/demo/uart/test_usbuart.cpp b/demo/uart/test_usbuart.cpp index 5e1a6ff..65b99a2 100644 --- a/demo/uart/test_usbuart.cpp +++ b/demo/uart/test_usbuart.cpp @@ -21,7 +21,12 @@ using namespace iflytop; int main(int argc, char const* argv[]) { Uart uart; - uart.open(UART_NAME, "115200"); + int ret = uart.open(UART_NAME, "115200"); + if (ret != 0) { + perror("open uart error"); + exit(1); + } + thread th([&]() { //