diff options
-rw-r--r-- | src/phidgetcontrol.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/phidgetcontrol.c b/src/phidgetcontrol.c index 7d9138e..23d6205 100644 --- a/src/phidgetcontrol.c +++ b/src/phidgetcontrol.c @@ -164,22 +164,31 @@ main (int argc, char *argv[]) // connect to Analog object CPhidget_open ((CPhidgetHandle) Aphid, -1); - // phidget interfacekit handle timeout - if ((result = CPhidget_waitForAttachment ((CPhidgetHandle) IKphid, 5000))) + // check if we should have a phidgetinterfacekit connected + if (setup_phidgetinterfacekit) { - CPhidget_getErrorDescription (result, &err); - printf ("PHIDGET: Problem waiting for attachment: %s\n", err); - return -1; + // phidget interfacekit handle timeout + if ((result = + CPhidget_waitForAttachment ((CPhidgetHandle) IKphid, 5000))) + { + CPhidget_getErrorDescription (result, &err); + printf ("PHIDGET: Problem waiting for attachment: %s\n", err); + return -1; + } } - // phidget analog handle timeout - if ((result = CPhidget_waitForAttachment ((CPhidgetHandle) Aphid, 5000))) + // check if we should have a phidgetanalog connected + if (setup_phidgetanalog) { - CPhidget_getErrorDescription (result, &err); - printf ("PHIDGET: Problem waiting for attachment: %s\n", err); - return -1; + // phidget analog handle timeout + if ((result = + CPhidget_waitForAttachment ((CPhidgetHandle) Aphid, 5000))) + { + CPhidget_getErrorDescription (result, &err); + printf ("PHIDGET: Problem waiting for attachment: %s\n", err); + return -1; + } } - // set digital outputs low on program startup for (i = 0; i < numInterfaceKitSensors; i++) { |