We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 118e55f commit 2716695Copy full SHA for 2716695
src/pico_servo.c
@@ -18,7 +18,6 @@ uint max;
18
19
static int slice_map[30];
20
static uint slice_active[8];
21
-static void (*pwm_cb[8])(void);
22
static uint servo_pos[32];
23
static uint servo_pos_buf[16];
24
static pwm_config slice_cfg[8];
@@ -65,8 +64,6 @@ int servo_attach(uint pin)
65
64
return 1;
66
}
67
68
- printf("slice: %d\n", slice);
69
-
70
gpio_set_function(pin, GPIO_FUNC_PWM);
71
slice_map[pin] = slice;
72
@@ -79,6 +76,7 @@ int servo_attach(uint pin)
79
76
pwm_config_set_wrap(&slice_cfg[slice], WRAP);
80
77
pwm_config_set_clkdiv(&slice_cfg[slice], clkdiv);
81
78
pwm_init(slice, &slice_cfg[slice], true);
+ pwm_set_chan_level(slice, pin % 2, 90);
82
83
84
++slice_active[slice];
0 commit comments