Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
raspberry
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
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
af3
raspberry
Commits
b517780a
Commit
b517780a
authored
7 years ago
by
fortissBot
Browse files
Options
Downloads
Patches
Plain Diff
fixed lrf bug, added gpio function
refs 7890
parent
ef0c43cc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
org.fortiss.af3.platform.raspberry/trunk/lib/src/GPIO.c
+12
-2
12 additions, 2 deletions
org.fortiss.af3.platform.raspberry/trunk/lib/src/GPIO.c
org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c
+4
-1
4 additions, 1 deletion
...s.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c
with
16 additions
and
3 deletions
org.fortiss.af3.platform.raspberry/trunk/lib/src/GPIO.c
+
12
−
2
View file @
b517780a
#include
"inc/GPIO.h"
// init, term
GEN_TYPE_boolean
gpio_initialized
=
false
;
GEN_TYPE_boolean
gpio_terminated
=
false
;
void
gpio_init
(
GPIO_PIN_T
pin
)
{
// important, since all pins are accessing the same method
if
(
gpio_initialized
)
return
;
gpio_initialized
=
true
;
// TODO initialize...
}
void
gpio_term
(
GPIO_PIN_T
pin
)
{
void
gp_term
()
{
// important, since all pins are accessing the same method
if
(
gpio_terminated
)
return
;
gpio_terminated
=
false
;
}
// noval
...
...
@@ -15,7 +25,7 @@ GEN_TYPE_boolean gpio_is_noval(GPIO_PIN_T pin) {
}
void
gpio_set_noval
(
GPIO_PIN_T
pin
)
{
// do nothing
}
// readers
...
...
This diff is collapsed.
Click to expand it.
org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c
+
4
−
1
View file @
b517780a
...
...
@@ -30,12 +30,15 @@ GEN_TYPE_int lrf_read() {
// looks like a blocking call and actually is but is always very fast
// since it only has to read the queue
while
(
1
)
{
n_read
=
uart_receive
(
bytes
,
5
,
0
);
n_read
=
uart_receive
(
&
bytes
,
5
,
0
);
for
(
i
=
0
;
i
<
n_read
;
i
++
)
{
if
(
bytes
[
i
]
!=
0xd
&&
bytes
[
i
]
!=
0xa
)
{
value
[
n
++
]
=
bytes
[
i
];
}
else
if
(
atoi
(
value
)
!=
0
)
{
for
(
i
=
n
;
i
<
3
;
i
++
)
{
value
[
i
]
=
0
;
}
return
atoi
(
value
);
}
}
...
...
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