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
0e1a5327
Commit
0e1a5327
authored
10 years ago
by
Lorenz Meier
Browse files
Options
Downloads
Patches
Plain Diff
sdlog2: Use .px4log as file format. Fixes #1243
parent
2e1ac72b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/sdlog2/sdlog2.c
+7
-7
7 additions, 7 deletions
src/modules/sdlog2/sdlog2.c
with
7 additions
and
7 deletions
src/modules/sdlog2/sdlog2.c
+
7
−
7
View file @
0e1a5327
...
...
@@ -343,7 +343,7 @@ int create_log_dir()
struct
timespec
ts
;
clock_gettime
(
CLOCK_REALTIME
,
&
ts
);
/* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.
bin
*/
/* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.
px4log
*/
time_t
utc_time_sec
=
ts
.
tv_sec
+
(
ts
.
tv_nsec
/
1e9
);
struct
tm
tt
;
struct
tm
*
ttp
=
gmtime_r
(
&
utc_time_sec
,
&
tt
);
...
...
@@ -403,14 +403,14 @@ int open_log_file()
struct
timespec
ts
;
clock_gettime
(
CLOCK_REALTIME
,
&
ts
);
/* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.
bin
*/
/* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.
px4log
*/
time_t
utc_time_sec
=
ts
.
tv_sec
+
(
ts
.
tv_nsec
/
1e9
);
struct
tm
tt
;
struct
tm
*
ttp
=
gmtime_r
(
&
utc_time_sec
,
&
tt
);
/* start logging if we have a valid time and the time is not in the past */
if
(
log_name_timestamp
&&
ttp
&&
(
utc_time_sec
>
PX4_EPOCH_SECS
))
{
strftime
(
log_file_name
,
sizeof
(
log_file_name
),
"%H_%M_%S.
bin
"
,
&
tt
);
strftime
(
log_file_name
,
sizeof
(
log_file_name
),
"%H_%M_%S.
px4log
"
,
&
tt
);
snprintf
(
log_file_path
,
sizeof
(
log_file_path
),
"%s/%s"
,
log_dir
,
log_file_name
);
}
else
{
...
...
@@ -418,8 +418,8 @@ int open_log_file()
/* look for the next file that does not exist */
while
(
file_number
<=
MAX_NO_LOGFILE
)
{
/* format log file path: e.g. /fs/microsd/sess001/log001.
bin
*/
snprintf
(
log_file_name
,
sizeof
(
log_file_name
),
"log%03u.
bin
"
,
file_number
);
/* format log file path: e.g. /fs/microsd/sess001/log001.
px4log
*/
snprintf
(
log_file_name
,
sizeof
(
log_file_name
),
"log%03u.
px4log
"
,
file_number
);
snprintf
(
log_file_path
,
sizeof
(
log_file_path
),
"%s/%s"
,
log_dir
,
log_file_name
);
if
(
!
file_exist
(
log_file_path
))
{
...
...
@@ -458,7 +458,7 @@ int open_perf_file(const char* str)
struct
timespec
ts
;
clock_gettime
(
CLOCK_REALTIME
,
&
ts
);
/* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.
bin
*/
/* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.
txt
*/
time_t
utc_time_sec
=
ts
.
tv_sec
+
(
ts
.
tv_nsec
/
1e9
);
struct
tm
tt
;
struct
tm
*
ttp
=
gmtime_r
(
&
utc_time_sec
,
&
tt
);
...
...
@@ -472,7 +472,7 @@ int open_perf_file(const char* str)
/* look for the next file that does not exist */
while
(
file_number
<=
MAX_NO_LOGFILE
)
{
/* format log file path: e.g. /fs/microsd/sess001/log001.
bin
*/
/* format log file path: e.g. /fs/microsd/sess001/log001.
txt
*/
snprintf
(
log_file_name
,
sizeof
(
log_file_name
),
"perf%03u.txt"
,
file_number
);
snprintf
(
log_file_path
,
sizeof
(
log_file_path
),
"%s/%s_%s"
,
log_dir
,
str
,
log_file_name
);
...
...
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