#define TEMP_RESOLUTION 0.0625
-static const char trbrichcmd_version[] = "$Revision: 1.6 $";
+static const char trbrichcmd_version[] = "$Revision: 1.7 $";
static const uint16_t adcm_uid_register = 0xc000;
printf(" -V Version number\n");
printf("\nCommands:\n");
printf(" uid <trb_address> "
- "-> read uids from APV-FrondEnds\n");
+ "-> read uids from APV-FrondEnds\n"
+ " (default-Address:0xfffb)\n");
printf(" temp <trb_address> "
- "-> read temperatures from APV-FrondEnds\n");
+ "-> read temperatures from APV-FrondEnds\n"
+ " (default-Address:0xfffb)\n");
printf(" adcsnoop <trb_address> "
- "-> ADC Snifer Tool\n");
+ "-> ADC Sniffer Tool\n");
}
/* ------ MAIN ---------------------------------------------------------- */
uint32_t *buffer = NULL;
uint32_t *tmp = NULL;
uint32_t *end = NULL;
- uint16_t trb_address = 0;
+ uint16_t trb_address = 0xfffb;
int status = 0;
-
- if (argc - optind != 2) {
+
+ if (argc - optind == 2) {
+ trb_address = (uint16_t)strtoul(argv[optind + 1], NULL, 0);
+ } else if (argc - optind > 2) {
usage(argv[0]);
exit(EXIT_FAILURE);
}
-
- trb_address = (uint16_t)strtoul(argv[optind + 1], NULL, 0);
if ((buffer = (uint32_t*)malloc(sizeof(uint32_t) * BUFFER_SIZE)) == NULL) {
abort();
uint32_t *tmp = NULL;
uint32_t *end = NULL;
int status = 0;
- uint16_t trb_address = 0;
+ uint16_t trb_address = 0xfffb;
- if (argc - optind != 2) {
+ if (argc - optind == 2) {
+ trb_address = (uint16_t)strtoul(argv[optind + 1], NULL, 0);
+ } else if (argc - optind > 2) {
usage(argv[0]);
exit(EXIT_FAILURE);
}
-
- trb_address = (uint16_t)strtoul(argv[optind + 1], NULL, 0);
-
+
if ((buffer = (uint32_t*)malloc(sizeof(uint32_t) * BUFFER_SIZE)) == NULL) {
abort();
}