Subversion Repositories FlightCtrl

Rev

Rev 1645 | Rev 1874 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1645 Rev 1646
Line 2... Line 2...
2
#include "timer0.h"
2
#include "timer0.h"
3
#include "configuration.h"
3
#include "configuration.h"
Line 4... Line 4...
4
 
4
 
Line -... Line 5...
-
 
5
#include <avr/io.h>
-
 
6
 
-
 
7
/*
-
 
8
 * Configuration for my prototype board with InvenSense gyros.
-
 
9
 * The FC 1.3 board is installed upside down, therefore Z acc is reversed but not roll.
-
 
10
 */
-
 
11
const uint8_t GYRO_REVERSED[3] = {0,0,0};
5
#include <avr/io.h>
12
const uint8_t ACC_REVERSED[3] = {0,0,1};
6
 
13
 
7
#define AUTOZERO_PORT PORTD
14
#define AUTOZERO_PORT PORTD
Line 8... Line -...
8
#define AUTOZERO_DDR DDRD
-
 
9
#define AUTOZERO_BIT 5
-
 
10
 
15
#define AUTOZERO_DDR DDRD
11
const uint8_t GYROS_REVERSE[2] = {0,0};
16
#define AUTOZERO_BIT 5
12
 
17
 
13
void gyro_calibrate() {
18
void gyro_calibrate() {
14
  // If port not already set to output and high, do it.
19
  // If port not already set to output and high, do it.
Line 27... Line 32...
27
}
32
}
Line 28... Line 33...
28
 
33
 
29
void gyro_setDefaults(void) {
34
void gyro_setDefaults(void) {
30
  staticParams.GyroD = 3;
35
  staticParams.GyroD = 3;
31
  staticParams.GyroAccFactor = 1;
36
  staticParams.GyroAccFactor = 1;
Line 32... Line 37...
32
  staticParams.DriftComp = 1;
37
  staticParams.DriftComp = 10;  
33
 
38
 
34
  // Not used.
39
  // Not used.
35
  staticParams.AngleTurnOverPitch = 85;
40
  staticParams.AngleTurnOverPitch = 85;