flash.c

来自「smdk40100 40mhz test code」· C语言 代码 · 共 49 行

C
49
字号
#include <string.h>
#include "..\include\option.h"
#include "..\include\def.h"
#include "..\include\k401.h"
#include "..\include\k401lib.h"
#include "..\include\am29lv800.h"

void *flashType[][2]=
{
    (void *)ProgramAM29LV800,     "AM29LV800BB         ",
    0,0
};




void ProgramFlash(void)
{
    int i=0, temp0, temp1;
    temp0='q'-'a';
    temp1='Q'-'a';

    Uart_Printf("*** NOR Flash Memory writer ver 0.0 ***\n");

    rSYSCFG=rSYSCFG & (~WRBUF_ON);		//write buffer has to be off for proper timing.
    while(1)
    {
	Uart_Printf("=========================================================================\n");
	while(1)
	{
	    Uart_Printf("%c: %s",'a'+i,flashType[i][1]);
	    i++;
	    if((int)(flashType[i][0])==0){Uart_Printf("\nq: Return to Main Menu\n");break;}
	    if((i%4)==0)Uart_Printf("\n");
	}
	Uart_Printf("=========================================================================\n");
	Uart_Printf("Select the function to test?");
	i=Uart_Getch()-'a';
	
	if(i==temp0 || i==temp1) break;
	else
	{
	    Uart_Printf("\n");
	    if(i>=0 && (i<(sizeof(flashType)/8)) ) 
		( (void (*)(void)) (flashType[i][0]) )();
	}
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?