main.c

来自「嵌入式系统mcf5213华恒光盘开发板附源代码a」· C语言 代码 · 共 47 行

C
47
字号
/*
 * File:		main.c
 * Purpose:		Main process
 *
 */

#include "common.h"

/********************************************************************/

#define DELAY   150000  /* Delay in micro-seconds */

/********************************************************************/
void 
main (void)
{
	int i;
	
    /* Global interrupt enable */
	mcf5xxx_irq_enable();

	printf("Running the \"Example\" project\n");
	
    /* 
     * This is the example project.
     * To create a new project, copy the example project files into
     * a new project folder and make modifications there.  The 
     * project make/build files are in the mcf5213/build directory.
     *
     * This project simply toggles the LEDs
     */
	while(1)
	{
	    for (i = 1; i < 8; i<<=1)
	    {
	        board_led_display(i);
	        cpu_pause(DELAY);
	    }
	    for (i = 8; i > 1; i>>=1)
	    {
	        board_led_display(i);
	        cpu_pause(DELAY);
	    }
	}
}
/********************************************************************/

⌨️ 快捷键说明

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