Subversion Repositories FlightCtrl

Rev

Rev 2015 | Rev 2060 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1612 dongfang 1
#ifndef _TIMER0_H
2
#define _TIMER0_H
3
 
4
#include <inttypes.h>
5
 
2052 - 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
 
1908 - 12
#define BEEP_MODULATION_NONE 0xFFFF
13
#define BEEP_MODULATION_RCALARM 0x0C00
14
#define BEEP_MODULATION_I2CALARM 0x0080
15
#define BEEP_MODULATION_BATTERYALARM 0x0300
16
#define BEEP_MODULATION_EEPROMALARM 0x0007
17
 
1887 - 18
extern volatile uint16_t millisecondsCount;
19
extern volatile uint8_t  runFlightControl;
1612 dongfang 20
extern volatile uint16_t cntKompass;
1887 - 21
extern volatile uint16_t beepModulation;
22
extern volatile uint16_t beepTime;
1612 dongfang 23
#ifdef USE_NAVICTRL
24
extern volatile uint8_t SendSPI;
25
#endif
26
 
27
extern void timer0_init(void);
1887 - 28
extern void delay_ms(uint16_t w);
2015 - 29
extern void delay_ms_with_adc_measurement(uint16_t w, uint8_t stop);
1887 - 30
extern uint16_t setDelay(uint16_t t);
31
extern int8_t checkDelay(uint16_t t);
1612 dongfang 32
 
33
#endif //_TIMER0_H