📄 timer_user.c
字号:
/*
* $Id: timer_user.c,v 1.13 2007/10/23 07:52:04 sunny Exp $
*/
/*
*******************************************************************************
**
** This device driver was created by Applilet for the 78K0/KB2, 78K0/KC2,
** 78K0/KD2, 78K0/KE2 and 78K0/KF2 8-Bit Single-Chip Microcontrollers.
**
** Copyright(C) NEC Electronics Corporation 2002 - 2005
** All rights reserved by NEC Electronics Corporation.
**
** This program should be used on your own responsibility.
** NEC Electronics Corporation assumes no responsibility for any losses
** incurred by customers or third parties arising from the use of this file.
**
** Filename : timer_user.c
** Abstract : This file implements a device driver for the timer module
** APIlib: NEC78K0KX2.lib V1.01 [09 Aug. 2005]
**
** Device : uPD78F0537
**
** Compiler: NEC/CC78K0
**
*******************************************************************************
*/
#pragma sfr
#pragma interrupt INTTMH0 MD_INTTMH0
/*
*******************************************************************************
** Include files
*******************************************************************************
*/
#include "unet.h"
#include "timer.h"
#include "unet.h"
// static volatile UINT16 WaitMSCount;
#if SEND_MSG_TIME_STAMP
extern volatile UINT8 MsgLineCnt;
#endif // #if SEND_MSG_TIME_STAMP
/*
*******************************************************************************
** MacroDefine
*******************************************************************************
*/
/* Timer00, Timer01 pulse width measure */
/*
**-----------------------------------------------------------------------------
**
** Abstract:
** TMH0 INTTMH0 interrupt service routine
**
** Parameters:
** None
**
** Returns:
** None
**
**-----------------------------------------------------------------------------
*/
__interrupt void MD_INTTMH0( )
{
/* TODO */
// if(--WaitMSCount == 0)
// TMH0_Stop();
++tick_count; /* 1 millisecond system timer tick counter */
timer_1ms_flag = 1;
#if SEND_MSG_TIME_STAMP
MsgLineCnt = 0;
#endif // #if SEND_MSG_TIME_STAMP
}
#if 0
/*******************************************************************************
Timer Function
********************************************************************************/
void WaitMS(UINT16 count)
{
extern volatile INTERRUPT_STS IntStatus;
if(count) {
WaitMSCount = count;
TMH0_Start();
while(WaitMSCount) {
#if 1
if(IntStatus.Rx) { //Received a frame
unet_msg_dispatch();
}
#endif
}
}
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -