diff --git a/drv/b15f.cpp b/drv/b15f.cpp index 249efec..0637124 100644 --- a/drv/b15f.cpp +++ b/drv/b15f.cpp @@ -11,6 +11,7 @@ void B15F::init() { std::cout << PRE << "Stelle Verbindung mit Adapter her... " << std::flush; + usart.setBaudrate(BAUDRATE); usart.openDevice(SERIAL_DEVICE); std::cout << "OK" << std::endl; diff --git a/drv/b15f.o b/drv/b15f.o index 947203e..00c28b9 100644 Binary files a/drv/b15f.o and b/drv/b15f.o differ diff --git a/drv/usart.cpp b/drv/usart.cpp index 5760d8e..4deff04 100644 --- a/drv/usart.cpp +++ b/drv/usart.cpp @@ -67,7 +67,7 @@ uint8_t USART::readByte(void) auto start = std::chrono::steady_clock::now(); auto end = start; uint16_t elapsed = 0; - while(elapsed < timeout) + while(elapsed < timeout * 100) { int n_ready; int code = ioctl(file_desc, FIONREAD, &n_ready); diff --git a/drv/usart.o b/drv/usart.o index da366a5..9e8a0be 100644 Binary files a/drv/usart.o and b/drv/usart.o differ diff --git a/main b/main index 2e92a82..03affce 100755 Binary files a/main and b/main differ diff --git a/main.cpp b/main.cpp index 5293528..22cd69f 100644 --- a/main.cpp +++ b/main.cpp @@ -182,10 +182,11 @@ void beispielFunktionen() int main() { - USART usart; - usart.openDevice("/dev/ttyUSB0"); - usart.closeDevice(); + beispielFunktionen(); + //USART usart; + //usart.openDevice("/dev/ttyUSB0"); + //usart.writeByte(5); std::cout << "Schluss." << std::endl; diff --git a/main.o b/main.o index e53cb55..b170546 100644 Binary files a/main.o and b/main.o differ