summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-03-02 23:36:19 +0100
committerSuren A. Chilingaryan <csa@suren.me>2016-03-02 23:36:19 +0100
commitf7636162ba124c0d6b5accaa72c842033f3e2309 (patch)
tree9ae5ceddde46e7c511bba899b869f54c6fef6283 /apps
parent7e39a6c8ae5c3f95b3b2895c4ce8d858c7ad3b79 (diff)
parent02d0026e2df2ba5c68c0c1a67aec4437c9e8e8f3 (diff)
downloadpcitool-f7636162ba124c0d6b5accaa72c842033f3e2309.tar.gz
pcitool-f7636162ba124c0d6b5accaa72c842033f3e2309.tar.bz2
pcitool-f7636162ba124c0d6b5accaa72c842033f3e2309.tar.xz
pcitool-f7636162ba124c0d6b5accaa72c842033f3e2309.zip
Further improvements of Python scripting and web-interface API for register manipulations by Vasiliy Chernov
Diffstat (limited to 'apps')
-rw-r--r--apps/test_multithread.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/test_multithread.c b/apps/test_multithread.c
index 4d0e8f2..f6afae7 100644
--- a/apps/test_multithread.c
+++ b/apps/test_multithread.c
@@ -1,8 +1,10 @@
#include <stdio.h>
#include <pthread.h>
-#include "pcilib.h"
#include <stdlib.h>
+#include "pcilib.h"
+#include "pcilib/error.h"
+
const char* prop = "/registers/fpga/reg1";
char* reg;
int stop = 0;
@@ -18,14 +20,14 @@ void *get_prop(void *arg)
err = pcilib_get_property(ctx, prop, &val);
if(err)
{
- printf("err pcilib_read_register\n");
+ pcilib_error("Error in pcilib_read_register");
return NULL;
}
long value = pcilib_get_value_as_int(ctx, &val, &err);
pcilib_clean_value(ctx, &val);
if(err)
{
- printf("err pcilib_get_value_as_int\n");
+ pcilib_error("Error in pcilib_get_value_as_int");
return NULL;
}
printf("reg = %li\n", value);
@@ -47,20 +49,20 @@ void *read_reg(void *arg)
if(err)
{
- printf("err pcilib_read_register\n");
+ pcilib_error("Error in pcilib_read_register");
return NULL;
}
err = pcilib_set_value_from_register_value(ctx, &val, reg_val);
if(err)
{
- printf("err pcilib_set_value_from_register_value\n");
+ pcilib_error("Error in pcilib_set_value_from_register_value");
return NULL;
}
long value = pcilib_get_value_as_int(ctx, &val, &err);
pcilib_clean_value(ctx, &val);
if(err)
{
- printf("err pcilib_get_value_as_int\n");
+ pcilib_error("Error in pcilib_get_value_as_int");
return NULL;
}
printf("reg = %li\n", value);