mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
compile avalon driver on win32 and win64
This commit is contained in:
parent
2dea04704a
commit
50cf25942e
@ -17,10 +17,10 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/select.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#ifndef WIN32
|
||||
#include <sys/select.h>
|
||||
#include <termios.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@ -28,6 +28,7 @@
|
||||
#define O_CLOEXEC 0
|
||||
#endif
|
||||
#else
|
||||
#include "compat.h"
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
15
fpgautils.c
15
fpgautils.c
@ -592,4 +592,19 @@ int get_serial_cts(int fd)
|
||||
ioctl(fd, TIOCMGET, &flags);
|
||||
return (flags & TIOCM_CTS) ? 1 : 0;
|
||||
}
|
||||
#else
|
||||
int get_serial_cts(const int fd)
|
||||
{
|
||||
if (!fd)
|
||||
return -1;
|
||||
const HANDLE fh = (HANDLE)_get_osfhandle(fd);
|
||||
if (!fh)
|
||||
return -1;
|
||||
|
||||
DWORD flags;
|
||||
if (!GetCommModemStatus(fh, &flags))
|
||||
return -1;
|
||||
|
||||
return (flags & MS_CTS_ON) ? 1 : 0;
|
||||
}
|
||||
#endif // ! WIN32
|
||||
|
Loading…
Reference in New Issue
Block a user