fet: allow interrupted run on Win32.

usleep() doesn't return a negative value on Ctrl+C under Windows, so we
need to poll the Ctrl+C handler.

Bug identified by Patrick Dussud <phdussud@hotmail.com>.
This commit is contained in:
Daniel Beer 2011-08-30 17:27:08 +12:00
parent 9563fc2683
commit 1a99daa84b
1 changed files with 2 additions and 1 deletions

3
fet.c
View File

@ -646,7 +646,8 @@ static device_status_t fet_poll(device_t dev_base)
{
struct fet_device *dev = (struct fet_device *)dev_base;
if (usleep(50000) < 0)
ctrlc_reset();
if ((usleep(50000) < 0) || ctrlc_check())
return DEVICE_STATUS_INTR;
if (xfer(dev, C_STATE, NULL, 0, 1, 0) < 0) {