From 1abd48b83a7f124e1b93fd189968fc984b7b46ea Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 17 May 2010 23:50:34 +0000 Subject: [PATCH] now ready for RPC calls --- trbrich/pulser.c | 8 ++++++-- trbrich/trb_i2c.c | 6 +++++- trbrich/trbflash.c | 8 ++++++-- trbrich/trbrichcmd.c | 8 ++++++-- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/trbrich/pulser.c b/trbrich/pulser.c index 5ab9138..0792a4d 100644 --- a/trbrich/pulser.c +++ b/trbrich/pulser.c @@ -11,7 +11,7 @@ #include #include -static const char pulser_version[] = "$Revision: 1.7 $"; +static const char pulser_version[] = "$Revision: 1.8 $"; /* 6MByte for 6 Sectors should be enough */ #define BUFFER_SIZE (6 * 1024 * 1024 / 4) @@ -107,7 +107,11 @@ int main(int argc, char ** argv) } /* open port */ - init_ports(); +#ifndef TRB_RPC + init_ports(); +#else + trb_connect(NULL); +#endif /* Open HLD-File */ if (strncmp(hldFileName, "stdout", 256) != 0) { diff --git a/trbrich/trb_i2c.c b/trbrich/trb_i2c.c index 2960f29..bed9eca 100644 --- a/trbrich/trb_i2c.c +++ b/trbrich/trb_i2c.c @@ -11,7 +11,7 @@ #define BUFFER_SIZE (6 * 4096) -static const char trb_i2c_version[] = "$Revision: 1.6 $"; +static const char trb_i2c_version[] = "$Revision: 1.7 $"; static const uint16_t trb_i2c_register = 0x8040; @@ -159,7 +159,11 @@ int main(int argc, char** argv) } /* Open port */ +#ifndef TRB_RPC init_ports(); +#else + trb_connect(NULL); +#endif if (strcmp(argv[optind], "w") == 0) { diff --git a/trbrich/trbflash.c b/trbrich/trbflash.c index a750e2d..aa39c47 100644 --- a/trbrich/trbflash.c +++ b/trbrich/trbflash.c @@ -90,7 +90,7 @@ static const char FlashTypeStr[][32] = static FlashType flashType = FLASH_INVALID; static uint32_t manId = 0; -static const char trbflash_version[] = "$Revision: 2.15 $"; +static const char trbflash_version[] = "$Revision: 2.16 $"; static uint32_t mdcFlashSelect = 1; @@ -1182,11 +1182,15 @@ int main(int argc, char ** argv) usage(basename(argv[0])); exit(EXIT_FAILURE); } - + +#ifndef TRB_RPC if (init_ports() == -1) { trb_error("Init_Ports"); exit(EXIT_FAILURE); } +#else + trb_connect(NULL); +#endif atexit(atexit0); diff --git a/trbrich/trbrichcmd.c b/trbrich/trbrichcmd.c index 4a0e512..4f9571d 100644 --- a/trbrich/trbrichcmd.c +++ b/trbrich/trbrichcmd.c @@ -13,7 +13,7 @@ #define TEMP_RESOLUTION 0.0625 -static const char trbrichcmd_version[] = "$Revision: 1.7 $"; +static const char trbrichcmd_version[] = "$Revision: 1.8 $"; static const uint16_t adcm_uid_register = 0xc000; @@ -70,8 +70,12 @@ int main(int argc, char** argv) } /* Open port */ +#ifndef TRB_RPC init_ports(); - +#else + trb_connect(NULL); +#endif + if (strcmp(argv[optind], "uid") == 0) { /*************************************************/ -- 2.43.0