Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
977a0ce2
Commit
977a0ce2
authored
11 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py: Print tag/version/git describe in uPy banner.
parent
b4bb3fdb
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
py/py-version.sh
+2
-0
2 additions, 0 deletions
py/py-version.sh
stmhal/pyexec.c
+1
-1
1 addition, 1 deletion
stmhal/pyexec.c
unix/main.c
+1
-1
1 addition, 1 deletion
unix/main.c
with
4 additions
and
2 deletions
py/py-version.sh
+
2
−
0
View file @
977a0ce2
#!/bin/bash
#!/bin/bash
git_tag
=
"
$(
git describe
||
echo
unknown
)
"
git_hash
=
"
$(
git rev-parse
--short
HEAD 2> /dev/null
||
echo
unknown
)
"
git_hash
=
"
$(
git rev-parse
--short
HEAD 2> /dev/null
||
echo
unknown
)
"
git_files_are_clean
=
1
git_files_are_clean
=
1
# Check if there are any modified files.
# Check if there are any modified files.
...
@@ -11,6 +12,7 @@ if [ "${git_files_are_clean}" != "1" ]; then
...
@@ -11,6 +12,7 @@ if [ "${git_files_are_clean}" != "1" ]; then
fi
fi
cat
<<
EOF
cat
<<
EOF
// This file was generated by py/py-version.sh
// This file was generated by py/py-version.sh
#define MICROPY_GIT_TAG "
${
git_tag
}
"
#define MICROPY_GIT_HASH "
${
git_hash
}
"
#define MICROPY_GIT_HASH "
${
git_hash
}
"
#define MICROPY_BUILD_DATE "
$(
date
'+%Y-%m-%d'
)
"
#define MICROPY_BUILD_DATE "
$(
date
'+%Y-%m-%d'
)
"
EOF
EOF
This diff is collapsed.
Click to expand it.
stmhal/pyexec.c
+
1
−
1
View file @
977a0ce2
...
@@ -155,7 +155,7 @@ int pyexec_friendly_repl(void) {
...
@@ -155,7 +155,7 @@ int pyexec_friendly_repl(void) {
#endif
#endif
friendly_repl_reset:
friendly_repl_reset:
stdout_tx_str
(
"Micro Python
build
"
MICROPY_GIT_HASH
" on "
MICROPY_BUILD_DATE
"; "
MICROPY_HW_BOARD_NAME
" with STM32F405RG
\r\n
"
);
stdout_tx_str
(
"Micro Python
"
MICROPY_GIT_TAG
" (
"
MICROPY_GIT_HASH
" on "
MICROPY_BUILD_DATE
"
)
; "
MICROPY_HW_BOARD_NAME
" with STM32F405RG
\r\n
"
);
stdout_tx_str
(
"Type
\"
help()
\"
for more information.
\r\n
"
);
stdout_tx_str
(
"Type
\"
help()
\"
for more information.
\r\n
"
);
// to test ctrl-C
// to test ctrl-C
...
...
This diff is collapsed.
Click to expand it.
unix/main.c
+
1
−
1
View file @
977a0ce2
...
@@ -142,7 +142,7 @@ STATIC char *prompt(char *p) {
...
@@ -142,7 +142,7 @@ STATIC char *prompt(char *p) {
}
}
STATIC
void
do_repl
(
void
)
{
STATIC
void
do_repl
(
void
)
{
printf
(
"Micro Python
build
"
MICROPY_GIT_HASH
" on "
MICROPY_BUILD_DATE
"; UNIX version
\n
"
);
printf
(
"Micro Python
"
MICROPY_GIT_TAG
" (
"
MICROPY_GIT_HASH
" on "
MICROPY_BUILD_DATE
"
)
; UNIX version
\n
"
);
for
(;;)
{
for
(;;)
{
char
*
line
=
prompt
(
">>> "
);
char
*
line
=
prompt
(
">>> "
);
...
...
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