Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
embedded-systems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
James Immanuel Magsino
embedded-systems
Commits
51b786f8
Commit
51b786f8
authored
3 months ago
by
jamesimmanuel.magsino@stud.h-da.de
Browse files
Options
Downloads
Patches
Plain Diff
more hmmm
parent
c03cdb86
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.c
+4
-2
4 additions, 2 deletions
src/main.c
with
4 additions
and
2 deletions
src/main.c
+
4
−
2
View file @
51b786f8
...
...
@@ -121,7 +121,8 @@ void callback(uint gpio, uint32_t events)
{
uint32_t
event3
=
events
;
volatile
uint
slice_num
=
pwm_gpio_to_slice_num
(
27
);
volatile
duration
=
pwm_get_counter
(
slice_num
)
*
42
;
/* volatile uint another_slice_num = pwm_gpio_to_slice_num(27);
if (events & GPIO_IRQ_LEVEL_HIGH)
...
...
@@ -171,6 +172,7 @@ void pwm_echo_init()
29 gpio_set_function(gpio, GPIO_FUNC_PWM);
*/
// count once for every 42 cycles the PWM B input is high
// one cycle approximately equal to 20 ms
pwm_set_clkdiv
(
slice_num
,
42
);
pwm_set_wrap
(
slice_num
,
0xFFFF
);
pwm_set_clkdiv_mode
(
slice_num
,
PWM_DIV_B_HIGH
);
...
...
@@ -211,7 +213,7 @@ int main()
while
(
1
)
{
}
}
/*
timer_hw->dbgpause = 0;
gpio_init(27);
...
...
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