globals.h
来自「AVR单片机有趣的展示」· C头文件 代码 · 共 34 行
H
34 行
#ifndef _GLOBALS_H_
#define _GLOBALS_H_ 1
#define NULL 0
// Frequencies
#define F_CPU 1000000L
#define ASYNC_TIMER 128 // Hz
//KEY's
#define KEY_ENTPRELL 2 //x*ASYNC_TIMER
#define KEY_OFF 255 //
#define KEY_SETAUTO 192 //192=1,5 seconds
// Timings
#define MODE_MAX 8 //Quantity of modes
#define AUTO_PERIOD 64 //Quantity of periods until to next mode if Auto change is activated
#define BRIGHT_PERIOD 16 //Quantity of Async periods for light refresh
#define BRIGHT_ONTIME 1 // 1 = darkest light (one period of async int)
#define SPEED_FACTOR 1 //defines the number of bright periods when the next led step is shown
//other global variables
volatile uint8_t new_tick;
uint8_t led_mode;
uint8_t led_bright;
volatile uint8_t key_new, key, key_cnt, key_old;
//volatile uint8_t in_led;
#endif /* _GLOBALS_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?