added proper init routine for HW-version 3
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user