Subversion Repositories FlightCtrl

Rev

Rev 685 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 685 Rev 687
Line 2... Line 2...
2
// + Copyright (c) 04.2007 Holger Buss
2
// + Copyright (c) 04.2007 Holger Buss
3
// + only for non-profit use
3
// + only for non-profit use
4
// + www.MikroKopter.com
4
// + www.MikroKopter.com
5
// + see the File "License.txt" for further Informations
5
// + see the File "License.txt" for further Informations
6
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
 
7
#include <stdlib.h>
-
 
8
#include <avr/io.h>
-
 
9
#include <avr/interrupt.h>
-
 
10
 
7
#include "analog.h"
11
#include "analog.h"
8
#include "main.h"
12
#include "main.h"
9
#include "timer0.h"
13
#include "timer0.h"
10
#include "fc.h"
14
#include "fc.h"
11
#include "printf_P.h"
15
#include "printf_P.h"
-
 
16
#include "eeprom.h"
Line 12... Line 17...
12
 
17
 
13
volatile int16_t Current_Nick = 0, Current_Roll = 0, Current_Gier = 0;
18
volatile int16_t Current_Nick = 0, Current_Roll = 0, Current_Gier = 0;
14
volatile int16_t Current_AccX = 0, Current_AccY = 0, Current_AccZ = 0;
19
volatile int16_t Current_AccX = 0, Current_AccY = 0, Current_AccZ = 0;
15
volatile int16_t UBat = 100;
20
volatile int16_t UBat = 100;
Line 54... Line 59...
54
    SREG = sreg;
59
    SREG = sreg;
55
}
60
}
Line 56... Line 61...
56
 
61
 
57
void SucheLuftruckOffset(void)
62
void SucheLuftruckOffset(void)
58
{
63
{
59
 unsigned int off;
64
 uint8_t off;
60
 off = eeprom_read_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET]);
65
 off = GetParamByte(PID_LAST_OFFSET);
61
 if(off > 20) off -= 10;
66
 if(off > 20) off -= 10;
62
 OCR0A = off;
67
 OCR0A = off;
63
 Delay_ms_Mess(100);
68
 Delay_ms_Mess(100);
64
 if(MessLuftdruck < 850) off = 0;
69
 if(MessLuftdruck < 850) off = 0;
Line 67... Line 72...
67
  OCR0A = off;
72
  OCR0A = off;
68
  Delay_ms_Mess(50);
73
  Delay_ms_Mess(50);
69
  printf(".");
74
  printf(".");
70
  if(MessLuftdruck < 900) break;
75
  if(MessLuftdruck < 900) break;
71
  }
76
  }
72
 eeprom_write_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET], off);
77
 SetParamByte(PID_LAST_OFFSET, off);
73
 DruckOffsetSetting = off;
78
 DruckOffsetSetting = off;
74
 Delay_ms_Mess(300);
79
 Delay_ms_Mess(300);
75
}
80
}