📄 main.c
字号:
#include "../inc/def.h"
#include "../inc/config.h"
#include "../inc/board.h"
#include "../inc/utils.h"
#include "../inc/shell.h"
//changge by change
#include "../inc/irq.h"
#include "../inc/lcd.h"
#include "../inc/D12def.h"
//#include "../inc/iic.h"
extern int NetPortNumber;
void DftEnvInit(void);
/*为相应的中断向量地址分配相应
处理程序的响应入口*/
static __inline void VectorInit(void)
{
UdfInsVector = (U32)UndefHandler;
SwiSvcVector = (U32)SwiHandler;
InsAbtVector = (U32)FetchAbortHandler;
DatAbtVector = (U32)DataAbortHandler;
FiqSvcVector = (U32)FiqHandler;
}
/*********************************
端口分配:
**********************************/
void LedDisp(void)
{
U16 m ;
LedSet( 0xff ); //LED点亮/熄灭状态设置
Delay(80);
LedSet( 0x00 ); //LED点亮/熄灭状态设置
Delay(80);
for( m = 0 ; m < 8 ; m++ )
{
LedSet( 1<<(m) ); //LED点亮/熄灭状态设置
Delay(80);
}
for( m = 0 ; m < 8 ; m++ )
{
LedSet( 0x80>>(m) ); //LED点亮/熄灭状态设置
Delay(80);
}
LedSet( 0 ); //LED点亮/熄灭状态设置
}
/****************************************************************************
【功能说明】系统主函数
****************************************************************************/
void Main(void)
{
DisableInt(); //Disable interrupt
TimerInit(TIMER_FREQ);
PortInit();
#ifdef TFTP_DOWNLOAD_SUPPORT
eth_init();
arp_init();
#endif
VectorInit();
#ifdef NOR_FLASH_SUPPORT
NorFlashInit();
#endif
#ifdef SAVE_ENV_SUPPORT
if(LoadEnv())
DftEnvInit();
#else
DftEnvInit();
#endif
TimerInit(TIMER_FREQ);
CacheDisable();
//CacheFlush();
//CacheEnable();
//Beep(2000, 100);
//LedDisp(); //LED来回闪烁显示
ShowBootInfo();
//while(1)LInstRegWrite(0x11);
#ifdef NOR_FLASH_SUPPORT
NorFlashStatusRep();
#endif
// InitInterrupt();
// EnableInt();
printf("Build date : %s--%s\n", __DATE__, __TIME__);
// D12Main();
// NetPortNumber=2;
// Net_Test();
#ifdef CMD_SHELL_SUPPORT
ShellIn();
#else
while(1) {
LedDisp();
ERROR("No Command Shell, Enter This Loop Forever...\n");
}
#endif
}
//***************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -