added proper init routine for HW-version 3

This commit is contained in:
2018-11-22 22:19:30 +01:00
parent 80c006e081
commit 6b0554d6ac

View File

@@ -6,6 +6,7 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <usb.h>
@@ -315,6 +316,21 @@ void HardwareSetup::run() {
struct TransStruct * received;
uint8_t uintBuf[4 * 6];
void * voidBuf;
// flush existing data
struct termios config;
tcgetattr(fd, &config);
config.c_lflag = 0; // standard value is bad choosen
tcsetattr(fd, TCSANOW, &config);
cout << "alles io" << endl;
ssize_t length = read(fd, uintBuf, 24);
if (length < 24) {
tcflush(fd, TCIFLUSH);
// length = read(fd, uintBuf, 24);
}
while (!this->stop) {
// read data