jtimerdef.h

来自「在Freescale16位单片机MC9s12dp256上移植了J1939源码和操」· C头文件 代码 · 共 70 行

H
70
字号
/*--------------------------------------------------------------------
       TIMERDEF.H
  --------------------------------------------------------------------
       Copyright (C) 1998-2004 Vector Informatik GmbH, Stuttgart

       Function: Timer functions header
  --------------------------------------------------------------------*/

#ifndef _TIMERDEF_H_
#define _TIMERDEF_H_

#define ucOS


/*--------------------------------------------------------------------*/
/*  constants definitions                                             */
/*--------------------------------------------------------------------*/
/*!
  \def TIME_FROM_OS
  Switch timer source from hardware timer to operating system.
  - 0 timer source is hardware timer.
  - 1 timer source is operating system.
  - 2 timer source is ucOS
*/

#ifdef WIN32
# define TIME_FROM_OS 1  /* 0 or 1 ,2 */
#endif
#ifdef ucOS
# define TIME_FROM_OS 2  /* 0 or 1,2 */
#else
# define TIME_FROM_OS 0  /* 0 or 1,2 */
#endif

/*! The basic time in ms, typical 5 */
#define BASIC_TIME 5
#define TIM_BASE 1

/*! The generic timer handler is executed every given ms, typical 10 */
#define COMM_TIMER_CYCLE 10

/* Check timing values */
#if BASIC_TIME > COMM_TIMER_CYCLE
# error "Basic time quantum exceeds communication cycle time !"
#endif



/*--------------------------------------------------------------------*/
/*  function prototypes                                               */
/*--------------------------------------------------------------------*/
void Tim_InitTimer(WORD);
unsigned char Tim_StartTimer(void);
unsigned char Tim_StopTimer(void);
WORD Tim_GetCurrentTime(void);

#endif /* _TIMERDEF_H_ */



/*--------------------------------------------------------------------*/
/*  documentation                                                     */
/*--------------------------------------------------------------------*/

/*!
  \file
  \brief Timer functions header.
*/

⌨️ 快捷键说明

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