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:
parent
9563fc2683
commit
1a99daa84b
3
fet.c
3
fet.c
|
@ -646,7 +646,8 @@ static device_status_t fet_poll(device_t dev_base)
|
||||||
{
|
{
|
||||||
struct fet_device *dev = (struct fet_device *)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;
|
return DEVICE_STATUS_INTR;
|
||||||
|
|
||||||
if (xfer(dev, C_STATE, NULL, 0, 1, 0) < 0) {
|
if (xfer(dev, C_STATE, NULL, 0, 1, 0) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue