Skip to content
Snippets Groups Projects
Commit 51b786f8 authored by jamesimmanuel.magsino@stud.h-da.de's avatar jamesimmanuel.magsino@stud.h-da.de
Browse files

more hmmm

parent c03cdb86
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment