added support for stm32 hardware + some c++ cosmetic

This commit is contained in:
2018-11-03 11:50:23 +01:00
parent 4e4d558910
commit 1f60eb5d12
2 changed files with 220 additions and 116 deletions

View File

@@ -3,38 +3,41 @@
#include <QtCore>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <usb.h>
struct TransStruct{
struct TransStruct {
uint16_t time;
uint8_t id;
uint8_t update;
};
class HardwareSetup : public QThread
{
class HardwareSetup : public QThread {
Q_OBJECT
protected:
protected:
void run();
private:
private:
bool shellBefore;
bool deaBefore;
usb_dev_handle *handle;
usb_dev_handle * handle;
int fd;
bool getShell();
bool getDea();
int* findBit(int *array, int zahl);
int * findBit(int * array, int zahl);
bool stop;
int usbGetDescriptorString(usb_dev_handle *dev, int index, int langid, char *buf, int buflen);
usb_dev_handle *usbOpenDevice(int vendor, char *vendorName, int product, char *productName);
public:
int usbGetDescriptorString(usb_dev_handle * dev, int index, int langid,
char * buf, int buflen);
usb_dev_handle * usbOpenDevice(int vendor, char * vendorName, int product,
char * productName);
public:
void setStop();
~HardwareSetup();
HardwareSetup();
signals:
signals:
void Shell(int, int);
void Dea(int, int);
};