main.c

来自「s3c2410 example code , it s a simple cod」· C语言 代码 · 共 106 行

C
106
字号
// --------------------------------------------------------------------
//
//   Title     :  MAIN
//             :
//   Library   :
//             :
//   Developers:  MICROTIME MDS group
//             :
//   Purpose   : DIP2LED
//             :
//   Limitation:
//             :
//   Note      :
//             :
// --------------------------------------------------------------------
//   modification history :
// --------------------------------------------------------------------
//   Version| mod. date: |
//   V1.0   | 03/31/2003 | First release
// --------------------------------------------------------------------
//
// Note:
//
//       MICROTIME COMPUTER INC.
//
//


/*************************************************************************
Include files
*************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <inarm.h>
#include "driver.h"

/*************************************************************************
MAIN Program 
*************************************************************************/
int main(void)
{
         while (1)
         {   
              UC ch;
              IO_REG2 = 0xff00; 
              ch = IO_REG1;
	      if(ch & 1)
	      {
	           IO_REG2 = 0xfe00;
	           Delay (500);
	           IO_REG2 = 0xfd00;
	           Delay (500);
	           IO_REG2 = 0xfb00;
	           Delay (500);
	           IO_REG2 = 0xf700;
	           Delay (500);
	           IO_REG2 = 0xef00;
	           Delay (500);
	           IO_REG2 = 0xdf00;
	           Delay (500);
	           IO_REG2 = 0xbf00;
	           Delay (500);
	           IO_REG2 = 0x7f00;
	           Delay (500);
	      }
	      if(ch & 2)
	      {
	           IO_REG2 = 0x5500;
	           Delay (500);
	           IO_REG2 = 0xAA00;
	           Delay (500);
	      }
	      if(ch & 4)
	      {
	           IO_REG2 = 0xf000;
	           Delay (500);
	           IO_REG2 = 0x0f00;
	           Delay (500);
	      }
	      if(ch & 8)
	      {
	           
	           IO_REG2 = 0x7f00;
	           Delay (500);
	           IO_REG2 = 0xbf00;
	           Delay (500);
	           IO_REG2 = 0xdf00;
	           Delay (500);
	           IO_REG2 = 0xef00;
	           Delay (500);
	           IO_REG2 = 0xf700;
	           Delay (500);
	           IO_REG2 = 0xfb00;
	           Delay (500);
	           IO_REG2 = 0xfd00;
	           Delay (500);
	           IO_REG2 = 0xfe00;
	           Delay (500);
	      }
         }        
   
}


⌨️ 快捷键说明

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