diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-12-04 01:41:09 +0000 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-12-04 01:41:09 +0000 |
commit | acf5c24e03de08333bdc4bfdaa4023fe3e32cd02 (patch) | |
tree | 75d4ae63aef76a31c5601911a08cdf14ea7bcf00 | |
parent | 45b134f897572318f182aa5faa348c5bd39fa7ae (diff) | |
download | verteco-1.10.tar.gz |
phidgetcontrol: Allow single device operationv1.10
Brown paper bag commit.
-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++) { |