diff options
author | Vasilii Chernov <vchernov@inr.ru> | 2016-03-03 10:34:49 +0100 |
---|---|---|
committer | Vasilii Chernov <vchernov@inr.ru> | 2016-03-03 10:34:49 +0100 |
commit | ee16e47966afe180d3c32e2b1d93301052894fac (patch) | |
tree | 56aecf261aaae57e28c08cef573ae6642ec5394d /apps | |
parent | 02d0026e2df2ba5c68c0c1a67aec4437c9e8e8f3 (diff) | |
parent | 195c28f3074486165b6e0935362810f8a1fb9531 (diff) | |
download | pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.gz pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.bz2 pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.xz pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.zip |
Merge with http://ufo.kit.edu/ufo/log/csa/pcitool 369 revision
Diffstat (limited to 'apps')
-rw-r--r-- | apps/test_multithread.c | 14 |
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); |