main.c

来自「長高44b0xi BIOS源碼 FS44B0II BIOS具有啟動、引導」· C语言 代码 · 共 61 行

C
61
字号
#include "../inc/def.h"
#include "../inc/config.h"
#include "../inc/board.h"
#include "../inc/utils.h"

void DftEnvInit(void);

static void SwiHandler(void)
{
	puts("Swi Interrupt detected\n");
		while(1);
}

static void DataAbortHandler(void) 
{
	puts("Data Abort detected\n");
	while (1);
}

static void FetchAbortHandler(void)
{
	puts("Prefetch Abort detected\n");
	while (1);
}

static void UndefHandler() 
{
	puts("Halt on Undefined instruction\n");
	while (1);
}

#ifndef	INTERRUPT_SUPPORT
static void IrqHandler(void)
{
	puts("Halt on IRQ!\n");
	while(1);
}
#endif

static void FiqHandler(void)
{
	puts("Halt on FIQ!\n");
	while(1);
}

static __inline void VectorInit(void)
{
	UdfInsVector = (U32)UndefHandler;
	SwiSvcVector = (U32)SwiHandler;
	InsAbtVector = (U32)FetchAbortHandler;
	DatAbtVector = (U32)DataAbortHandler;
	
#ifndef	INTERRUPT_SUPPORT
	IrqSvcVector = (U32)IrqHandler;
#endif
	FiqSvcVector = (U32)FiqHandler;
}

void LedDisp(void)
{
	LedSet(0x08);		//LED翴獹/憾防

⌨️ 快捷键说明

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