Commit 3db30403 authored by Federico Vaga's avatar Federico Vaga

rt: make custom library

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent bb8727d9
......@@ -26,11 +26,22 @@ CFLAGS += -I.
CFLAGS += -I$(TRTL)/rt
CFLAGS += -I$(TRTL)/include
CFLAGS += -DGIT_VERSION=$(RT_GIT_VERSION)
CFLAGS += $(EXTRA_CFLAGS)
ifeq ($(MOCKTURTLE_PRINTF_ENABLE), 1)
CFLAGS += -DLIB_PRINTF
endif
ifeq ($(LIBMOCKTURTLE_VARIABLE_ENABLE), 1)
CFLAGS += -DLIBMOCKTURTLE_VARIABLE_ENABLE
endif
ifeq ($(LIBMOCKTURTLE_STRUCT_ENABLE), 1)
CFLAGS += -DLIBMOCKTURTLE_STRUCT_ENABLE
endif
ifeq ($(LIBMOCKTURTLE_DEBUG_ENABLE), 1)
CFLAGS += -DLIBMOCKTURTLE_DEBUG_ENABLE
endif
CFLAGS += $(EXTRA_CFLAGS)
OBJS += $(TRTL)/rt/mockturtle-crt0.o
OBJS += $(TRTL)/rt/vsprintf-xint.o
......
......@@ -23,7 +23,7 @@
uint32_t msg_seq = 0;
struct rt_application *_app;
#ifdef APPRT_DEBUG
#ifdef LIBMOCKTURTLE_DEBUG_ENABLE
/**
* The function can be used to debug the code as alternative to the pp_printf().
*/
......@@ -70,6 +70,8 @@ void rt_memcpy(uint32_t *dest, uint32_t *src, size_t n)
dest[i] = src[i];
}
#ifdef LIBMOCKTURTLE_STRUCT_ENABLE
/**
* it sets a structure coming from the host
*/
......@@ -154,6 +156,20 @@ int rt_structure_getter(struct trtl_proto_header *hin, void *pin,
return 0;
}
#else
int rt_structure_setter(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
rt_send_nack(hin, pin, hout, NULL);
return 0;
}
int rt_structure_getter(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
rt_send_nack(hin, pin, hout, NULL);
return 0;
}
#endif
/**
......@@ -174,6 +190,7 @@ int rt_version_getter(struct trtl_proto_header *hin, void *pin,
}
#ifdef LIBMOCKTURTLE_VARIABLE_ENABLE
/**
* This is a generic setter that an external system can invoke
* to set a set of variable values.
......@@ -265,6 +282,20 @@ int rt_variable_getter(struct trtl_proto_header *hin, void *pin,
return 0;
}
#else
int rt_variable_setter(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
rt_send_nack(hin, pin, hout, NULL);
return 0;
}
int rt_variable_getter(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
rt_send_nack(hin, pin, hout, NULL);
return 0;
}
#endif
/**
......
......@@ -187,7 +187,7 @@ static inline void rt_mq_msg_send(struct trtl_msg *msg)
/**
* Application debug tools
*/
#ifdef APPRT_DEBUG
#ifdef LIBMOCKTURTLE_DEBUG_ENABLE
extern int rt_send_debug(struct rt_application *app, int slot, int n_values, ...);
#else
static inline int rt_send_debug(struct rt_application *app,
......
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