File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
arc_design_contest/2018/XDU_Autofollowing_suitcase/src/driver/buzzer Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,18 @@ static void delay_ms(volatile int z) //1ms
1414void beep (void )
1515{
1616 port_alarm = gpio_get_dev (DW_GPIO_PORT_C );
17- port_alarm -> gpio_open (0x10000000 );//C28
18- port_alarm -> gpio_control (GPIO_CMD_SET_BIT_DIR_OUTPUT , (void * )10000000 );
17+ port_alarm -> gpio_open (0x10000000 );
18+ port_alarm -> gpio_control (GPIO_CMD_SET_BIT_DIR_OUTPUT , (void * )0x10000000 );
1919
2020 port_alarm -> gpio_write (0x10000000 , 0x10000000 );
21-
22- delay_ms ( 5000 );
23-
21+ port_alarm -> gpio_read ( & data , 0x10000000 );
22+ EMBARC_PRINTF ( " gpio is :%x\n" , data );
23+ delay_ms ( 1000 );
2424 port_alarm -> gpio_write (0x00000000 , 0x10000000 );
25+ port_alarm -> gpio_read (& data , 0x10000000 );
26+ EMBARC_PRINTF (" gpio is :%x\n" , data );
27+ delay_ms (1000 );
2528 EMBARC_PRINTF ("beep" );
2629
2730}
28-
31+
You can’t perform that action at this time.
0 commit comments