MinGW: Quickfix to make serial.c/ols.c compile.

Note: It does NOT actually work, yet, it only compiles!
This commit is contained in:
Uwe Hermann 2011-01-11 01:25:10 +01:00
parent 74b9b43836
commit 1fdb75e145
2 changed files with 18 additions and 1 deletions

View File

@ -95,10 +95,22 @@ int serial_close(int fd)
#endif
}
/*
* Flush serial port buffers (if any).
* Returns 0 upon success, -1 upon failure.
*/
int serial_flush(int fd)
{
#ifdef _WIN32
/* Returns non-zero upon success, 0 upon failure. */
if (PurgeComm(hdl, PURGE_RXCLEAR | PURGE_TXCLEAR) == 0)
return -1;
else
return 0;
#else
/* Returns 0 upon success, -1 upon failure. */
return tcflush(fd, TCIOFLUSH);
#endif
}
void *serial_backup_params(int fd)
@ -140,6 +152,7 @@ int serial_set_params(int fd, int speed, int bits, int parity, int stopbits,
/* TODO: Rename 'speed' to 'baudrate'. */
switch(speed) {
/* TODO: Support for higher baud rates. */
case 115200:
dcb.BaudRate = CBR_115200;
break;

View File

@ -38,6 +38,10 @@
#include <glib.h>
#include <sigrok.h>
#ifdef _WIN32
#define O_NONBLOCK FIONBIO
#endif
#define NUM_PROBES 32
#define NUM_TRIGGER_STAGES 4
#define TRIGGER_TYPES "01"