Skip to content

Commit e064681

Browse files
committedOct 6, 2022
feat: MacOS support
1 parent 90a1c2b commit e064681

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed
 

‎.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.idea
2+
.vscode
3+
CMakeFiles
4+
cmake_install.cmake
5+
CmakeCache.txt
6+
Makefile
7+
uart_flasher

‎CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
2+
SET(CMAKE_CXX_STANDARD 17)
23

34
PROJECT(uart_flasher)
45

‎main.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ int main(int argc, char** argv)
3030

3131
#ifdef _WIN32
3232
hComm = CreateFileA(argv[2], GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
33+
#elif __APPLE__
34+
hComm = open(argv[2], O_RDWR | O_NONBLOCK);
3335
#else
36+
std::cerr << "LLLcheck2pre" << std::endl;
3437
hComm = open(argv[2], O_RDWR);
38+
std::cerr << "LLLcheck2" << std::endl;
3539
#endif
3640

3741
if (hComm <= INVALID_HANDLE_VALUE)
@@ -134,7 +138,8 @@ int main(int argc, char** argv)
134138
std::cout << "Progress: " << lineinc << " %" << std::endl;
135139
}
136140

137-
//Sleep(10);
141+
// Sleep(10);
142+
// sleep(1);
138143
}
139144
}
140145

0 commit comments

Comments
 (0)
Please sign in to comment.