?? main.c.bak
字號(hào):
#include <string.h>
#include <stdio.h>
#include "Target\44blib.h"
#include "Target\44b.h"
#include "iisdmatest\iis.h"
void * function[][2]=
{
(void *)Record_Iis, "Test Recording and Playing ",
0,0
}; //這個(gè)函數(shù)做什么?
void Isr_Init(void)
{
rINTCON=0x5; //Non-vectored,IRQ enable,FIQ disable //
rINTMOD=0x0; //All=IRQ mode//
//rINTMSK=~(BIT_EINT0 | BIT_GLOBAL); //開(kāi)(不屏蔽)0中斷源
}
void Main(void)
{
char aa;
int i;
int sock_fd,new_fd; /*sock_fd,new_fd是套接字描述*/
char filename[20]; /*存放要傳送文件的文件名*/
struct sockaddr_in my_addr; /*服務(wù)器的地址結(jié)構(gòu)體*/
struct sockaddr_in their_addr; /*主機(jī)的地址結(jié)構(gòu)體*/
int sin_size;
FILE *fp;
char szsendbuf[1024],head[8]; /*發(fā)送數(shù)據(jù)緩沖區(qū)大小為1K*/
int nsize, allsize=0;;
int *phead=head+4;
Port_Init();
Uart_Init(0,115200);
Isr_Init();
Led_Display(0xf);
Delay(0);
Beep(0x1);
Uart_Select(0); //Select UART0//
Uart_Printf("\n*************************************************************************");
Beep(0x0);
Uart_Printf("\n* -S3C44B0X+uda1341音頻實(shí)驗(yàn)- *");
Uart_Printf("\n* Version 1.01 *");
Uart_Printf("\n* By:Morningsword@sohu.com *");
Uart_Printf("\n* UART Config--COM:115.2kbps,8Bit,NP,UART0 *");
Uart_Printf("\n*------------------Begin to Start Record&Play test,OK? (Y/N)--------------------*");
Led_Display(0x0);
aa= Uart_Getch(); //等待并從串口中得到一個(gè)字符
if((aa=='Y')||(aa=='y'))
while(1)
{
i=0;
Uart_Printf("\n");
while(1)
{ //display menu
Uart_Printf("%2d:%s",i+1,function[i][1]);
i++;
if((int)(function[i][0])==0)
{
Uart_Printf("\n");
break;
}
if((i%4)==0)
Uart_Printf("\n");
}
Uart_Printf("\nSelect the function to test?");
i=Uart_GetIntNum();
i=i-1;
Uart_Printf("\n");
if(i>=0 && (i<(sizeof(function)/8)) ) //sizeof是求字節(jié)數(shù)運(yùn)算符
( (void (*)(void)) (function[i][0]) )();
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -