1234567891011121314151617181920212223242526272829 |
- #include <avr/interrupt.h>
- #define MAX_SENSOR_NUM 1
- #define KEY_ESC 128
- #define KEY_UP 32
- #define KEY_DOWN 16
- #define KEY_LEFT 64
- #define KEY_RIGHT 8
- #define KEY_1 1
- #define KEY_2 2
- #define KEY_OK 4
- #define ms(x) ((unsigned int)x/16)
- struct timers {
- unsigned int tick;
- unsigned int owire;
- };
- extern volatile struct timers timers;
- static inline void atomic_set_uint(volatile unsigned int *volatile data, unsigned int value) __attribute__((always_inline));
- static inline void atomic_set_uint(volatile unsigned int *volatile data, unsigned int value){
- cli();
- *data = value;
- sei();
- }
|