added proper init routine for HW-version 3
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <usb.h>
|
#include <usb.h>
|
||||||
|
|
||||||
@@ -315,6 +316,21 @@ void HardwareSetup::run() {
|
|||||||
struct TransStruct * received;
|
struct TransStruct * received;
|
||||||
uint8_t uintBuf[4 * 6];
|
uint8_t uintBuf[4 * 6];
|
||||||
void * voidBuf;
|
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) {
|
while (!this->stop) {
|
||||||
|
|
||||||
// read data
|
// read data
|
||||||
|
|||||||
Reference in New Issue
Block a user