forked from PaulStoffregen/Phazerville-Screen-Capture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusb.h
43 lines (34 loc) · 1.01 KB
/
usb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include "gui.h"
#ifdef WINDOWS
#if 0
#define printf(...) printf_logfile(__VA_ARGS__) // send all printf to a log file
#else
#define printf(...) // just discard all printf
#endif
int printf_logfile(const char *format, ...) __attribute__((format (printf, 1, 2)));
#endif // WINDOWS
extern volatile bool quit_all_threads;
// wxThread instances must be created on the heap with C++ new.
// If wxTHREAD_DETACHED is used, no other functions can be
// called after Run() starts the thread running.
class USB_Device_Detect_Thread : public wxThread
{
public:
USB_Device_Detect_Thread(MyFrame *window) :
wxThread(wxTHREAD_DETACHED), main_window(window) {}
virtual ExitCode Entry();
private:
MyFrame *main_window;
};
class USB_Communication_Thread : public wxThread
{
public:
USB_Communication_Thread(MyFrame *window, char *path) :
wxThread(wxTHREAD_DETACHED), main_window(window), devpath(path) {}
virtual ExitCode Entry();
void receive_data(const char *str);
private:
MyFrame *main_window;
char *devpath;
};