📄 main.c
字号:
#include <string.h>
#include "Target\option.h"
#include "Target\44b.h"
#include "Target\44blib.h"
#include <stdio.h>
#include "flashtest\flash.h"
/********************************************/
// S3C44BOX(ARM7TDMI Core) 开发板演示工具
// 日期:2003-12-28
// 作者:Litai
// Email:rao_dali@263.net
// 版本:1.1
// 系统配置:
// Bank0:System Monitor(SST39VF160)
// Bank1:16MB Nand-Flash
// Bank2:IDE
// Bank3:USB(USBN9603)
// Bank4:Ethernet
// Bank5:保留
// Bank6:8MB SDRAM
// Bank7:保留
/********************************************/
void * function[][2]=
{
(void *)Read_ID, "Read chip ID",
(void *)Erase_test, "Erase the last block",
(void *)Write_test, "Write first page of the block with 0xAA",
(void *)Read_test, "Verify the writed content",
0,0
};
void Main(void)
{
char aa,*str;
int i;
rSYSCFG=CACHECFG; // Using 8KB Cache//
*str='1';
*(str+1)='\0';
i=atoi(str);
Port_Init();
Uart_Init(0,115200);
Led_Display(0xf);
Delay(0);
Beep(0x1);
/*******************************/
/* Cache test */
/*******************************/
Uart_Select(0); //Select UART0//
Uart_Printf("\n*************************************************************************");
Beep(0x0);
Uart_Printf("\n* 立泰电子工作室 *");
Uart_Printf("\n* -Nandflash读写测试- *");
Uart_Printf("\n* Version 1.11 *");
Uart_Printf("\n* Email:rao_dali@263.net *");
Uart_Printf("\n* UART Config--COM:115.2kbps,8Bit,NP,UART0 *");
Uart_Printf("\n*----------------Begin to Start Nandflash test,OK? (Y/N)----------------*");
Led_Display(0x0);
aa= Uart_Getch();
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%2)==0)
Uart_Printf("\n");
}
Uart_Printf("\nSelect the function to test?");
i=Uart_GetIntNum();
i--;
Uart_Printf("\n");
if(i>=0 && (i<(sizeof(function)/8)) )
( (void (*)(void)) (function[i][0]) )();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -