FTDI user space on Windows
Lubomir I. Ivanov
neolit123 at gmail.com
Tue Sep 11 14:00:50 PDT 2018
On 10 September 2018 at 08:05, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> This should be so simple. libtfdi is available in MXE, so just build against
> it, right?
> Except this:
>
> static dc_status_t serial_ftdi_sleep (void *io, unsigned int timeout)
> {
> ftdi_serial_t *device = io;
>
> if (device == NULL)
> return DC_STATUS_INVALIDARGS;
>
> INFO (device->context, "Sleep: value=%u", timeout);
>
> struct timespec ts;
> ts.tv_sec = (timeout / 1000);
> ts.tv_nsec = (timeout % 1000) * 1000000;
>
> while (nanosleep (&ts, &ts) != 0) {
> if (errno != EINTR ) {
> SYSERROR (device->context, errno);
> return DC_STATUS_IO;
> }
> }
>
> return DC_STATUS_SUCCESS;
> }
>
> Turns out Windows doesn't have nanosleep. And I can't seem to find a
> function with comparable semantic, unless I use the one in the pthread
> library that is provided by MinGW which is not what we want to do.
> So the question becomes how to represent this with something that gives us
> the same semantic / functionality.
>
> I am anything but a Windows expert. Suggestions welcome.
>
i can have a look a bit later today.
lubomir
--
More information about the subsurface
mailing list