Rev 966 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 966 | Rev 973 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | Copyright 2008, by Michael Walter |
2 | Copyright 2008, by Michael Walter |
3 | 3 | ||
4 | All functions written by Michael Walter are free software and can be redistributed and/or modified under the terms of the GNU Lesser |
4 | All functions written by Michael Walter are free software and can be redistributed and/or modified under the terms of the GNU Lesser |
5 | General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but |
5 | General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but |
6 | WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
6 | WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
7 | See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public |
7 | See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public |
8 | License along with this program. If not, see <http://www.gnu.org/licenses/>. |
8 | License along with this program. If not, see <http://www.gnu.org/licenses/>. |
9 | 9 | ||
10 | Please note: The software is based on the framework provided by H. Buss and I. Busker in their Mikrokopter projekt. All functions that |
10 | Please note: The software is based on the framework provided by H. Buss and I. Busker in their Mikrokopter projekt. All functions that |
11 | are not written by Michael Walter are under the license by H. Buss and I. Busker (license_buss.txt) published by www.mikrokopter.de |
11 | are not written by Michael Walter are under the license by H. Buss and I. Busker (license_buss.txt) published by www.mikrokopter.de |
12 | unless it is stated otherwise. |
12 | unless it is stated otherwise. |
13 | */ |
13 | */ |
14 | 14 | ||
15 | extern int UBat; |
15 | extern int UBat; |
16 | extern int AdWertNick, AdWertRoll, AdWertGier; |
- | |
17 | extern int AdWertAccRoll,AdWertAccNick,AdWertAccHoch; |
- | |
18 | extern int AdWertNick_Raw, AdWertRoll_Raw, AdWertGier_Raw; |
16 | extern int AdWertNick_Raw, AdWertRoll_Raw, AdWertGier_Raw; |
- | 17 | extern int AdWertAccRoll,AdWertAccNick,AdWertAccHoch; |
|
19 | extern int AdWertAccHoch_Raw, AdWertAccRoll_Raw,AdWertAccNick_Raw, AdWertAccHoch_Raw; |
18 | extern int AdWertAccHoch_Raw, AdWertAccRoll_Raw,AdWertAccNick_Raw, AdWertAccHoch_Raw; |
20 | extern int AccumulatedACC_X, AccumulatedACC_Y, AccumulatedACC_Z; |
19 | extern int AccumulatedACC_X, AccumulatedACC_Y, AccumulatedACC_Z; |
21 | extern int AccumulatedACC_X_cnt, AccumulatedACC_Y_cnt, AccumulatedACC_Z_cnt; |
20 | extern int AccumulatedACC_X_cnt, AccumulatedACC_Y_cnt, AccumulatedACC_Z_cnt; |
22 | extern int AccumulatedRoll_X, AccumulatedRoll_Y, AccumulatedRoll_Z, AccumulatedAirPressure; |
21 | extern int AccumulatedRoll, AccumulatedNick, AccumulatedGier, AccumulatedAirPressure; |
23 | extern int AccumulatedRoll_X_cnt, AccumulatedRoll_Y_cnt, AccumulatedRoll_Z_cnt, AccumulatedAirPressure_cnt; |
22 | extern int AccumulatedRoll_cnt, AccumulatedNick_cnt, AccumulatedGier_cnt, AccumulatedAirPressure_cnt; |
24 | extern unsigned int AdWertAirPressure_Raw; |
23 | extern unsigned int AdWertAirPressure_Raw; |
25 | 24 | ||
26 | void ADC_Init(void); |
25 | void ADC_Init(void); |
27 | void SucheLuftruckOffset(void); |
26 | void SucheLuftruckOffset(void); |
28 | 27 | ||
29 | #define ANALOG_OFF ADCSRA=0 |
28 | #define ANALOG_OFF ADCSRA=0 |
30 | #define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
29 | #define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
31 | 30 |