⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 44btest.c

📁 《基于s3c44B0X嵌入式uCLinux系统原理及应用》李岩编的ppt
💻 C
字号:
#include <string.h>
#include "..\inc\option.h"
#include "..\inc\44b.h"
#include "..\inc\44blib.h"
#include "..\inc\def.h"
#include "..\inc\cache.h"
#include "..\inc\lcdlib.h"
#include "..\inc\44blcd.h"

void Isr_Init(void);
void HaltUndef(void);
void HaltSwi(void);
void HaltPabort(void);
void HaltDabort(void);

unsigned char *Buf;

void Main(void)
{
    int i;

    rSYSCFG=SYSCFG_8KB;

    Isr_Init();
    Port_Init();
    Uart_Init(0,115200);
    LcdInit();     //to avoid LCD damage.
    Uart_Select(0);
    Delay(0);  //calibrate Delay()
    while(1)
    {
	Lcd_C256_Bmp( 0, 0, 320, 240, acBmp1_320_240_C256 ) ;		//paint bmp
	Delay(20000); 
	Lcd_C256_Bmp( 0, 0, 320, 240, acBmp2_320_240_c256 ) ;		//paint bmp
	Delay(20000);
	Lcd_C256_Bmp( 0, 0, 320, 240, acBmp3_320_240_c256 ) ;		//paint bmp
	Delay(20000);	
	Lcd_C256_Bmp( 0, 0, 320, 240, acBmp4_320_240_c256 ) ;		//paint bmp
	Delay(20000);
    }
}

void Isr_Init(void)
{
    U32 i;

    pISR_UNDEF=(unsigned)HaltUndef;
    pISR_SWI  =(unsigned)HaltSwi;
    pISR_PABORT=(unsigned)HaltPabort;
    pISR_DABORT=(unsigned)HaltDabort;

     for(i=_RAM_STARTADDRESS;i<(_RAM_STARTADDRESS+0x20);i+=4)
    {
	*((volatile unsigned *)i)=0xEA000000+0x1FFE;
    }
    rINTCON=0x5;	  // Non-vectored,IRQ enable,FIQ disable
    rINTMOD=0x0;	  // All=IRQ mode
    rINTMSK|=BIT_GLOBAL|BIT_EINT3;	  // All interrupt is masked.
}

void HaltUndef(void)
{
    Uart_Printf("Undefined instruction exception!!!\n");
    while(1)
    {
    	Led_Display(0);
    	Delay(100);
    	Led_Display(0xF);
    	Delay(100);}
}

void HaltSwi(void)
{
    Uart_Printf("SWI exception!!!\n");
    while(1)
    {
    	Led_Display(0);
    	Delay(150);
    	Led_Display(0xF);
    	Delay(150);}
}

void HaltPabort(void)
{
    Uart_Printf("Pabort exception!!!\n");
    while(1)
    {
    	Led_Display(0);
    	Delay(200);
    	Led_Display(0xF);
    	Delay(200);}
}

void HaltDabort(void)
{
    Uart_Printf("Dabort exception!!!\n");
    while(1)
    {
    	Led_Display(0);
    	Delay(250);
    	Led_Display(0xF);
    	Delay(250);}
}







⌨️ 快捷键说明

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