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
95fd2cd1
Commit
95fd2cd1
authored
7 years ago
by
David Sidrane
Committed by
Lorenz Meier
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Create NuttX git hash and tag
parent
f66f024e
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
Tools/px_update_git_header.py
+11
-1
11 additions, 1 deletion
Tools/px_update_git_header.py
src/lib/version/version.c
+2
-2
2 additions, 2 deletions
src/lib/version/version.c
with
13 additions
and
3 deletions
Tools/px_update_git_header.py
+
11
−
1
View file @
95fd2cd1
...
...
@@ -3,6 +3,7 @@ from __future__ import print_function
import
sys
import
subprocess
import
re
filename
=
sys
.
argv
[
1
]
...
...
@@ -16,6 +17,11 @@ git_tag = subprocess.check_output('git describe --always --tags'.split(),
stderr
=
subprocess
.
STDOUT
).
decode
(
'
utf-8
'
).
strip
()
git_version
=
subprocess
.
check_output
(
'
git rev-parse --verify HEAD
'
.
split
(),
stderr
=
subprocess
.
STDOUT
).
decode
(
'
utf-8
'
).
strip
()
nuttx_git_tag
=
subprocess
.
check_output
(
'
git describe --always --tags
'
.
split
(),
cwd
=
'
NuttX/nuttx
'
,
stderr
=
subprocess
.
STDOUT
).
decode
(
'
utf-8
'
).
strip
().
replace
(
"
nuttx-
"
,
"
v
"
)
nuttx_git_tag
=
re
.
sub
(
'
-.*
'
,
'
.0
'
,
nuttx_git_tag
)
nuttx_git_version
=
subprocess
.
check_output
(
'
git rev-parse --verify HEAD
'
.
split
(),
cwd
=
'
NuttX/nuttx
'
,
stderr
=
subprocess
.
STDOUT
).
decode
(
'
utf-8
'
).
strip
()
git_version_short
=
git_version
[
0
:
16
]
# Generate the header file content
...
...
@@ -26,9 +32,13 @@ header = """
#define PX4_GIT_VERSION_STR
"
{git_version}
"
#define PX4_GIT_VERSION_BINARY 0x{git_version_short}
#define PX4_GIT_TAG_STR
"
{git_tag}
"
#define NUTTX_GIT_VERSION_STR
"
{nuttx_git_version}
"
#define NUTTX_GIT_TAG_STR
"
{nuttx_git_tag}
"
"""
.
format
(
git_tag
=
git_tag
,
git_version
=
git_version
,
git_version_short
=
git_version_short
)
git_version_short
=
git_version_short
,
nuttx_git_version
=
nuttx_git_version
,
nuttx_git_tag
=
nuttx_git_tag
)
if
old_header
!=
header
:
print
(
'
Updating header {}
'
.
format
(
sys
.
argv
[
1
]))
...
...
This diff is collapsed.
Click to expand it.
src/lib/version/version.c
+
2
−
2
View file @
95fd2cd1
...
...
@@ -190,7 +190,7 @@ uint32_t px4_os_version(void)
#elif defined(__PX4_QURT)
return
0
;
//TODO: implement version for QuRT
#elif defined(__PX4_NUTTX)
return
version_tag_to_number
(
"v7.18.0"
);
//TODO: get correct version
return
version_tag_to_number
(
NUTTX_GIT_TAG_STR
);
#else
# error "px4_os_version not implemented for current OS"
#endif
...
...
@@ -199,7 +199,7 @@ uint32_t px4_os_version(void)
const
char
*
px4_os_version_string
(
void
)
{
#if defined(__PX4_NUTTX)
return
NU
LL
;
//TODO: get NuttX git tag as string
return
NU
TTX_GIT_VERSION_STR
;
#else
return
NULL
;
#endif
...
...
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