File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 2828
2929void servo_set_bounds (uint , uint );
3030
31- int servo_init ();
32- int servo_clock_auto ();
31+ int servo_init (void );
32+ int servo_clock_auto (void );
3333int servo_clock_source (uint );
3434int servo_clock_manual (uint );
3535int servo_attach (uint );
36- int servo_enable ();
36+ int servo_enable (void );
3737int servo_move_to (uint , uint );
3838int servo_microseconds (uint , uint );
3939
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ static uint min_us = 500;
5050static uint max_us = 2500 ;
5151static float us_per_unit = 0.f ;
5252
53- static void wrap_cb ()
53+ static void wrap_cb (void )
5454{
5555 uint offset ;
5656
@@ -86,7 +86,7 @@ void servo_set_bounds(uint a, uint b)
8686 }
8787}
8888
89- int servo_init ()
89+ int servo_init (void )
9090{
9191 for (int i = 0 ; i < 30 ; ++ i )
9292 {
@@ -96,12 +96,13 @@ int servo_init()
9696 memset (servo_pos , 0 , 32 * sizeof (uint ));
9797 memset (servo_pos_buf , 0 , 16 * sizeof (uint ));
9898
99- irq_set_exclusive_handler (PWM_IRQ_WRAP , wrap_cb );
99+ //irq_set_exclusive_handler(PWM_IRQ_WRAP, wrap_cb);
100+ irq_add_shared_handler (PWM_IRQ_WRAP , wrap_cb , PICO_SHARED_IRQ_HANDLER_DEFAULT_ORDER_PRIORITY );
100101
101102 return 0 ;
102103}
103104
104- int servo_clock_auto ()
105+ int servo_clock_auto (void )
105106{
106107 return servo_clock_source (CLOCKS_FC0_SRC_VALUE_PLL_SYS_CLKSRC_PRIMARY );
107108}
You can’t perform that action at this time.
0 commit comments