⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tick.h

📁 motorola jw32 usb 源码
💻 H
字号:
/*********************************************************************
 *
 *                  MFT MAC layer
 *
 *********************************************************************
 * FileName:        Tick.h
 * Dependencies:
 * Processor:       c51
 * Company:         chengdu MFT, Inc.
 *
 * Software License Agreement
 *
 *
 * Author               Date    Comment
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * jiangchao    				5/09/05 Rel 0.1
 ********************************************************************/

#include "public.h"

#include "mft.h"
typedef WORD  TICK;

#if !defined(TICKS_PER_SECOND)
    #error TICKS_PER_SECOND must be defined.
#endif

#if !defined(TICK_PRESCALE_VALUE)
    #error TICK_PRESCALE_VALUE must be defined.
#endif

#define TICK_SECOND             (TICKS_PER_SECOND)


extern TICK TickCount;

/*********************************************************************
 * Function:        void TickInit(void)
 *
 * PreCondition:    None
 *
 * Input:           None
 *
 * Output:          Tick manager is initialized.
 *
 * Side Effects:    None
 *
 * Overview:        Initializes Timer0 as a tick counter.
 *
 * Note:            None
 ********************************************************************/
extern void TickInit(void);



/*********************************************************************
 * Function:        TICK TickGet(void)
 *
 * PreCondition:    None
 *
 * Input:           None
 *
 * Output:          Current second value is given
 *
 * Side Effects:    None
 *
 * Overview:        None
 *
 * Note:            None
 ********************************************************************/
extern TICK TickGet(void);


/*********************************************************************
 * Macro:           TickGetDiff(current, previous)
 *
 * PreCondition:    None
 *
 * Input:           current - Current tick count
 *                  previous - Previous tick count
 *
 * Output:          Different of two
 *
 * Side Effects:    None
 *
 * Overview:        Calculates tick difference.
 *
 * Note:            None
 ********************************************************************/
extern TICK TickGetDiff(TICK a, TICK b) ;   


/*********************************************************************
 * Function:        void TickUpdate(void)
 *
 * PreCondition:    None
 *
 * Input:           None
 *
 * Output:          None
 *
 * Side Effects:    None
 *
 * Overview:        Internal Tick and Seconds count are updated.
 *
 * Note:            None
 ********************************************************************/
extern void TickUpdate(void);

/*********************************************************************
 * Function:        void TickReload()
 *
 *
 * Overview:       reload timer0 value.continue interrupt
 *
 * Note:            None
 ********************************************************************/
extern void TickReload();
/*********************************************************************
 * Function:       void delayms(BYTE delayms)
 *
 *
 * Input:           delayms:delay time unit ms
 *
 * Output:          None
 *
 * Side Effects:    None
 *
 * Overview:        Internal Tick and Seconds count are updated.
 *
 * Note:            None
 ********************************************************************/
extern void delayms(BYTE delayms);
extern TICK TickGetMinute(void);

⌨️ 快捷键说明

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