📄 main.c
字号:
/*
;************************************************************************************************************
;* 北京精仪达盛科技有限公司
;* 研 发 部
;*
;* http://www.techshine.com
;*
;*--------------------------------------------- 文件信息 ----------------------------------------------------
;*
;* 文件名称 : MAIN.c
;* 文件功能 : 应用程序
;* 补充说明 :
;*-------------------------------------------- 最新版本信息 -------------------------------------------------
;* 修改作者 : ARM开发小组
;* 修改日期 : 2004/00/00
;* 版本声明 : V1.0.1
;*-------------------------------------------- 历史版本信息 -------------------------------------------------
;* 文件作者 : ARM开发小组
;* 创建日期 : 2004/06/25
;* 版本声明 : v1.0.0
;*-----------------------------------------------------------------------------------------------------------
;*-----------------------------------------------------------------------------------------------------------
;************************************************************************************************************
;*/
#include "..\inc\config.h"
/*
*************************************************************************************************************
- 函数名称 : Main(void)
- 函数说明 : 系统的主程序入口
- 输入参数 : 无
- 输出参数 : 无
*************************************************************************************************************
*/
void Main(void)
{
INT8U aa;
U16 temp;
int i;
Target_Init(); // ARMII实验系统的初始化,包括CPU板
printf("Start\n是否测试FLASH\n");
aa= Uart_Getch();
if((aa=='Y')||(aa=='y'))
{
SST39VF160_SectorErase(511);
Uart_Printf("\nSector erase successfully!");
if(SST39VF160_CheckBlank(511))//是否为空
{
Uart_Printf("\nBlank check OK! Begin to Write the sector...");
for(i=0;i<2048;i++)
{
if(SST39VF160_WordProg(0xff800+i,0xaa55))
{
Delay(2);
}
else
Uart_Printf("adr=%d,Write Error",i);
}
Uart_Printf("\nWrite OK! Begin to Verify... ");
for(i=0;i<2048;i++)
{
temp = Readflash(0xff800+i);
if(temp!= 0xaa55)
{
Uart_Printf("\nadr=%4d,temp = %4x Verify Error!",i,temp);
}
}
Uart_Printf("\nVerify OK! Begin to erase the sector...");
SST39VF160_SectorErase(511);
Uart_Printf("\nSector erase successfully!");
}
else
Uart_Printf("\nThe Sector is not empty! Abort the test!");
}
while(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -