Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
99
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
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
Projects
White Rabbit Switch - Software
Commits
98ab45ee
Commit
98ab45ee
authored
13 years ago
by
Benoit Rat
Browse files
Options
Downloads
Patches
Plain Diff
Add the git version inside the flasher
parent
91a0b560
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
usb-loader/.gitignore
+1
-0
1 addition, 0 deletions
usb-loader/.gitignore
usb-loader/Makefile
+14
-6
14 additions, 6 deletions
usb-loader/Makefile
usb-loader/mch_flasher.c
+8
-1
8 additions, 1 deletion
usb-loader/mch_flasher.c
with
23 additions
and
7 deletions
usb-loader/.gitignore
+
1
−
0
View file @
98ab45ee
version.c
mch_flasher
This diff is collapsed.
Click to expand it.
usb-loader/Makefile
+
14
−
6
View file @
98ab45ee
OBJS
=
mch_flasher.o serial_linux.o version.o
OUTPUT
=
mch_flasher
OBJS
=
mch_flasher.o serial_linux.o
FLASHER
=
mch_flasher
all
:
$(OBJS)
${
CC
}
-o
$(
OUTPUT
)
$(
OBJS
)
all
:
$(FLASHER)
$(FLASHER)
:
$(OBJS)
${
CC
}
-o
$@
$(
OBJS
)
version.c
:
../.git/HEAD ../.git/index
echo
"/**"
>
$@
echo
" * File automatically generated by Makefile (DO NOT MODIFIED)
\n
*
\n
* To use this you in a c code just add the following lines:
\n
* "
>>
$@
echo
"
\t
extern const char build_time[];
\n\t
extern const char git_user[];
\n\t
extren const char git_revision[];
\n
* "
>>
$@
echo
"**/"
>>
$@
echo
'const char build_time[] = __DATE__ " @ " __TIME__ ;'
>>
$@
echo
"const char git_user[] =
\"
$(
shell git config --get user.name
)
\"
;"
>>
$@
echo
"const char git_revision[] =
\"
$(
shell git rev-parse HEAD
)
\"
;"
>>
$@
echo
""
>>
$@
clean
:
rm
-f
$(
OBJS
)
$(
FLASHER
)
*
~
rm
-f
version.c
$(
OBJS
)
$(
OUTPUT
)
:q:q
This diff is collapsed.
Click to expand it.
usb-loader/mch_flasher.c
+
8
−
1
View file @
98ab45ee
...
...
@@ -42,6 +42,11 @@
#define PORT_SPEED 115200
//External variable from version.c
extern
const
char
build_time
[];
extern
const
char
git_user
[];
extern
const
char
git_revision
[];
char
*
program_path
;
int
applet_silent_mode
=
1
;
...
...
@@ -418,6 +423,8 @@ main(int argc, char *argv[])
if
(
argc
>
2
)
serial_port
=
argv
[
2
];
//Print line to know the version of software for testing purpose
fprintf
(
stderr
,
"
\n
Compiled by %s (%s)
\n
git rev:%s
\n\n
"
,
git_user
,
build_time
,
git_revision
);
program_path
=
dirname
(
argv
[
0
]);
...
...
@@ -437,4 +444,4 @@ main(int argc, char *argv[])
serial_close
();
return
0
;
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
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