ram_count.c
来自「oki67500系列arm工程例程源代码」· C语言 代码 · 共 50 行
C
50 行
/**********************************************************************/
/* */
/* Copyright (C) 2003 Oki Electric Industry Co., LTD. */
/* */
/* System Name : ML675001 series */
/* Module Name : count up variable at internal RAM */
/* File Name : ram_count.c */
/* Revision : 01.00 */
/* Date : 2003/03/09 initial version */
/* */
/**********************************************************************/
#include "ml675001.h"
#include "common.h"
#include "irq.h"
int ram_count(void);
extern void init_irq(void); /* initialize IRQ */
extern void reg_irq_handler(void); /* registration of IRQ handler */
extern void set_timer(void); /* setup TIMER */
extern void timer_handler(void); /* TIMER handler */
extern volatile int timer_flag;
/**********************************************************************/
/* count up variable at internal RAM */
/* Function : ram_count */
/* Parameters */
/* Input : Nothing */
/* Output : count up value */
/**********************************************************************/
int ram_count(void)
{
int count;
timer_flag = 0;
count = 0;
set_timer();
irq_en();
put_hvalue(TMEN, 0x01); /* enable timer */
while(timer_flag == 0)
count++;
irq_dis();
return count;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?