main.c

来自「这是单片机C51典型应用设计代码」· C语言 代码 · 共 33 行

C
33
字号
#include <REG400.H>
#include <stdio.h>
#include <string.h>
#include "srom.h"

extern void count (void);

/*---------------------------------------------------------
Define SROM Segment Variables
---------------------------------------------------------*/
SROM_PS (COUNT_COUNTER)

/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
void main (void)
{
/*---------------------------------------------------------
Copy the count function into RAM
---------------------------------------------------------*/
memcpy (SROM_PS_TRG_FD(COUNT_COUNTER),
        SROM_PS_SRC(COUNT_COUNTER),
        SROM_PS_LEN(COUNT_COUNTER));

/*---------------------------------------------------------
Call the count function (over and over).
---------------------------------------------------------*/
while (1)
  {
  count();
  }
}

⌨️ 快捷键说明

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