From 0092fff68f341f2ffc857e7665fdccfe11fdf616 Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 10 Oct 2011 21:25:08 +0000 Subject: [PATCH] update --- libtrbnet/trbnet.c | 18 +++++++++--------- libtrbnet/trbnet.h | 8 +------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/libtrbnet/trbnet.c b/libtrbnet/trbnet.c index b7821fb..d16af8e 100644 --- a/libtrbnet/trbnet.c +++ b/libtrbnet/trbnet.c @@ -15,7 +15,7 @@ #endif -const char trbnet_version[] = "$Revision: 4.7 $"; +const char trbnet_version[] = "$Revision: 4.8 $"; #include #include @@ -2284,11 +2284,7 @@ int trb_send_trigger_rich(uint8_t trg_input, return 0; } -#ifndef PEXOR -int fpga_register_read(uint16_t reg_address, uint32_t* value) -#else int fpga_register_read(uint32_t reg_address, uint32_t* value) -#endif { int status = 0; @@ -2296,6 +2292,10 @@ int fpga_register_read(uint32_t reg_address, uint32_t* value) if (lockPorts(0) == -1) return -1; +#ifndef PEXOR + reg_address &= 0xffff; +#endif + /* DEBUG INFO */ if (trb_debug > 0) { fprintf(stderr, "fpga_register_read started.\n"); @@ -2308,11 +2308,7 @@ int fpga_register_read(uint32_t reg_address, uint32_t* value) return status; } -#ifndef PEXOR -int fpga_register_write(uint16_t reg_address, uint32_t value) -#else int fpga_register_write(uint32_t reg_address, uint32_t value) -#endif { int status = 0; @@ -2320,6 +2316,10 @@ int fpga_register_write(uint32_t reg_address, uint32_t value) if (lockPorts(0) == -1) return -1; +#ifndef PEXOR + reg_address &= 0xffff; +#endif + /* DEBUG INFO */ if (trb_debug > 0) { fprintf(stderr, "fpga_register_write started.\n"); diff --git a/libtrbnet/trbnet.h b/libtrbnet/trbnet.h index ec39c03..ca26107 100644 --- a/libtrbnet/trbnet.h +++ b/libtrbnet/trbnet.h @@ -82,19 +82,13 @@ int trb_send_trigger_rich(uint8_t input, uint8_t random, uint16_t number); -#ifndef PEXOR -int fpga_register_read(uint16_t reg_address, - uint32_t* value); - -int fpga_register_write(uint16_t reg_address, - uint32_t value); -#else int fpga_register_read(uint32_t reg_address, uint32_t* value); int fpga_register_write(uint32_t reg_address, uint32_t value); +#ifdef PEXOR int fpga_register_read_mem(uint32_t reg_address, uint32_t* data, unsigned int size); -- 2.43.0