Commit c6af0fc8 authored by Federico Vaga's avatar Federico Vaga

Merge branch 'feature-unittest' into proposed_master

parents 5deba899 a63a3b42
......@@ -4,3 +4,6 @@
[submodule "fmc-bus"]
path = fmc-bus
url = git://ohwr.org/fmc-projects/fmc-bus.git
[submodule "mamma"]
path = mamma
url = https://github.com/FedericoVaga/mamma.git
......@@ -25,7 +25,7 @@ ZIO_VERSION = $(shell cd $(ZIO_ABS); git describe --always --dirty --long --tags
export ZIO_VERSION
DIRS = $(FMC_BUS_ABS) $(ZIO_ABS) kernel lib tools
DIRS = $(FMC_BUS_ABS) $(ZIO_ABS) kernel lib tools mamma/lib unittest
kernel: $(FMC_BUS_ABS) $(ZIO_ABS)
lib: $(ZIO_ABS)
......
......@@ -285,6 +285,11 @@ int fmctdc_close(struct fmctdc_board *userb)
__define_board(b, userb);
int j;
if (!b) {
errno = EINVAL;
return -1;
}
for (j = 0; j < ARRAY_SIZE(b->fdc); j++) {
if (b->fdc[j] >= 0)
close(b->fdc[j]);
......@@ -531,15 +536,15 @@ int fmctdc_get_buffer_len(struct fmctdc_board *userb, unsigned int channel)
}
/**
* The function set the buffer lenght
* The function set the buffer length
* @param[in] userb TDC board instance token
* @param[in] channel to use
* @param[in] lenght maximum number of timestamps to store
* @param[in] length maximum number of timestamps to store
* @return 0 on success, otherwise a negative errno code is set
* appropriately
*/
int fmctdc_set_buffer_len(struct fmctdc_board *userb, unsigned int channel,
unsigned int lenght)
unsigned int length)
{
__define_board(b, userb);
uint32_t val;
......@@ -552,7 +557,7 @@ int fmctdc_set_buffer_len(struct fmctdc_board *userb, unsigned int channel,
snprintf(attr, sizeof(attr), "ft-ch%d/chan0/buffer/max-buffer-len", channel + 1);
val = lenght;
val = length;
return fmctdc_sysfs_set(b, attr, &val);
}
......@@ -1122,7 +1127,6 @@ int fmctdc_coalescing_timeout_get(struct fmctdc_board *userb,
* @param[in] channel target channel [0, 4]
* @param[in] mode time-stamp mode
* @return 0 on success, otherwise -1 and errno is set appropriately
*
*/
int fmctdc_ts_mode_set(struct fmctdc_board *userb,
unsigned int channel,
......
......@@ -63,7 +63,8 @@ enum ft_transfer_mode {
*/
enum fmctdc_ts_mode {
FMCTDC_TS_MODE_POST = 0, /**< after post-processing */
FMCTDC_TS_MODE_RAW, /**< directly from ACAM chip */
FMCTDC_TS_MODE_RAW, /**< directly from ACAM chip. This should be used
ONLY when debugging low level issues */
};
/**
......@@ -147,7 +148,7 @@ extern int fmctdc_get_buffer_len(struct fmctdc_board *userb,
unsigned int channel);
extern int fmctdc_set_buffer_len(struct fmctdc_board *userb,
unsigned int channel,
unsigned int lenght);
unsigned int length);
extern int fmctdc_reference_set(struct fmctdc_board *userb,
unsigned int ch_target, int ch_reference);
extern int fmctdc_reference_get(struct fmctdc_board *userb,
......
Subproject commit 3252cf886e76d83606c488f3f2b64bc2ccfbfbfe
fmctdc-ut
\ No newline at end of file
# If it exists includes Makefile.specific. In this Makefile, you should put
# specific Makefile code that you want to run before this. For example,
# build a particular environment.
-include Makefile.specific
# include parent_common.mk for buildsystem's defines
REPO_PARENT ?= ../..
-include $(REPO_PARENT)/parent_common.mk
DESTDIR ?= /usr/local/
LIBTDC = ../lib/
LIBMAMMA = ../mamma/lib/
CFLAGS = -O0 -ggdb -I. -I$(LIBTDC) -I$(LIBMAMMA) -I../kernel -Wall -Werror $(EXTRACFLAGS)
GIT_VERSION := $(shell git describe --dirty --long --tags)
CFLAGS += -DGIT_VERSION="\"$(GIT_VERSION)\""
LDFLAGS = -L$(LIBTDC)
LDLIBS = -lfmctdc -lrt
all: fmctdc-ut
fmctdc-ut: fmctdc-ut.c $(LIBTDC)/libfmctdc.a $(LIBMAMMA)/libmamma.a
clean:
rm -f $(TESTS) test-common.o
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment