File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 22
22
#include < thread>
23
23
24
24
#ifdef _WIN32
25
+ #define B57600 57600
25
26
#include < Windows.h>
26
27
#include < io.h>
27
28
#include < iostream>
35
36
36
37
#else
37
38
#include < unistd.h>
39
+ #include < termios.h>
38
40
#endif
39
41
40
42
using namespace radio_tool ::radio;
@@ -51,7 +53,8 @@ auto AilunceRadio::WriteFirmware(const std::string &file) const -> void
51
53
52
54
// XOR raw binary data before sending
53
55
fw.Encrypt ();
54
-
56
+
57
+ device.SetInterfaceAttribs (B57600, 0 );
55
58
auto fd = device.GetFD ();
56
59
// send 1 to start firmware upgrade
57
60
#ifdef _WIN32
@@ -62,7 +65,6 @@ auto AilunceRadio::WriteFirmware(const std::string &file) const -> void
62
65
std::this_thread::sleep_for (std::chrono::milliseconds (100 ));
63
66
64
67
auto r = fw.GetDataSegments ()[0 ];
65
- device.SetInterfaceAttribs (57600 , 0 );
66
68
device.Write (r.data );
67
69
}
68
70
Original file line number Diff line number Diff line change 51
51
/* error logging function */
52
52
#define YM_ERR (fmt , ...) do { printf(fmt, __VA_ARGS__); } while(0)
53
53
54
- FILE * global_fd = 0 ;
54
+ int global_fd = 0 ;
55
55
56
56
char __ym_getchar (int timeout_ms )
57
57
{
You can’t perform that action at this time.
0 commit comments