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. ...@@ -26,11 +26,22 @@ CFLAGS += -I.
CFLAGS += -I$(TRTL)/rt CFLAGS += -I$(TRTL)/rt
CFLAGS += -I$(TRTL)/include CFLAGS += -I$(TRTL)/include
CFLAGS += -DGIT_VERSION=$(RT_GIT_VERSION) CFLAGS += -DGIT_VERSION=$(RT_GIT_VERSION)
CFLAGS += $(EXTRA_CFLAGS)
ifeq ($(MOCKTURTLE_PRINTF_ENABLE), 1) ifeq ($(MOCKTURTLE_PRINTF_ENABLE), 1)
CFLAGS += -DLIB_PRINTF CFLAGS += -DLIB_PRINTF
endif 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/mockturtle-crt0.o
OBJS += $(TRTL)/rt/vsprintf-xint.o OBJS += $(TRTL)/rt/vsprintf-xint.o
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
uint32_t msg_seq = 0; uint32_t msg_seq = 0;
struct rt_application *_app; 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(). * 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) ...@@ -70,6 +70,8 @@ void rt_memcpy(uint32_t *dest, uint32_t *src, size_t n)
dest[i] = src[i]; dest[i] = src[i];
} }
#ifdef LIBMOCKTURTLE_STRUCT_ENABLE
/** /**
* it sets a structure coming from the host * it sets a structure coming from the host
*/ */
...@@ -154,6 +156,20 @@ int rt_structure_getter(struct trtl_proto_header *hin, void *pin, ...@@ -154,6 +156,20 @@ int rt_structure_getter(struct trtl_proto_header *hin, void *pin,
return 0; 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, ...@@ -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 * This is a generic setter that an external system can invoke
* to set a set of variable values. * to set a set of variable values.
...@@ -265,6 +282,20 @@ int rt_variable_getter(struct trtl_proto_header *hin, void *pin, ...@@ -265,6 +282,20 @@ int rt_variable_getter(struct trtl_proto_header *hin, void *pin,
return 0; 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) ...@@ -187,7 +187,7 @@ static inline void rt_mq_msg_send(struct trtl_msg *msg)
/** /**
* Application debug tools * Application debug tools
*/ */
#ifdef APPRT_DEBUG #ifdef LIBMOCKTURTLE_DEBUG_ENABLE
extern int rt_send_debug(struct rt_application *app, int slot, int n_values, ...); extern int rt_send_debug(struct rt_application *app, int slot, int n_values, ...);
#else #else
static inline int rt_send_debug(struct rt_application *app, 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