Rev 2060 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2060 | Rev 2189 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | 3 | ||
Line 4... | Line 4... | ||
4 | #include <inttypes.h> |
4 | #include <inttypes.h> |
5 | 5 | ||
6 | // Normally it is 20MHz/2048 = 9765.625 Hz |
6 | // Normally it is 20MHz/2048 = 9765.625 Hz |
7 | #define F_TIMER0IRQ ((float)F_CPU/2048.0) |
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)) |
8 | #define T_TIMER0IRQ ((float)2048.0/(float)F_CPU) |
11 | 9 | // About 250 Hz |
|
12 | #define BEEP_MODULATION_NONE 0xFFFF |
10 | #define F_CONTROL 250 |
13 | #define BEEP_MODULATION_RCALARM 0x0C00 |
- | |
14 | #define BEEP_MODULATION_I2CALARM 0x0080 |
11 | #define CONTROLLOOP_DIVIDER (F_TIMER0IRQ/F_CONTROL) |
15 | #define BEEP_MODULATION_BATTERYALARM 0x0300 |
12 | #define SERIALLOOP_DIVIDER 61 |
16 | #define BEEP_MODULATION_EEPROMALARM 0x0007 |
13 | #define OUTPUTLOOP_DIVIDER 100 |
17 | - | ||
18 | extern volatile uint32_t globalMillisClock; |
- | |
19 | extern volatile uint8_t runFlightControl; |
14 | |
20 | extern volatile uint16_t beepModulation; |
- | |
21 | extern volatile uint16_t beepTime; |
15 | extern volatile uint32_t jiffiesClock; |
22 | #ifdef USE_NAVICTRL |
- | |
Line 23... | Line 16... | ||
23 | extern volatile uint8_t SendSPI; |
16 | extern volatile uint32_t millisClock; |
24 | #endif |
17 | extern volatile uint8_t loopJiffiesClock; |
25 | - | ||
26 | extern void timer0_init(void); |
18 | |
27 | extern void delay_ms(uint16_t w); |
19 | extern void timer0_init(void); |
Line -... | Line 20... | ||
- | 20 | extern void delay_ms(uint16_t w); |
|
- | 21 | extern uint16_t setDelay(uint16_t t); |
|
- | 22 | extern int8_t checkDelay(uint16_t t); |
|
- | 23 | ||
- | 24 | typedef enum { |
|
- | 25 | NOT_RUNNING = 0, |
|
- | 26 | RUNNING, |
|
- | 27 | BLOCKED_FOR_CALIBRATION |
|
28 | extern void delay_ms_with_adc_measurement(uint16_t w, uint8_t stop); |
28 | } FlightControlRunStatus; |