aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-12-04 01:41:09 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2012-12-04 01:41:09 +0000
commitacf5c24e03de08333bdc4bfdaa4023fe3e32cd02 (patch)
tree75d4ae63aef76a31c5601911a08cdf14ea7bcf00 /src
parent45b134f897572318f182aa5faa348c5bd39fa7ae (diff)
downloadverteco-acf5c24e03de08333bdc4bfdaa4023fe3e32cd02.tar.gz
phidgetcontrol: Allow single device operationv1.10
Brown paper bag commit.
Diffstat (limited to '')
-rw-r--r--src/phidgetcontrol.c31
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++)
{