Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
316ebf04
Commit
316ebf04
authored
5 years ago
by
bertucci
Browse files
Options
Downloads
Patches
Plain Diff
The work continues
parent
1c0ddf70
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
quad/src/quad_app/log_data.c
+23
-1
23 additions, 1 deletion
quad/src/quad_app/log_data.c
quad/src/quad_app/util.c
+8
-0
8 additions, 0 deletions
quad/src/quad_app/util.c
with
31 additions
and
1 deletion
quad/src/quad_app/log_data.c
+
23
−
1
View file @
316ebf04
...
@@ -410,7 +410,7 @@ void RTprintLogging(struct CommDriver *comm, log_t* log_struct, parameter_t* ps,
...
@@ -410,7 +410,7 @@ void RTprintLogging(struct CommDriver *comm, log_t* log_struct, parameter_t* ps,
timer_axi_reset
();
timer_axi_reset
();
}
}
void
RTprintend
()
;
void
RTprintend
()
{
{
if
(
arrayIndex
==
0
)
if
(
arrayIndex
==
0
)
{
{
...
@@ -524,3 +524,25 @@ void format_log(int idx, log_t* log_struct, struct str* buf) {
...
@@ -524,3 +524,25 @@ void format_log(int idx, log_t* log_struct, struct str* buf) {
}
}
safe_sprintf_cat
(
buf
,
"
\n
"
);
safe_sprintf_cat
(
buf
,
"
\n
"
);
}
}
/*
Initially sets it so that all debug values are zero
*/
void
initializeFlags
(
SensorRTFlags_t
*
flags
)
{
flags
=
calloc
(
1
,
sizeof
(
SensorRTFlags_t
));
flags
->
imuflags
=
calloc
(
1
,
sizeof
(
IMUFlags_t
));
flags
->
optflowflags
=
calloc
(
1
,
sizeof
(
OptFlowFlags_t
));
flags
->
lidarflags
=
calloc
(
1
,
sizeof
(
lidarFlags_t
));
flags
->
errorflags
=
calloc
(
1
,
sizeof
(
SensorErrorFlags_t
));
flags
->
flag_count
=
0
;
}
void
freeFlags
(
SensorRTFlags_t
*
flags
){
free
(
flags
->
imuflags
);
free
(
flags
->
optflowflags
);
free
(
flags
->
lidarflags
);
free
(
flags
->
errorflags
);
free
(
flags
->
flag_count
);
free
(
flags
);
}
This diff is collapsed.
Click to expand it.
quad/src/quad_app/util.c
+
8
−
0
View file @
316ebf04
...
@@ -121,3 +121,11 @@ void pack_short(int16_t val, u8* buff) {
...
@@ -121,3 +121,11 @@ void pack_short(int16_t val, u8* buff) {
void
pack_float
(
float
val
,
u8
*
buff
)
{
void
pack_float
(
float
val
,
u8
*
buff
)
{
memcpy
(
buff
,
&
val
,
sizeof
(
val
));
memcpy
(
buff
,
&
val
,
sizeof
(
val
));
}
}
/*
Helper to return single bit of u32 data. This returns the "position"'th bit of the given u32,
assuming it is Zero indexed.
*/
u32
read_bit
(
u32
data
,
int
position
)
{
return
(
data
>>
position
)
&
1
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment