main.c.bak

来自「coldfire5307的bootloader 将程序写入flash」· BAK 代码 · 共 94 行

BAK
94
字号
#include "mcf5307.h" 

MCF5307_IMM *imm;

void main(void)
{
 
 	unsigned long int i;
 unsigned int	LedOut=0x01;
 
 //to init imm
 imm=(MCF5307_IMM *)0x10000000;
 //cpu_cache_disable();
 //EnableCache();            //will close the int.

	while(1) 
	{
     	imm->parallel_port.PADAT=~LedOut;	
     	LedOut<<=1;
     	LedOut=LedOut/0x80+LedOut%0x80;     	
     	for(i=0;i<=0xfff0;i++)
     	{
				;
     	}
  }
   
} 
    

void Interrupt_UART1(void)   			// asigned to Level 5
{
 	//Add Code here!
}

void Interrupt_mbus(void)    			// asigned to Level 3
{
 	//Add Code here!
 	int i;
 	for(i=100;i>0;i--)
 	{
 		;	
 	}
 
 
  	*(unsigned short*)0x66500012=0x0000;	//clr the interrupt
  	*(unsigned short*)0x66500012=0xffff;
  
 
  	imm->parallel_port.PADAT=0x00;
  	imm->parallel_port.PADAT=0x00;
  	imm->parallel_port.PADAT=0x00;
  	imm->parallel_port.PADAT=0x00;
  	imm->parallel_port.PADAT=0x00;
  	imm->parallel_port.PADAT=0x00;
  	imm->parallel_port.PADAT=0x00;
  	imm->parallel_port.PADAT=0x00;
  	imm->parallel_port.PADAT=0xff;
}

void Interrupt_Level7(void)
{
 	//Add Code here!
}

void Interrupt_Level6(void)
{
 	//Add Code here!
    
}

void Interrupt_Level4(void)
{
 	//Add Code here!
}


void Interrupt_Level2(void)
{
 	//Add Code here!
}


void Interrupt_Level1(void)
{
 	//Add Code here!
}

void BusError(void)
{
 	//Add Code here!
}


⌨️ 快捷键说明

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