📄 timers.txt
字号:
There are now timers available for use. There are four timers available,each of which counts down from a user-defined value to zero at a rate of10 counts/second. Each timer is 16 bits, allowing timouts of up to 1hour and 49 minutes. When a timer reaches zero, it will generate anevent and remain at zero until set again.These three functions access the four timers: void set_timer(unsigned char timer, unsigned int value);Set a timer to a particular value and start it counting down. unsigned int read_timer(unsigned char timer);Read the current 16 bit count for a timer. void clear_timer(unsigned char timer);Stop a timer and clear its count to zero. No event is generated.The new timer code also keeps a 32 bit system clock, whichincrements at 10 Hz (will overflow in 13.6 years). This may be read with the following function and readings may besubtracted from each other for long duration time measurement. unsigned long clock_tick(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -