Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MojitOS
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sepia-pub
MojitOS
Commits
1aa72c5c
Commit
1aa72c5c
authored
2 years ago
by
ghuter
Browse files
Options
Downloads
Patches
Plain Diff
rename counter_ex to sensor_ex
parent
10d6b8c4
No related branches found
No related tags found
4 merge requests
!9
fix sensor example (doc)
,
!4
Amd, Tests, Doc, CI/CD
,
!2
build system (v0), add long options
,
!1
build system (v0), add long options, corrections
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/sensor_ex.c
+7
-7
7 additions, 7 deletions
doc/sensor_ex.c
doc/sensor_ex.h
+3
-3
3 additions, 3 deletions
doc/sensor_ex.h
with
10 additions
and
10 deletions
doc/
counte
r_ex.c
→
doc/
senso
r_ex.c
+
7
−
7
View file @
1aa72c5c
...
...
@@ -5,7 +5,7 @@
# normally, this part is done with `configure.sh`, but here we need to
# do this manually
cat <<EOF > src/sensors.h
#include "
counte
r_ex.h"
#include "
senso
r_ex.h"
#define NB_SENSOR 1
#define NB_SENSOR_OPT 1
...
...
@@ -13,22 +13,22 @@ cat <<EOF > src/sensors.h
void init_sensors(Optparse *opts, Sensor *sensors, size_t len, size_t offset, int *nb_defined)
{
int opt_idx = offset;
for (int i = 0; i <
counte
r_ex.nb_opt; i++) {
opts[opt_idx++] =
counte
r_ex_opt[i];
for (int i = 0; i <
senso
r_ex.nb_opt; i++) {
opts[opt_idx++] =
senso
r_ex_opt[i];
}
sensors[(*nb_defined)++] =
counte
r_ex;
sensors[(*nb_defined)++] =
senso
r_ex;
assert((offset + *nb_defined) <= len);
}
EOF
# idem
echo 'CAPTOR_OBJ = doc/
counters
_ex.o' > sensors.mk
echo 'CAPTOR_OBJ = doc/
sensor
_ex.o' > sensors.mk
# actual compilation here
gcc -std=gnu99 -Wall -Wpedantic -I./lib -I./doc -I./src -g -Og -c doc/
counte
r_ex.c -o obj/
counte
r_ex.o
gcc -std=gnu99 -Wall -Wpedantic -I./lib -I./doc -I./src -g -Og -c doc/
senso
r_ex.c -o obj/
senso
r_ex.o
gcc -std=gnu99 -Wall -Wpedantic -I./lib -I./doc -I./src -g -Og -c doc/util.c -o obj/util.o
gcc -std=gnu99 -Wall -Wpedantic -I./lib -I./doc -I./src -g -Og -c doc/mojitos.c -o obj/mojitos.o
gcc -std=gnu99 -Wall -Wpedantic -I./lib -I./doc -I./src -g -Og obj/util.o obj/mojitos.o obj/
counte
r_ex.o -o bin/mojitos
gcc -std=gnu99 -Wall -Wpedantic -I./lib -I./doc -I./src -g -Og obj/util.o obj/mojitos.o obj/
senso
r_ex.o -o bin/mojitos
*
**/
...
...
This diff is collapsed.
Click to expand it.
doc/
counte
r_ex.h
→
doc/
senso
r_ex.h
+
3
−
3
View file @
1aa72c5c
/*
* Example of a basic
counte
r: an accumulator
* Example of a basic
senso
r: an accumulator
**/
unsigned
int
init_acc
(
char
*
,
void
**
);
...
...
@@ -7,7 +7,7 @@ unsigned int get_acc(uint64_t *results, void *);
void
clean_acc
(
void
*
);
void
label_acc
(
char
**
labels
,
void
*
);
Sensor
counte
r_ex
=
{
Sensor
senso
r_ex
=
{
.
init
=
init_acc
,
.
get
=
get_acc
,
.
clean
=
clean_acc
,
...
...
@@ -15,7 +15,7 @@ Sensor counter_ex = {
.
nb_opt
=
1
,
};
Optparse
counte
r_ex_opt
[
1
]
=
{
Optparse
senso
r_ex_opt
[
1
]
=
{
{
.
longname
=
"accumulator"
,
.
shortname
=
'a'
,
...
...
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