Rev 1910 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1910 | Rev 2099 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #ifndef _TIMER0_H |
1 | #ifndef _TIMER0_H |
2 | #define _TIMER0_H |
2 | #define _TIMER0_H |
Line 3... | Line 3... | ||
3 | 3 | ||
Line -... | Line 4... | ||
- | 4 | #include <inttypes.h> |
|
- | 5 | ||
- | 6 | // Normally it is 20MHz/2048 = 9765.625 Hz |
|
- | 7 | #define F_TIMER0IRQ ((float)F_CPU/2048.0) |
|
- | 8 | #define MAINLOOP_DIVIDER 10 |
|
- | 9 | // Originally it is 488 |
|
- | 10 | #define F_MAINLOOP (F_TIMER0IRQ/(2.0*MAINLOOP_DIVIDER)) |
|
- | 11 | ||
- | 12 | #define BEEP_MODULATION_NONE 0xFFFF |
|
- | 13 | #define BEEP_MODULATION_RCALARM 0x0C00 |
|
- | 14 | #define BEEP_MODULATION_I2CALARM 0x0080 |
|
- | 15 | #define BEEP_MODULATION_BATTERYALARM 0x0300 |
|
4 | #include <inttypes.h> |
16 | #define BEEP_MODULATION_EEPROMALARM 0x0007 |
5 | 17 | ||
6 | extern volatile uint16_t millisecondsCount; |
- | |
7 | extern volatile uint8_t runFlightControl; |
18 | extern volatile uint32_t globalMillisClock; |
8 | extern volatile uint16_t cntKompass; |
19 | extern volatile uint8_t runFlightControl; |
9 | extern volatile uint16_t beepModulation; |
20 | extern volatile uint16_t beepModulation; |
10 | extern volatile uint16_t beepTime; |
21 | extern volatile uint16_t beepTime; |
11 | #ifdef USE_NAVICTRL |
22 | #ifdef USE_NAVICTRL |
Line 12... | Line 23... | ||
12 | extern volatile uint8_t SendSPI; |
23 | extern volatile uint8_t SendSPI; |
13 | #endif |
24 | #endif |
14 | 25 | ||
15 | extern void timer0_init(void); |
26 | extern void timer0_init(void); |
16 | extern void delay_ms(uint16_t w); |
27 | extern void delay_ms(uint16_t w); |
Line 17... | Line 28... | ||
17 | extern void delay_ms_Mess(uint16_t w); |
28 | extern void delay_ms_with_adc_measurement(uint16_t w, uint8_t stop); |