Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
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
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
c377f00e
Commit
c377f00e
authored
8 years ago
by
bbartels
Committed by
dawehr
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wip: fix pwm_output test
parent
8eacb08a
No related branches found
No related tags found
1 merge request
!9
Abstract the hardware layer
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
quad/xsdk_workspace/modular_quad_pid/src/hw_impl_zybo_pwm_output.c
+1
-1
1 addition, 1 deletion
..._workspace/modular_quad_pid/src/hw_impl_zybo_pwm_output.c
quad/xsdk_workspace/modular_quad_pid/src/hw_impl_zybo_tests.c
+11
-7
11 additions, 7 deletions
.../xsdk_workspace/modular_quad_pid/src/hw_impl_zybo_tests.c
with
12 additions
and
8 deletions
quad/xsdk_workspace/modular_quad_pid/src/hw_impl_zybo_pwm_output.c
+
1
−
1
View file @
c377f00e
...
...
@@ -3,7 +3,7 @@
#define THROTTLE_PULSE_WIDTH_LOW 100000 // 1us
#define THROTTLE_PULSE_WIDTH_HIGH 200000 // 2us
#define PERIOD_WIDTH 222222 // 100000000 ns / 450
#define PULSE_WIDTH_ADDR_OFFSET
4
#define PULSE_WIDTH_ADDR_OFFSET
1
struct
PWMOutputDriverState
{
int
*
outputs
[
4
];
...
...
This diff is collapsed.
Click to expand it.
quad/xsdk_workspace/modular_quad_pid/src/hw_impl_zybo_tests.c
+
11
−
7
View file @
c377f00e
...
...
@@ -95,7 +95,7 @@ int test_zybo_pwm_inputs() {
for
(
i
=
0
;
i
<
6
;
i
+=
1
)
{
pwm_inputs
.
read
(
&
pwm_inputs
,
i
,
&
pwms
[
i
]);
}
int
temp
=
0
;
continue
;
}
}
...
...
@@ -117,18 +117,22 @@ int test_zybo_pwm_inputs() {
int
test_zybo_pwm_outputs
()
{
struct
PWMOutputDriver
pwm_outputs
=
create_zybo_pwm_outputs
();
pwm_outputs
.
reset
(
&
pwm_outputs
);
struct
SystemDriver
sys
=
create_zybo_system
();
sys
.
reset
(
&
sys
);
unsigned
long
pwms
[
4
];
pwms
[
0
]
=
1000
;
pwms
[
1
]
=
1000
;
pwms
[
2
]
=
1000
;
pwms
[
3
]
=
1000
;
pwms
[
0
]
=
100000
;
pwms
[
1
]
=
100000
;
pwms
[
2
]
=
100000
;
pwms
[
3
]
=
100000
;
int
n
=
0
;
while
(
1
)
{
int
i
;
for
(
i
=
0
;
i
<
4
;
i
+=
1
)
{
pwm_outputs
.
write
(
&
pwm_outputs
,
i
,
pwms
[
i
]);
pwm_outputs
.
write
(
&
pwm_outputs
,
i
,
pwms
[
i
]
+
n
++
);
sys
.
sleep
(
&
sys
,
50
);
}
int
temp
=
0
;
continue
;
}
}
...
...
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