Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Mock Turtle
Commits
3db30403
Commit
3db30403
authored
Oct 10, 2016
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rt: make custom library
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
bb8727d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
4 deletions
+46
-4
Makefile
rt/Makefile
+13
-2
libmockturtle-rt.c
rt/libmockturtle-rt.c
+32
-1
libmockturtle-rt.h
rt/libmockturtle-rt.h
+1
-1
No files found.
rt/Makefile
View file @
3db30403
...
...
@@ -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
...
...
rt/libmockturtle-rt.c
View file @
3db30403
...
...
@@ -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
/**
...
...
rt/libmockturtle-rt.h
View file @
3db30403
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment