📄 count.c
字号:
/**********************************************************************/
/* */
/* Copyright (C) 2003 Oki Electric Industry Co., LTD. */
/* */
/* System Name : ML675001 series CPU BOARD */
/* Module Name : count up variable routine */
/* File Name : count.c */
/* Revision : 01.00 */
/* Date : 2003/08/18 */
/* */
/**********************************************************************/
#include "ml675001.h"
#include "common.h"
#include "irq.h"
void init_irq(void); /* initialize IRQ */
void reg_irq_handler(void); /* registration of IRQ handler */
void set_timer(void); /* setup TIMER */
extern volatile int timer_flag;
/**********************************************************************/
/* count up variable */
/* Function : count */
/* Parameters */
/* Input : Nothing */
/* Output : count up value */
/**********************************************************************/
int count(void)
{
int counter;
timer_flag = 0;
counter = 0;
set_timer();
irq_en();
put_hvalue(TMEN, 0x01); /* enable timer */
while(timer_flag == 0){
counter++;
}
irq_dis();
return counter;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -