Am 26.01.2015 um 16:38 schrieb Andrey Skvortsov:
> Hi,
> 
> sometimes, if not enough bytes are received from ftdi device, avrdude
> hangs in ft245r_recv, to avoid this sem_wait is replaced with
> sem_timedwait. I tested this patch on linux.
> 
> 
Hi,

I guess for MacOS we should implement an own function.

Probably something like this (I do not own a Mac so I cannot check if
this really correct.)

int sem_wait_with_timeout(sem_t * psem, long to_ns)
{
    dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, to_ns);
    long result = dispatch_semaphore_wait(*psem, timeout);
    if (result != 0)
    {
        errno = ETIMEDOUT;
        return -1;
    }
    return 0;
}

Could anyone check this?


Best regards

René



_______________________________________________
avrdude-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev

Reply via email to