查看: 1236|回复: 0
打印 上一主题 下一主题

关于C语言讨论一下 附代码

[复制链接]
跳转到指定楼层
沙发
发表于 2016-4-27 21:29:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[size=2]struct {
         void (*fun)(void);
         char *tip;
}CmdTip[] = {
                                 { Temp_function, "Please input 1-14 to select test"},
                                 { Uart2_Test, "COM port ( UART2 ) test"},
                                 { UsbMain, "Download file from PC via USB port"},
                                 //{ comdownload, "Download file from PC via COM port"},
                                 { BUZZER_PWM_Test, "Buzzer test"},
                                 { RTC_Display, "Real time clock display" },
                                 { Test_Adc, "ADC test" },
                                 { Key_Scan_Test, "8*2 key array test"},
                                 { Touch_Screen_Init, "Touchpanel test" },
                                 {Test_Lcd_AT070TN83, "7.0# TFT LCD 800*480 test"},
                                 {Test_Lcd_AT080TN52, "8.0# TFT LCD 800*600 test"},
                                 { Test_Lcd_WXCAT43,  "4.3# TFT LCD 480*272 test"},
                                 {Test_Lcd_CT35TF05,  "3.5# TFT LCD 320*240 test"},
                                 { Test_IrDA_Tx, "IRDA test"},
                                 { Test_Iic, "IIC EEPROM test" },
                                 { PlayMusicTest, "UDA1341 play audio test"},
                                 { RecordTest, "UDA1341 record audio test"},
                                 { SDI_test, "SD Card write and read test"},
                                 {Led_Test,"led test"},
                                 { 0, 0}                                                
                         };

/************************************************************/
void KeyScanInit(void);

int Main()
{
         int i;        
         
#if 0                        //bank0 modified to RO_START  
     MMU_Init();        //MMU should be reconfigured or turned off for the debugger,
     //After downloading, MMU should be turned off for the MMU based program,such as WinCE.        
#else
     MMU_EnableICache();      
#endif                  
         SetClockDivider(1, 1);
         SetSysFclk(DFT_FCLK_VAL);
         Delay( 0 ) ;
         Port_Init();
         Isr_Init();
         Uart_Select(0);
         Uart_Init(0, UART_BAUD);
         RequestBiosTimerEvent(10, Led1Flash);        //when request, auto open bios timer
         RequestBiosTimerEvent(20, Led2Flash);
         RequestBiosTimerEvent(50, Led3Flash);
         RequestBiosTimerEvent(100, Led4Flash);
         //GPIO,UART0,PWM TIMER,NAND FLASH
         EnableModuleClock(CLOCK_UART0|CLOCK_TIMER|CLOCK_GPIO|CLOCK_NAND|CLOCK_LCD);

     Lcd_Port_Init();
     Lcd_Init();
     rLCDCON1 |= 1;         // ENVID=ON
     Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x1f) );     //clear screen
         Beep( 2000, 2000 ) ;


         while(1)
         {
                 U8 idx=0;
                 puts("\nPlease select function : \n");        
                 for(i=0; CmdTip.fun!=0; i++)
                         printf("%2d : %s\n", i, CmdTip.tip);
                 idx = Uart_GetIntNum_GJ() ;
                 {
                         (*CmdTip[idx].fun)();
                 }        
         }                  


这个是某开发板的硬件测试 界面想请教一下红色字体部分的是什么意思 谢谢各位了

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 加入因仑

本版积分规则

快速回复 返回顶部 返回列表