Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
659ac8fa
Commit
659ac8fa
authored
8 years ago
by
Beat Küng
Committed by
Lorenz Meier
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor logger: use static fields & move them to source file
avoids multiple declarations of...
parent
43d734ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/logger/logger.cpp
+6
-2
6 additions, 2 deletions
src/modules/logger/logger.cpp
src/modules/logger/logger.h
+3
-6
3 additions, 6 deletions
src/modules/logger/logger.h
with
9 additions
and
8 deletions
src/modules/logger/logger.cpp
+
6
−
2
View file @
659ac8fa
...
...
@@ -75,6 +75,10 @@
using
namespace
px4
::
logger
;
static
Logger
*
logger_ptr
=
nullptr
;
static
int
logger_task
=
-
1
;
static
pthread_t
writer_thread
;
int
logger_main
(
int
argc
,
char
*
argv
[])
{
// logger currently assumes little endian
...
...
@@ -464,7 +468,7 @@ void Logger::run()
return
;
}
int
ret
=
_writer
.
thread_start
(
_
writer_thread
);
int
ret
=
_writer
.
thread_start
(
writer_thread
);
if
(
ret
)
{
PX4_ERR
(
"logger: failed to create writer thread (%i)"
,
ret
);
...
...
@@ -616,7 +620,7 @@ void Logger::run()
_writer
.
notify
();
// wait for thread to complete
ret
=
pthread_join
(
_
writer_thread
,
NULL
);
ret
=
pthread_join
(
writer_thread
,
NULL
);
if
(
ret
)
{
PX4_WARN
(
"join failed: %d"
,
ret
);
...
...
This diff is collapsed.
Click to expand it.
src/modules/logger/logger.h
+
3
−
6
View file @
659ac8fa
...
...
@@ -203,11 +203,8 @@ private:
param_t
_log_utc_offset
;
orb_advert_t
_mavlink_log_pub
=
nullptr
;
uint16_t
_next_topic_id
;
///< id of next subscribed topic
};
Logger
*
logger_ptr
=
nullptr
;
int
logger_task
=
-
1
;
pthread_t
_writer_thread
;
};
}
}
}
//namespace logger
}
//namespace px4
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