timer_conf.h

来自「SOS操作系统用于无线传感器网络节点的源代码」· C头文件 代码 · 共 60 行

H
60
字号
#ifndef _TIMER_CONF_H
#define _TIMER_CONF_H

// careful with these defines that is a zero not an O.
// the second number is a divesor on the clock source
// read them as: Timer0 clock/##
#define CLK_OFF	 0
/*#define CLK_1	 1
#define CLK_8	 2
#define CLK_32	 3
#define CLK_64	 4
#define CLK_128	 5
#define CLK_256	 6
#define CLK_1024 7
*/
//by ZHOU YA JIN
#define CLK_1	 0
#define CLK_2	 1
#define CLK_3	 2
#define CLK_8	 3
#define CLK_16	 4
#define CLK_32	 5
#define CLK_64   6
#define CLK_128   7

#define DEFAULT_INTERVAL        0x10
//BY ZHOU YA JIN
#define DEFAULT_SCALE           CLK_128
#define TIMER_MIN_INTERVAL      5

//NOTICE:IF YOU CHANGE THE TIMER_FREQ,the macro MS100-MS80000 need to be changed accoringly.
#define TIMER_FREQ              250000L
#define DEFAULT_TIMER_FREQ      0x38 //0.25mhz
#define SCALE_NUMBER            (2<<7)

#define MS100                   195
#define MS200                   391
#define MS300                   (MS100+MS200)
#define MS400                   781
#define MS500                   (MS100+MS400)
#define MS600                   (MS100+MS500)
#define MS700                   (MS100+MS600)
#define MS800                   1563
#define MS900                   (MS100+MS800)
#define MS1000                  1953
#define MS2000                  3906
#define MS3000                  (MS1000+MS2000)
#define MS4000                  7812
#define MS5000                  (MS1000+MS4000)
#define MS6000                  (MS1000+MS5000)
#define MS7000                   (MS1000+MS6000)
#define MS8000                  15625




#define MAX_PRE_ALLOCATED_TIMERS 10 //! Keep this an even value to make the mod_header_t structure 16 bits aligned

#endif

⌨️ 快捷键说明

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