Rev 2167 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2167 | Rev 2172 | ||
---|---|---|---|
1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 | // + www.MikroKopter.com |
2 | // + www.MikroKopter.com |
3 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
3 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
4 | // + Software Nutzungsbedingungen (english version: see below) |
4 | // + Software Nutzungsbedingungen (english version: see below) |
5 | // + der Fa. HiSystems GmbH, Flachsmeerstrasse 2, 26802 Moormerland - nachfolgend Lizenzgeber genannt - |
5 | // + der Fa. HiSystems GmbH, Flachsmeerstrasse 2, 26802 Moormerland - nachfolgend Lizenzgeber genannt - |
6 | // + Der Lizenzgeber räumt dem Kunden ein nicht-ausschließliches, zeitlich und räumlich* unbeschränktes Recht ein, die im den |
6 | // + Der Lizenzgeber räumt dem Kunden ein nicht-ausschließliches, zeitlich und räumlich* unbeschränktes Recht ein, die im den |
7 | // + Mikrocontroller verwendete Firmware für die Hardware Flight-Ctrl, Navi-Ctrl, BL-Ctrl, MK3Mag & PC-Programm MikroKopter-Tool |
7 | // + Mikrocontroller verwendete Firmware für die Hardware Flight-Ctrl, Navi-Ctrl, BL-Ctrl, MK3Mag & PC-Programm MikroKopter-Tool |
8 | // + - nachfolgend Software genannt - nur für private Zwecke zu nutzen. |
8 | // + - nachfolgend Software genannt - nur für private Zwecke zu nutzen. |
9 | // + Der Einsatz dieser Software ist nur auf oder mit Produkten des Lizenzgebers zulässig. |
9 | // + Der Einsatz dieser Software ist nur auf oder mit Produkten des Lizenzgebers zulässig. |
10 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
10 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
11 | // + Die vom Lizenzgeber gelieferte Software ist urheberrechtlich geschützt. Alle Rechte an der Software sowie an sonstigen im |
11 | // + Die vom Lizenzgeber gelieferte Software ist urheberrechtlich geschützt. Alle Rechte an der Software sowie an sonstigen im |
12 | // + Rahmen der Vertragsanbahnung und Vertragsdurchführung überlassenen Unterlagen stehen im Verhältnis der Vertragspartner ausschließlich dem Lizenzgeber zu. |
12 | // + Rahmen der Vertragsanbahnung und Vertragsdurchführung überlassenen Unterlagen stehen im Verhältnis der Vertragspartner ausschließlich dem Lizenzgeber zu. |
13 | // + Die in der Software enthaltenen Copyright-Vermerke, Markenzeichen, andere Rechtsvorbehalte, Seriennummern sowie |
13 | // + Die in der Software enthaltenen Copyright-Vermerke, Markenzeichen, andere Rechtsvorbehalte, Seriennummern sowie |
14 | // + sonstige der Programmidentifikation dienenden Merkmale dürfen vom Kunden nicht verändert oder unkenntlich gemacht werden. |
14 | // + sonstige der Programmidentifikation dienenden Merkmale dürfen vom Kunden nicht verändert oder unkenntlich gemacht werden. |
15 | // + Der Kunde trifft angemessene Vorkehrungen für den sicheren Einsatz der Software. Er wird die Software gründlich auf deren |
15 | // + Der Kunde trifft angemessene Vorkehrungen für den sicheren Einsatz der Software. Er wird die Software gründlich auf deren |
16 | // + Verwendbarkeit zu dem von ihm beabsichtigten Zweck testen, bevor er diese operativ einsetzt. |
16 | // + Verwendbarkeit zu dem von ihm beabsichtigten Zweck testen, bevor er diese operativ einsetzt. |
17 | // + Die Haftung des Lizenzgebers wird - soweit gesetzlich zulässig - begrenzt in Höhe des typischen und vorhersehbaren |
17 | // + Die Haftung des Lizenzgebers wird - soweit gesetzlich zulässig - begrenzt in Höhe des typischen und vorhersehbaren |
18 | // + Schadens. Die gesetzliche Haftung bei Personenschäden und nach dem Produkthaftungsgesetz bleibt unberührt. Dem Lizenzgeber steht jedoch der Einwand |
18 | // + Schadens. Die gesetzliche Haftung bei Personenschäden und nach dem Produkthaftungsgesetz bleibt unberührt. Dem Lizenzgeber steht jedoch der Einwand |
19 | // + des Mitverschuldens offen. |
19 | // + des Mitverschuldens offen. |
20 | // + Der Kunde trifft angemessene Vorkehrungen für den Fall, dass die Software ganz oder teilweise nicht ordnungsgemäß arbeitet. |
20 | // + Der Kunde trifft angemessene Vorkehrungen für den Fall, dass die Software ganz oder teilweise nicht ordnungsgemäß arbeitet. |
21 | // + Er wird die Software gründlich auf deren Verwendbarkeit zu dem von ihm beabsichtigten Zweck testen, bevor er diese operativ einsetzt. |
21 | // + Er wird die Software gründlich auf deren Verwendbarkeit zu dem von ihm beabsichtigten Zweck testen, bevor er diese operativ einsetzt. |
22 | // + Der Kunde wird er seine Daten vor Einsatz der Software nach dem Stand der Technik sichern. |
22 | // + Der Kunde wird er seine Daten vor Einsatz der Software nach dem Stand der Technik sichern. |
23 | // + Der Kunde ist darüber unterrichtet, dass der Lizenzgeber seine Daten im zur Vertragsdurchführung erforderlichen Umfang |
23 | // + Der Kunde ist darüber unterrichtet, dass der Lizenzgeber seine Daten im zur Vertragsdurchführung erforderlichen Umfang |
24 | // + und auf Grundlage der Datenschutzvorschriften erhebt, speichert, verarbeitet und, sofern notwendig, an Dritte übermittelt. |
24 | // + und auf Grundlage der Datenschutzvorschriften erhebt, speichert, verarbeitet und, sofern notwendig, an Dritte übermittelt. |
25 | // + *) Die räumliche Nutzung bezieht sich nur auf den Einsatzort, nicht auf die Reichweite der programmierten Software. |
25 | // + *) Die räumliche Nutzung bezieht sich nur auf den Einsatzort, nicht auf die Reichweite der programmierten Software. |
26 | // + #### ENDE DER NUTZUNGSBEDINGUNGEN ####' |
26 | // + #### ENDE DER NUTZUNGSBEDINGUNGEN ####' |
27 | // + Hinweis: Informationen über erweiterte Nutzungsrechte (wie z.B. Nutzung für nicht-private Zwecke) sind auf Anfrage per Email an info(@)hisystems.de verfügbar. |
27 | // + Hinweis: Informationen über erweiterte Nutzungsrechte (wie z.B. Nutzung für nicht-private Zwecke) sind auf Anfrage per Email an info(@)hisystems.de verfügbar. |
28 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
28 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
29 | // + Software LICENSING TERMS |
29 | // + Software LICENSING TERMS |
30 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
30 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
31 | // + of HiSystems GmbH, Flachsmeerstrasse 2, 26802 Moormerland, Germany - the Licensor - |
31 | // + of HiSystems GmbH, Flachsmeerstrasse 2, 26802 Moormerland, Germany - the Licensor - |
32 | // + The Licensor grants the customer a non-exclusive license to use the microcontroller firmware of the Flight-Ctrl, Navi-Ctrl, BL-Ctrl, and MK3Mag hardware |
32 | // + The Licensor grants the customer a non-exclusive license to use the microcontroller firmware of the Flight-Ctrl, Navi-Ctrl, BL-Ctrl, and MK3Mag hardware |
33 | // + (the Software) exclusively for private purposes. The License is unrestricted with respect to time and territory*. |
33 | // + (the Software) exclusively for private purposes. The License is unrestricted with respect to time and territory*. |
34 | // + The Software may only be used with the Licensor's products. |
34 | // + The Software may only be used with the Licensor's products. |
35 | // + The Software provided by the Licensor is protected by copyright. With respect to the relationship between the parties to this |
35 | // + The Software provided by the Licensor is protected by copyright. With respect to the relationship between the parties to this |
36 | // + agreement, all rights pertaining to the Software and other documents provided during the preparation and execution of this |
36 | // + agreement, all rights pertaining to the Software and other documents provided during the preparation and execution of this |
37 | // + agreement shall be the property of the Licensor. |
37 | // + agreement shall be the property of the Licensor. |
38 | // + The information contained in the Software copyright notices, trademarks, other legal reservations, serial numbers and other |
38 | // + The information contained in the Software copyright notices, trademarks, other legal reservations, serial numbers and other |
39 | // + features that can be used to identify the program may not be altered or defaced by the customer. |
39 | // + features that can be used to identify the program may not be altered or defaced by the customer. |
40 | // + The customer shall be responsible for taking reasonable precautions |
40 | // + The customer shall be responsible for taking reasonable precautions |
41 | // + for the safe use of the Software. The customer shall test the Software thoroughly regarding its suitability for the |
41 | // + for the safe use of the Software. The customer shall test the Software thoroughly regarding its suitability for the |
42 | // + intended purpose before implementing it for actual operation. The Licensor's liability shall be limited to the extent of typical and |
42 | // + intended purpose before implementing it for actual operation. The Licensor's liability shall be limited to the extent of typical and |
43 | // + foreseeable damage to the extent permitted by law, notwithstanding statutory liability for bodily injury and product |
43 | // + foreseeable damage to the extent permitted by law, notwithstanding statutory liability for bodily injury and product |
44 | // + liability. However, the Licensor shall be entitled to the defense of contributory negligence. |
44 | // + liability. However, the Licensor shall be entitled to the defense of contributory negligence. |
45 | // + The customer will take adequate precautions in the case, that the software is not working properly. The customer will test |
45 | // + The customer will take adequate precautions in the case, that the software is not working properly. The customer will test |
46 | // + the software for his purpose before any operational usage. The customer will backup his data before using the software. |
46 | // + the software for his purpose before any operational usage. The customer will backup his data before using the software. |
47 | // + The customer understands that the Licensor collects, stores and processes, and, where required, forwards, customer data |
47 | // + The customer understands that the Licensor collects, stores and processes, and, where required, forwards, customer data |
48 | // + to third parties to the extent necessary for executing the agreement, subject to applicable data protection and privacy regulations. |
48 | // + to third parties to the extent necessary for executing the agreement, subject to applicable data protection and privacy regulations. |
49 | // + *) The territory aspect only refers to the place where the Software is used, not its programmed range. |
49 | // + *) The territory aspect only refers to the place where the Software is used, not its programmed range. |
50 | // + #### END OF LICENSING TERMS #### |
50 | // + #### END OF LICENSING TERMS #### |
51 | // + Note: For information on license extensions (e.g. commercial use), please contact us at info(@)hisystems.de. |
51 | // + Note: For information on license extensions (e.g. commercial use), please contact us at info(@)hisystems.de. |
52 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
52 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
53 | 53 | ||
54 | 54 | ||
55 | #ifndef EEMEM |
55 | #ifndef EEMEM |
56 | #define EEMEM __attribute__ ((section (".eeprom"))) |
56 | #define EEMEM __attribute__ ((section (".eeprom"))) |
57 | #endif |
57 | #endif |
58 | 58 | ||
59 | 59 | ||
60 | #include <avr/eeprom.h> |
60 | #include <avr/eeprom.h> |
61 | #include <string.h> |
61 | #include <string.h> |
62 | #include "eeprom.h" |
62 | #include "eeprom.h" |
63 | #include "uart.h" |
63 | #include "uart.h" |
64 | #include "led.h" |
64 | #include "led.h" |
65 | #include "main.h" |
65 | #include "main.h" |
66 | #include "fc.h" |
66 | #include "fc.h" |
67 | #include "twimaster.h" |
67 | #include "twimaster.h" |
68 | 68 | ||
69 | paramset_t EE_Parameter; |
69 | paramset_t EE_Parameter; |
70 | MixerTable_t Mixer; |
70 | MixerTable_t Mixer; |
71 | uint8_t RequiredMotors; |
71 | uint8_t RequiredMotors; |
72 | 72 | ||
73 | 73 | ||
74 | uint8_t RAM_Checksum(uint8_t* pBuffer, uint16_t len) |
74 | uint8_t RAM_Checksum(uint8_t* pBuffer, uint16_t len) |
75 | { |
75 | { |
76 | uint8_t crc = 0xAA; |
76 | uint8_t crc = 0xAA; |
77 | uint16_t i; |
77 | uint16_t i; |
78 | 78 | ||
79 | for(i=0; i<len; i++) |
79 | for(i=0; i<len; i++) |
80 | { |
80 | { |
81 | crc += pBuffer[i]; |
81 | crc += pBuffer[i]; |
82 | } |
82 | } |
83 | return crc; |
83 | return crc; |
84 | } |
84 | } |
85 | 85 | ||
86 | uint8_t EEProm_Checksum(uint16_t EEAddr, uint16_t len) |
86 | uint8_t EEProm_Checksum(uint16_t EEAddr, uint16_t len) |
87 | { |
87 | { |
88 | uint8_t crc = 0xAA; |
88 | uint8_t crc = 0xAA; |
89 | uint16_t off; |
89 | uint16_t off; |
90 | 90 | ||
91 | for(off=0; off<len; off++) |
91 | for(off=0; off<len; off++) |
92 | { |
92 | { |
93 | crc += eeprom_read_byte((uint8_t*)(EEAddr + off));; |
93 | crc += eeprom_read_byte((uint8_t*)(EEAddr + off));; |
94 | } |
94 | } |
95 | return crc; |
95 | return crc; |
96 | } |
96 | } |
97 | 97 | ||
98 | void ParamSet_DefaultStickMapping(void) |
98 | void ParamSet_DefaultStickMapping(void) |
99 | { |
99 | { |
100 | EE_Parameter.Kanalbelegung[K_GAS] = 1; |
100 | EE_Parameter.Kanalbelegung[K_GAS] = 1; |
101 | EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
101 | EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
102 | EE_Parameter.Kanalbelegung[K_NICK] = 3; |
102 | EE_Parameter.Kanalbelegung[K_NICK] = 3; |
103 | EE_Parameter.Kanalbelegung[K_GIER] = 4; |
103 | EE_Parameter.Kanalbelegung[K_GIER] = 4; |
104 | EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
104 | EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
105 | EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
105 | EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
106 | EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
106 | EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
107 | EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
107 | EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
108 | EE_Parameter.Kanalbelegung[K_POTI5] = 9; |
108 | EE_Parameter.Kanalbelegung[K_POTI5] = 9; |
109 | EE_Parameter.Kanalbelegung[K_POTI6] = 10; |
109 | EE_Parameter.Kanalbelegung[K_POTI6] = 10; |
110 | EE_Parameter.Kanalbelegung[K_POTI7] = 11; |
110 | EE_Parameter.Kanalbelegung[K_POTI7] = 11; |
111 | EE_Parameter.Kanalbelegung[K_POTI8] = 12; |
111 | EE_Parameter.Kanalbelegung[K_POTI8] = 12; |
112 | } |
112 | } |
113 | 113 | ||
114 | 114 | ||
115 | /***************************************************/ |
115 | /***************************************************/ |
116 | /* Default Values for parameter set 1 */ |
116 | /* Default Values for parameter set 1 */ |
117 | /***************************************************/ |
117 | /***************************************************/ |
118 | void CommonDefaults(void) |
118 | void CommonDefaults(void) |
119 | { |
119 | { |
120 | EE_Parameter.Revision = EEPARAM_REVISION; |
120 | EE_Parameter.Revision = EEPARAM_REVISION; |
121 | 121 | ||
122 | if(PlatinenVersion >= 20) |
122 | if(PlatinenVersion >= 20) |
123 | { |
123 | { |
124 | EE_Parameter.Gyro_D = 10; |
124 | EE_Parameter.Gyro_D = 10; |
125 | EE_Parameter.Driftkomp = 0; |
125 | EE_Parameter.Driftkomp = 0; |
126 | EE_Parameter.GyroAccFaktor = 27; |
126 | EE_Parameter.GyroAccFaktor = 27; |
127 | EE_Parameter.WinkelUmschlagNick = 78; |
127 | EE_Parameter.WinkelUmschlagNick = 78; |
128 | EE_Parameter.WinkelUmschlagRoll = 78; |
128 | EE_Parameter.WinkelUmschlagRoll = 78; |
129 | } |
129 | } |
130 | else |
130 | else |
131 | { |
131 | { |
132 | EE_Parameter.Gyro_D = 3; |
132 | EE_Parameter.Gyro_D = 3; |
133 | EE_Parameter.Driftkomp = 32; |
133 | EE_Parameter.Driftkomp = 32; |
134 | EE_Parameter.GyroAccFaktor = 30; |
134 | EE_Parameter.GyroAccFaktor = 30; |
135 | EE_Parameter.WinkelUmschlagNick = 85; |
135 | EE_Parameter.WinkelUmschlagNick = 85; |
136 | EE_Parameter.WinkelUmschlagRoll = 85; |
136 | EE_Parameter.WinkelUmschlagRoll = 85; |
137 | } |
137 | } |
138 | EE_Parameter.GyroAccAbgleich = 32; // 1/k |
138 | EE_Parameter.GyroAccAbgleich = 32; // 1/k |
139 | EE_Parameter.BitConfig = 0; // Looping usw. |
139 | EE_Parameter.BitConfig = 0; // Looping usw. |
140 | EE_Parameter.GlobalConfig = CFG_ACHSENKOPPLUNG_AKTIV | CFG_KOMPASS_AKTIV | CFG_GPS_AKTIV | CFG_HOEHEN_SCHALTER; |
140 | EE_Parameter.GlobalConfig = CFG_ACHSENKOPPLUNG_AKTIV | CFG_KOMPASS_AKTIV | CFG_GPS_AKTIV | CFG_HOEHEN_SCHALTER; |
141 | EE_Parameter.ExtraConfig = CFG_GPS_AID | CFG2_VARIO_BEEP; |
141 | EE_Parameter.ExtraConfig = CFG_GPS_AID | CFG2_VARIO_BEEP; |
142 | EE_Parameter.GlobalConfig3 = 0;//CFG3_VARIO_FAILSAFE; |
142 | EE_Parameter.GlobalConfig3 = 0;//CFG3_VARIO_FAILSAFE; |
143 | EE_Parameter.Receiver = RECEIVER_JETI; |
143 | EE_Parameter.Receiver = RECEIVER_JETI; |
144 | EE_Parameter.MotorSafetySwitch = 0; |
144 | EE_Parameter.MotorSafetySwitch = 0; |
145 | EE_Parameter.ExternalControl = 0; |
145 | EE_Parameter.ExternalControl = 0; |
146 | 146 | ||
147 | EE_Parameter.Gas_Min = 8; // Wert : 0-32 |
147 | EE_Parameter.Gas_Min = 8; // Wert : 0-32 |
148 | EE_Parameter.Gas_Max = 230; // Wert : 33-247 |
148 | EE_Parameter.Gas_Max = 230; // Wert : 33-247 |
149 | EE_Parameter.KompassWirkung = 64; // Wert : 0-247 |
149 | EE_Parameter.KompassWirkung = 64; // Wert : 0-247 |
150 | 150 | ||
151 | EE_Parameter.Hoehe_MinGas = 30; |
151 | EE_Parameter.Hoehe_MinGas = 30; |
152 | EE_Parameter.MaxHoehe = 255; // Wert : 0-247 255 -> Poti1 |
152 | EE_Parameter.MaxHoehe = 255; // Wert : 0-247 255 -> Poti1 |
153 | EE_Parameter.Hoehe_P = 15; // Wert : 0-32 |
153 | EE_Parameter.Hoehe_P = 15; // Wert : 0-32 |
154 | EE_Parameter.Luftdruck_D = 30; // Wert : 0-247 |
154 | EE_Parameter.Luftdruck_D = 30; // Wert : 0-247 |
155 | EE_Parameter.Hoehe_ACC_Wirkung = 0; // Wert : 0-247 |
155 | EE_Parameter.Hoehe_ACC_Wirkung = 0; // Wert : 0-247 |
156 | EE_Parameter.Hoehe_HoverBand = 8; // Wert : 0-247 |
156 | EE_Parameter.Hoehe_HoverBand = 8; // Wert : 0-247 |
157 | EE_Parameter.Hoehe_GPS_Z = 20; // Wert : 0-247 |
157 | EE_Parameter.Hoehe_GPS_Z = 20; // Wert : 0-247 |
158 | EE_Parameter.Hoehe_StickNeutralPoint = 0;// Wert : 0-247 (0 = Hover-Estimation) |
158 | EE_Parameter.Hoehe_StickNeutralPoint = 0;// Wert : 0-247 (0 = Hover-Estimation) |
159 | EE_Parameter.Hoehe_Verstaerkung = 15; // Wert : 0-50 (15 -> ca. +/- 5m/sek bei Stick-Voll-Ausschlag) |
159 | EE_Parameter.Hoehe_Verstaerkung = 15; // Wert : 0-50 (15 -> ca. +/- 5m/sek bei Stick-Voll-Ausschlag) |
160 | 160 | ||
161 | EE_Parameter.UserParam1 = 0; // zur freien Verwendung |
161 | EE_Parameter.UserParam1 = 0; // zur freien Verwendung |
162 | EE_Parameter.UserParam2 = 0; // zur freien Verwendung |
162 | EE_Parameter.UserParam2 = 0; // zur freien Verwendung |
163 | EE_Parameter.UserParam3 = 0; // zur freien Verwendung |
163 | EE_Parameter.UserParam3 = 0; // zur freien Verwendung |
164 | EE_Parameter.UserParam4 = 0; // zur freien Verwendung |
164 | EE_Parameter.UserParam4 = 0; // zur freien Verwendung |
165 | EE_Parameter.UserParam5 = 0; // zur freien Verwendung |
165 | EE_Parameter.UserParam5 = 0; // zur freien Verwendung |
166 | EE_Parameter.UserParam6 = 0; // zur freien Verwendung |
166 | EE_Parameter.UserParam6 = 0; // zur freien Verwendung |
167 | EE_Parameter.UserParam7 = 0; // zur freien Verwendung |
167 | EE_Parameter.UserParam7 = 0; // zur freien Verwendung |
168 | EE_Parameter.UserParam8 = 0; // zur freien Verwendung |
168 | EE_Parameter.UserParam8 = 0; // zur freien Verwendung |
169 | 169 | ||
170 | EE_Parameter.ServoNickControl = 128; // Wert : 0-247 // Stellung des Servos |
170 | EE_Parameter.ServoNickControl = 128; // Wert : 0-247 // Stellung des Servos |
171 | EE_Parameter.ServoNickComp = 50; // Wert : 0-247 // Einfluss Gyro/Servo |
171 | EE_Parameter.ServoNickComp = 50; // Wert : 0-247 // Einfluss Gyro/Servo |
172 | EE_Parameter.ServoCompInvert = 2; // Wert : 0-247 // Richtung Einfluss Gyro/Servo |
172 | EE_Parameter.ServoCompInvert = 2; // Wert : 0-247 // Richtung Einfluss Gyro/Servo |
173 | EE_Parameter.ServoNickMin = 15; // Wert : 0-247 // Anschlag |
173 | EE_Parameter.ServoNickMin = 15; // Wert : 0-247 // Anschlag |
174 | EE_Parameter.ServoNickMax = 230; // Wert : 0-247 // Anschlag |
174 | EE_Parameter.ServoNickMax = 230; // Wert : 0-247 // Anschlag |
175 | EE_Parameter.ServoNickRefresh = 4; |
175 | EE_Parameter.ServoNickRefresh = 4; |
176 | EE_Parameter.Servo3 = 125; |
176 | EE_Parameter.Servo3 = 125; |
177 | EE_Parameter.Servo4 = 125; |
177 | EE_Parameter.Servo4 = 125; |
178 | EE_Parameter.Servo5 = 125; |
178 | EE_Parameter.Servo5 = 125; |
179 | EE_Parameter.ServoRollControl = 128; // Wert : 0-247 // Stellung des Servos |
179 | EE_Parameter.ServoRollControl = 128; // Wert : 0-247 // Stellung des Servos |
180 | EE_Parameter.ServoRollComp = 85; // Wert : 0-247 // Einfluss Gyro/Servo |
180 | EE_Parameter.ServoRollComp = 85; // Wert : 0-247 // Einfluss Gyro/Servo |
181 | EE_Parameter.ServoRollMin = 70; // Wert : 0-247 // Anschlag |
181 | EE_Parameter.ServoRollMin = 70; // Wert : 0-247 // Anschlag |
182 | EE_Parameter.ServoRollMax = 220; // Wert : 0-247 // Anschlag |
182 | EE_Parameter.ServoRollMax = 220; // Wert : 0-247 // Anschlag |
183 | EE_Parameter.ServoManualControlSpeed = 60; |
183 | EE_Parameter.ServoManualControlSpeed = 60; |
184 | EE_Parameter.CamOrientation = 0; // Wert : 0-24 -> 0-360 -> 15° steps |
184 | EE_Parameter.CamOrientation = 0; // Wert : 0-24 -> 0-360 -> 15° steps |
185 | 185 | ||
186 | EE_Parameter.J16Bitmask = 95; |
186 | EE_Parameter.J16Bitmask = 95; |
187 | EE_Parameter.J17Bitmask = 243; |
187 | EE_Parameter.J17Bitmask = 243; |
188 | EE_Parameter.WARN_J16_Bitmask = 0xAA; |
188 | EE_Parameter.WARN_J16_Bitmask = 0xAA; |
189 | EE_Parameter.WARN_J17_Bitmask = 0xAA; |
189 | EE_Parameter.WARN_J17_Bitmask = 0xAA; |
190 | EE_Parameter.J16Timing = 40; |
190 | EE_Parameter.J16Timing = 40; |
191 | EE_Parameter.J17Timing = 40; |
191 | EE_Parameter.J17Timing = 40; |
192 | 192 | ||
193 | EE_Parameter.LoopGasLimit = 50; |
193 | EE_Parameter.LoopGasLimit = 50; |
194 | EE_Parameter.LoopThreshold = 90; // Wert: 0-247 Schwelle für Stickausschlag |
194 | EE_Parameter.LoopThreshold = 90; // Wert: 0-247 Schwelle für Stickausschlag |
195 | EE_Parameter.LoopHysterese = 50; |
195 | EE_Parameter.LoopHysterese = 50; |
196 | 196 | ||
197 | EE_Parameter.NaviGpsModeControl = 254; // 254 -> Poti 2 |
197 | EE_Parameter.NaviGpsModeControl = 254; // 254 -> Poti 2 |
198 | EE_Parameter.NaviGpsGain = 100; |
198 | EE_Parameter.NaviGpsGain = 100; |
199 | EE_Parameter.NaviGpsP = 90; |
199 | EE_Parameter.NaviGpsP = 90; |
200 | EE_Parameter.NaviGpsI = 90; |
200 | EE_Parameter.NaviGpsI = 90; |
201 | EE_Parameter.NaviGpsD = 90; |
201 | EE_Parameter.NaviGpsD = 90; |
202 | EE_Parameter.NaviGpsPLimit = 75; |
202 | EE_Parameter.NaviGpsPLimit = 75; |
203 | EE_Parameter.NaviGpsILimit = 85; |
203 | EE_Parameter.NaviGpsILimit = 85; |
204 | EE_Parameter.NaviGpsDLimit = 75; |
204 | EE_Parameter.NaviGpsDLimit = 75; |
205 | EE_Parameter.NaviGpsACC = 0; |
205 | EE_Parameter.NaviGpsACC = 0; |
206 | EE_Parameter.NaviGpsMinSat = 6; |
206 | EE_Parameter.NaviGpsMinSat = 6; |
207 | EE_Parameter.NaviStickThreshold = 8; |
207 | EE_Parameter.NaviStickThreshold = 8; |
208 | EE_Parameter.NaviWindCorrection = 90; |
208 | EE_Parameter.NaviWindCorrection = 90; |
209 | EE_Parameter.NaviAccCompensation = 42; |
209 | EE_Parameter.NaviAccCompensation = 42; |
210 | EE_Parameter.NaviOperatingRadius = 245; |
210 | EE_Parameter.NaviOperatingRadius = 245; |
211 | EE_Parameter.NaviAngleLimitation = 140; |
211 | EE_Parameter.NaviAngleLimitation = 140; |
212 | EE_Parameter.NaviPH_LoginTime = 5; |
212 | EE_Parameter.NaviPH_LoginTime = 5; |
213 | EE_Parameter.OrientationAngle = 0; |
213 | EE_Parameter.OrientationAngle = 0; |
214 | EE_Parameter.CareFreeModeControl = 0; |
214 | EE_Parameter.CareFreeModeControl = 0; |
215 | EE_Parameter.UnterspannungsWarnung = 33; // Wert : 0-247 ( Automatische Zellenerkennung bei < 50) |
215 | EE_Parameter.UnterspannungsWarnung = 33; // Wert : 0-247 ( Automatische Zellenerkennung bei < 50) |
216 | EE_Parameter.NotGas = 65; // Wert : 0-247 // Gaswert bei Empangsverlust (ggf. in Prozent) |
216 | EE_Parameter.NotGas = 65; // Wert : 0-247 // Gaswert bei Empangsverlust (ggf. in Prozent) |
217 | EE_Parameter.NotGasZeit = 90; // Wert : 0-247 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
217 | EE_Parameter.NotGasZeit = 90; // Wert : 0-247 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
218 | EE_Parameter.MotorSmooth = 0; |
218 | EE_Parameter.MotorSmooth = 0; |
219 | EE_Parameter.ComingHomeAltitude = 0; // 0 = don't change |
219 | EE_Parameter.ComingHomeAltitude = 0; // 0 = don't change |
220 | EE_Parameter.FailSafeTime = 0; // 0 = off |
220 | EE_Parameter.FailSafeTime = 0; // 0 = off |
221 | EE_Parameter.MaxAltitude = 150; // 0 = off |
221 | EE_Parameter.MaxAltitude = 150; // 0 = off |
222 | EE_Parameter.AchsKopplung1 = 90; |
222 | EE_Parameter.AchsKopplung1 = 90; |
223 | EE_Parameter.AchsKopplung2 = 55; |
223 | EE_Parameter.AchsKopplung2 = 55; |
224 | EE_Parameter.FailsafeChannel = 0; |
224 | EE_Parameter.FailsafeChannel = 0; |
225 | EE_Parameter.ServoFilterNick = 0; |
225 | EE_Parameter.ServoFilterNick = 0; |
226 | EE_Parameter.ServoFilterRoll = 0; |
226 | EE_Parameter.ServoFilterRoll = 0; |
227 | } |
227 | } |
228 | /* |
228 | /* |
229 | void ParamSet_DefaultSet1(void) // sport |
229 | void ParamSet_DefaultSet1(void) // sport |
230 | { |
230 | { |
231 | CommonDefaults(); |
231 | CommonDefaults(); |
232 | EE_Parameter.Stick_P = 14; // Wert : 1-20 |
232 | EE_Parameter.Stick_P = 14; // Wert : 1-20 |
233 | EE_Parameter.Stick_D = 16; // Wert : 0-20 |
233 | EE_Parameter.Stick_D = 16; // Wert : 0-20 |
234 | EE_Parameter.StickGier_P = 12; // Wert : 1-20 |
234 | EE_Parameter.StickGier_P = 12; // Wert : 1-20 |
235 | EE_Parameter.Gyro_P = 80; // Wert : 0-247 |
235 | EE_Parameter.Gyro_P = 80; // Wert : 0-247 |
236 | EE_Parameter.Gyro_I = 150; // Wert : 0-247 |
236 | EE_Parameter.Gyro_I = 150; // Wert : 0-247 |
237 | EE_Parameter.Gyro_Gier_P = 80; // Wert : 0-247 |
237 | EE_Parameter.Gyro_Gier_P = 80; // Wert : 0-247 |
238 | EE_Parameter.Gyro_Gier_I = 150; // Wert : 0-247 |
238 | EE_Parameter.Gyro_Gier_I = 150; // Wert : 0-247 |
239 | EE_Parameter.Gyro_Stability = 6; // Wert : 1-8 |
239 | EE_Parameter.Gyro_Stability = 6; // Wert : 1-8 |
240 | EE_Parameter.I_Faktor = 32; |
240 | EE_Parameter.I_Faktor = 32; |
241 | EE_Parameter.CouplingYawCorrection = 1; |
241 | EE_Parameter.CouplingYawCorrection = 1; |
242 | EE_Parameter.GyroAccAbgleich = 16; // 1/k; |
242 | EE_Parameter.GyroAccAbgleich = 16; // 1/k; |
243 | EE_Parameter.DynamicStability = 100; |
243 | EE_Parameter.DynamicStability = 100; |
244 | memcpy(EE_Parameter.Name, "Sport\0", 12); |
244 | memcpy(EE_Parameter.Name, "Sport\0", 12); |
245 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
245 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
246 | } |
246 | } |
247 | */ |
247 | */ |
248 | 248 | ||
249 | /***************************************************/ |
249 | /***************************************************/ |
250 | /* Default Values for parameter set 1 */ |
250 | /* Default Values for parameter set 1 */ |
251 | /***************************************************/ |
251 | /***************************************************/ |
252 | void ParamSet_DefaultSet1(void) // normal |
252 | void ParamSet_DefaultSet1(void) // normal |
253 | { |
253 | { |
254 | CommonDefaults(); |
254 | CommonDefaults(); |
255 | EE_Parameter.Stick_P = 10; // Wert : 1-20 |
255 | EE_Parameter.Stick_P = 10; // Wert : 1-20 |
256 | EE_Parameter.Stick_D = 16; // Wert : 0-20 |
256 | EE_Parameter.Stick_D = 16; // Wert : 0-20 |
257 | EE_Parameter.StickGier_P = 6; // Wert : 1-20 |
257 | EE_Parameter.StickGier_P = 6; // Wert : 1-20 |
258 | EE_Parameter.Gyro_P = 90; // Wert : 0-247 |
258 | EE_Parameter.Gyro_P = 90; // Wert : 0-247 |
259 | EE_Parameter.Gyro_I = 120; // Wert : 0-247 |
259 | EE_Parameter.Gyro_I = 120; // Wert : 0-247 |
260 | EE_Parameter.Gyro_Gier_P = 90; // Wert : 0-247 |
260 | EE_Parameter.Gyro_Gier_P = 90; // Wert : 0-247 |
261 | EE_Parameter.Gyro_Gier_I = 120; // Wert : 0-247 |
261 | EE_Parameter.Gyro_Gier_I = 120; // Wert : 0-247 |
262 | EE_Parameter.Gyro_Stability = 6; // Wert : 1-8 |
262 | EE_Parameter.Gyro_Stability = 6; // Wert : 1-8 |
263 | EE_Parameter.I_Faktor = 32; |
263 | EE_Parameter.I_Faktor = 32; |
264 | EE_Parameter.CouplingYawCorrection = 60; |
264 | EE_Parameter.CouplingYawCorrection = 60; |
265 | EE_Parameter.DynamicStability = 75; |
265 | EE_Parameter.DynamicStability = 75; |
266 | memcpy(EE_Parameter.Name, "Fast\0", 12); |
266 | memcpy(EE_Parameter.Name, "Fast\0", 12); |
267 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
267 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
268 | } |
268 | } |
269 | 269 | ||
270 | 270 | ||
271 | /***************************************************/ |
271 | /***************************************************/ |
272 | /* Default Values for parameter set 2 */ |
272 | /* Default Values for parameter set 2 */ |
273 | /***************************************************/ |
273 | /***************************************************/ |
274 | void ParamSet_DefaultSet2(void) // beginner |
274 | void ParamSet_DefaultSet2(void) // beginner |
275 | { |
275 | { |
276 | CommonDefaults(); |
276 | CommonDefaults(); |
277 | EE_Parameter.Stick_P = 8; // Wert : 1-20 |
277 | EE_Parameter.Stick_P = 8; // Wert : 1-20 |
278 | EE_Parameter.Stick_D = 16; // Wert : 0-20 |
278 | EE_Parameter.Stick_D = 16; // Wert : 0-20 |
279 | EE_Parameter.StickGier_P = 6; // Wert : 1-20 |
279 | EE_Parameter.StickGier_P = 6; // Wert : 1-20 |
280 | EE_Parameter.Gyro_P = 100; // Wert : 0-247 |
280 | EE_Parameter.Gyro_P = 100; // Wert : 0-247 |
281 | EE_Parameter.Gyro_I = 120; // Wert : 0-247 |
281 | EE_Parameter.Gyro_I = 120; // Wert : 0-247 |
282 | EE_Parameter.Gyro_Gier_P = 100; // Wert : 0-247 |
282 | EE_Parameter.Gyro_Gier_P = 100; // Wert : 0-247 |
283 | EE_Parameter.Gyro_Gier_I = 120; // Wert : 0-247 |
283 | EE_Parameter.Gyro_Gier_I = 120; // Wert : 0-247 |
284 | EE_Parameter.Gyro_Stability = 6; // Wert : 1-8 |
284 | EE_Parameter.Gyro_Stability = 6; // Wert : 1-8 |
285 | EE_Parameter.I_Faktor = 16; |
285 | EE_Parameter.I_Faktor = 16; |
286 | EE_Parameter.CouplingYawCorrection = 70; |
286 | EE_Parameter.CouplingYawCorrection = 70; |
287 | EE_Parameter.DynamicStability = 70; |
287 | EE_Parameter.DynamicStability = 70; |
288 | memcpy(EE_Parameter.Name, "Normal\0", 12); |
288 | memcpy(EE_Parameter.Name, "Normal\0", 12); |
289 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
289 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
290 | } |
290 | } |
291 | 291 | ||
292 | /***************************************************/ |
292 | /***************************************************/ |
293 | /* Default Values for parameter set 3 */ |
293 | /* Default Values for parameter set 3 */ |
294 | /***************************************************/ |
294 | /***************************************************/ |
295 | void ParamSet_DefaultSet3(void) // beginner |
295 | void ParamSet_DefaultSet3(void) // beginner |
296 | { |
296 | { |
297 | CommonDefaults(); |
297 | CommonDefaults(); |
298 | EE_Parameter.Stick_P = 6; // Wert : 1-20 |
298 | EE_Parameter.Stick_P = 6; // Wert : 1-20 |
299 | EE_Parameter.Stick_D = 10; // Wert : 0-20 |
299 | EE_Parameter.Stick_D = 10; // Wert : 0-20 |
300 | EE_Parameter.StickGier_P = 4; // Wert : 1-20 |
300 | EE_Parameter.StickGier_P = 4; // Wert : 1-20 |
301 | EE_Parameter.Gyro_P = 100; // Wert : 0-247 |
301 | EE_Parameter.Gyro_P = 100; // Wert : 0-247 |
302 | EE_Parameter.Gyro_I = 120; // Wert : 0-247 |
302 | EE_Parameter.Gyro_I = 120; // Wert : 0-247 |
303 | EE_Parameter.Gyro_Gier_P = 100; // Wert : 0-247 |
303 | EE_Parameter.Gyro_Gier_P = 100; // Wert : 0-247 |
304 | EE_Parameter.Gyro_Gier_I = 120; // Wert : 0-247 |
304 | EE_Parameter.Gyro_Gier_I = 120; // Wert : 0-247 |
305 | EE_Parameter.Gyro_Stability = 6; // Wert : 1-8 |
305 | EE_Parameter.Gyro_Stability = 6; // Wert : 1-8 |
306 | EE_Parameter.I_Faktor = 16; |
306 | EE_Parameter.I_Faktor = 16; |
307 | EE_Parameter.CouplingYawCorrection = 70; |
307 | EE_Parameter.CouplingYawCorrection = 70; |
308 | EE_Parameter.DynamicStability = 70; |
308 | EE_Parameter.DynamicStability = 70; |
309 | memcpy(EE_Parameter.Name, "Easy\0", 12); |
309 | memcpy(EE_Parameter.Name, "Easy\0", 12); |
310 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
310 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
311 | } |
311 | } |
312 | 312 | ||
313 | 313 | ||
314 | /***************************************************/ |
314 | /***************************************************/ |
315 | /* Read Parameter from EEPROM as byte */ |
315 | /* Read Parameter from EEPROM as byte */ |
316 | /***************************************************/ |
316 | /***************************************************/ |
317 | uint8_t GetParamByte(uint16_t param_id) |
317 | uint8_t GetParamByte(uint16_t param_id) |
318 | { |
318 | { |
319 | return eeprom_read_byte((uint8_t*)(EEPROM_ADR_PARAM_BEGIN + param_id)); |
319 | return eeprom_read_byte((uint8_t*)(EEPROM_ADR_PARAM_BEGIN + param_id)); |
320 | } |
320 | } |
321 | 321 | ||
322 | /***************************************************/ |
322 | /***************************************************/ |
323 | /* Write Parameter to EEPROM as byte */ |
323 | /* Write Parameter to EEPROM as byte */ |
324 | /***************************************************/ |
324 | /***************************************************/ |
325 | void SetParamByte(uint16_t param_id, uint8_t value) |
325 | void SetParamByte(uint16_t param_id, uint8_t value) |
326 | { |
326 | { |
327 | eeprom_write_byte((uint8_t*)(EEPROM_ADR_PARAM_BEGIN + param_id), value); |
327 | eeprom_write_byte((uint8_t*)(EEPROM_ADR_PARAM_BEGIN + param_id), value); |
328 | } |
328 | } |
329 | 329 | ||
330 | /***************************************************/ |
330 | /***************************************************/ |
331 | /* Read Parameter from EEPROM as word */ |
331 | /* Read Parameter from EEPROM as word */ |
332 | /***************************************************/ |
332 | /***************************************************/ |
333 | uint16_t GetParamWord(uint16_t param_id) |
333 | uint16_t GetParamWord(uint16_t param_id) |
334 | { |
334 | { |
335 | return eeprom_read_word((uint16_t *)(EEPROM_ADR_PARAM_BEGIN + param_id)); |
335 | return eeprom_read_word((uint16_t *)(EEPROM_ADR_PARAM_BEGIN + param_id)); |
336 | } |
336 | } |
337 | 337 | ||
338 | /***************************************************/ |
338 | /***************************************************/ |
339 | /* Write Parameter to EEPROM as word */ |
339 | /* Write Parameter to EEPROM as word */ |
340 | /***************************************************/ |
340 | /***************************************************/ |
341 | void SetParamWord(uint16_t param_id, uint16_t value) |
341 | void SetParamWord(uint16_t param_id, uint16_t value) |
342 | { |
342 | { |
343 | eeprom_write_word((uint16_t*)(EEPROM_ADR_PARAM_BEGIN + param_id), value); |
343 | eeprom_write_word((uint16_t*)(EEPROM_ADR_PARAM_BEGIN + param_id), value); |
344 | } |
344 | } |
345 | 345 | ||
346 | /***************************************************/ |
346 | /***************************************************/ |
347 | /* Read Parameter Set from EEPROM */ |
347 | /* Read Parameter Set from EEPROM */ |
348 | /***************************************************/ |
348 | /***************************************************/ |
349 | // number [1..5] |
349 | // number [1..5] |
350 | uint8_t ParamSet_ReadFromEEProm(uint8_t setnumber) |
350 | uint8_t ParamSet_ReadFromEEProm(uint8_t setnumber) |
351 | { |
351 | { |
352 | uint8_t crc; |
352 | uint8_t crc; |
353 | uint16_t eeaddr; |
353 | uint16_t eeaddr; |
354 | 354 | ||
355 | // range the setnumber |
355 | // range the setnumber |
356 | if((1 > setnumber) || (setnumber > 5)) setnumber = 3; |
356 | if((1 > setnumber) || (setnumber > 5)) setnumber = 3; |
357 | 357 | ||
358 | // calculate eeprom addr |
358 | // calculate eeprom addr |
359 | eeaddr = EEPROM_ADR_PARAMSET + PARAMSET_STRUCT_LEN * (setnumber - 1); |
359 | eeaddr = EEPROM_ADR_PARAMSET + PARAMSET_STRUCT_LEN * (setnumber - 1); |
360 | 360 | ||
361 | // calculate checksum from eeprom |
361 | // calculate checksum from eeprom |
362 | crc = EEProm_Checksum(eeaddr, PARAMSET_STRUCT_LEN - 1); |
362 | crc = EEProm_Checksum(eeaddr, PARAMSET_STRUCT_LEN - 1); |
363 | 363 | ||
364 | // check crc |
364 | // check crc |
365 | if(crc != eeprom_read_byte((uint8_t*)(eeaddr + PARAMSET_STRUCT_LEN - 1))) return 0; |
365 | if(crc != eeprom_read_byte((uint8_t*)(eeaddr + PARAMSET_STRUCT_LEN - 1))) return 0; |
366 | 366 | ||
367 | // check revision |
367 | // check revision |
368 | if(eeprom_read_byte((uint8_t*)(eeaddr)) != EEPARAM_REVISION) return 0; |
368 | if(eeprom_read_byte((uint8_t*)(eeaddr)) != EEPARAM_REVISION) return 0; |
369 | 369 | ||
370 | // read paramset from eeprom |
370 | // read paramset from eeprom |
371 | eeprom_read_block((void *) &EE_Parameter, (void*)(EEPROM_ADR_PARAMSET + PARAMSET_STRUCT_LEN * (setnumber - 1)), PARAMSET_STRUCT_LEN); |
371 | eeprom_read_block((void *) &EE_Parameter, (void*)(EEPROM_ADR_PARAMSET + PARAMSET_STRUCT_LEN * (setnumber - 1)), PARAMSET_STRUCT_LEN); |
372 | LED_Init(); |
372 | LED_Init(); |
373 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
373 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
374 | LIBFC_HoTT_Clear(); |
374 | LIBFC_HoTT_Clear(); |
375 | #endif |
375 | #endif |
376 | return 1; |
376 | return 1; |
377 | } |
377 | } |
378 | 378 | ||
379 | /***************************************************/ |
379 | /***************************************************/ |
380 | /* Write Parameter Set to EEPROM */ |
380 | /* Write Parameter Set to EEPROM */ |
381 | /***************************************************/ |
381 | /***************************************************/ |
382 | // number [1..5] |
382 | // number [1..5] |
383 | uint8_t ParamSet_WriteToEEProm(uint8_t setnumber) |
383 | uint8_t ParamSet_WriteToEEProm(uint8_t setnumber) |
384 | { |
384 | { |
385 | uint8_t crc; |
385 | uint8_t crc; |
386 | 386 | ||
387 | if(EE_Parameter.Revision == EEPARAM_REVISION) // write only the right revision to eeprom |
387 | if(EE_Parameter.Revision == EEPARAM_REVISION) // write only the right revision to eeprom |
388 | { |
388 | { |
389 | if(setnumber > 5) setnumber = 5; |
389 | if(setnumber > 5) setnumber = 5; |
390 | if(setnumber < 1) return 0; |
390 | if(setnumber < 1) return 0; |
391 | LIBFC_CheckSettings(); |
391 | LIBFC_CheckSettings(); |
392 | if(EE_Parameter.GlobalConfig3 & CFG3_VARIO_FAILSAFE) // check the Setting: Not more than 100% emergency gas |
392 | if(EE_Parameter.GlobalConfig3 & CFG3_VARIO_FAILSAFE) // check the Setting: Not more than 100% emergency gas |
393 | { |
393 | { |
394 | if(EE_Parameter.NotGas > 99) EE_Parameter.NotGas = 80; // i.e. 80% of Hovergas |
394 | if(EE_Parameter.NotGas > 99) EE_Parameter.NotGas = 80; // i.e. 80% of Hovergas |
395 | } |
395 | } |
396 | // update checksum |
396 | // update checksum |
397 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
397 | EE_Parameter.crc = RAM_Checksum((uint8_t*)(&EE_Parameter), sizeof(EE_Parameter)-1); |
398 | 398 | ||
399 | // write paramset to eeprom |
399 | // write paramset to eeprom |
400 | eeprom_write_block((void *) &EE_Parameter, (void*)(EEPROM_ADR_PARAMSET + PARAMSET_STRUCT_LEN * (setnumber - 1)), PARAMSET_STRUCT_LEN); |
400 | eeprom_write_block((void *) &EE_Parameter, (void*)(EEPROM_ADR_PARAMSET + PARAMSET_STRUCT_LEN * (setnumber - 1)), PARAMSET_STRUCT_LEN); |
401 | 401 | ||
402 | // backup channel settings to separate block in eeprom |
402 | // backup channel settings to separate block in eeprom |
403 | eeprom_write_block( (void*)(EE_Parameter.Kanalbelegung), (void*)(EEPROM_ADR_CHANNELS), sizeof(EE_Parameter.Kanalbelegung)); |
403 | eeprom_write_block( (void*)(EE_Parameter.Kanalbelegung), (void*)(EEPROM_ADR_CHANNELS), sizeof(EE_Parameter.Kanalbelegung)); |
404 | 404 | ||
405 | // write crc of channel block to eeprom |
405 | // write crc of channel block to eeprom |
406 | crc = RAM_Checksum((uint8_t*)(EE_Parameter.Kanalbelegung), sizeof(EE_Parameter.Kanalbelegung)); |
406 | crc = RAM_Checksum((uint8_t*)(EE_Parameter.Kanalbelegung), sizeof(EE_Parameter.Kanalbelegung)); |
407 | eeprom_write_byte((uint8_t*)(EEPROM_ADR_CHANNELS + sizeof(EE_Parameter.Kanalbelegung)), crc); |
407 | eeprom_write_byte((uint8_t*)(EEPROM_ADR_CHANNELS + sizeof(EE_Parameter.Kanalbelegung)), crc); |
408 | 408 | ||
409 | // update active settings number |
409 | // update active settings number |
410 | SetActiveParamSet(setnumber); |
410 | SetActiveParamSet(setnumber); |
411 | LED_Init(); |
411 | LED_Init(); |
412 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
412 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
413 | LIBFC_HoTT_Clear(); |
413 | LIBFC_HoTT_Clear(); |
414 | #endif |
414 | #endif |
415 | return 1; |
415 | return 1; |
416 | } |
416 | } |
417 | // wrong revision |
417 | // wrong revision |
418 | return 0; |
418 | return 0; |
419 | } |
419 | } |
420 | 420 | ||
421 | /***************************************************/ |
421 | /***************************************************/ |
422 | /* Read MixerTable from EEPROM */ |
422 | /* Read MixerTable from EEPROM */ |
423 | /***************************************************/ |
423 | /***************************************************/ |
424 | uint8_t MixerTable_ReadFromEEProm(void) |
424 | uint8_t MixerTable_ReadFromEEProm(void) |
425 | { |
425 | { |
426 | uint8_t crc; |
426 | uint8_t crc; |
427 | 427 | ||
428 | // calculate checksum in eeprom |
428 | // calculate checksum in eeprom |
429 | crc = EEProm_Checksum(EEPROM_ADR_MIXERTABLE, sizeof(Mixer) - 1); |
429 | crc = EEProm_Checksum(EEPROM_ADR_MIXERTABLE, sizeof(Mixer) - 1); |
430 | 430 | ||
431 | // check crc |
431 | // check crc |
432 | if( crc != eeprom_read_byte((uint8_t*)(EEPROM_ADR_MIXERTABLE + sizeof(Mixer) - 1)) ) return 0; |
432 | if( crc != eeprom_read_byte((uint8_t*)(EEPROM_ADR_MIXERTABLE + sizeof(Mixer) - 1)) ) return 0; |
433 | 433 | ||
434 | // check revision |
434 | // check revision |
435 | if(eeprom_read_byte((uint8_t*)(EEPROM_ADR_MIXERTABLE)) != EEMIXER_REVISION) return 0; |
435 | if(eeprom_read_byte((uint8_t*)(EEPROM_ADR_MIXERTABLE)) != EEMIXER_REVISION) return 0; |
436 | 436 | ||
437 | // read mixer table |
437 | // read mixer table |
438 | eeprom_read_block((void *) &Mixer, (void*)(EEPROM_ADR_MIXERTABLE), sizeof(Mixer)); |
438 | eeprom_read_block((void *) &Mixer, (void*)(EEPROM_ADR_MIXERTABLE), sizeof(Mixer)); |
439 | return 1; |
439 | return 1; |
440 | } |
440 | } |
441 | 441 | ||
442 | /***************************************************/ |
442 | /***************************************************/ |
443 | /* Write Mixer Table to EEPROM */ |
443 | /* Write Mixer Table to EEPROM */ |
444 | /***************************************************/ |
444 | /***************************************************/ |
445 | uint8_t MixerTable_WriteToEEProm(void) |
445 | uint8_t MixerTable_WriteToEEProm(void) |
446 | { |
446 | { |
447 | if(Mixer.Revision == EEMIXER_REVISION) |
447 | if(Mixer.Revision == EEMIXER_REVISION) |
448 | { |
448 | { |
449 | // update crc |
449 | // update crc |
450 | Mixer.crc = RAM_Checksum((uint8_t*)(&Mixer), sizeof(Mixer) - 1); |
450 | Mixer.crc = RAM_Checksum((uint8_t*)(&Mixer), sizeof(Mixer) - 1); |
451 | 451 | ||
452 | // write to eeprom |
452 | // write to eeprom |
453 | eeprom_write_block((void *) &Mixer, (void*)(EEPROM_ADR_MIXERTABLE), sizeof(Mixer)); |
453 | eeprom_write_block((void *) &Mixer, (void*)(EEPROM_ADR_MIXERTABLE), sizeof(Mixer)); |
454 | return 1; |
454 | return 1; |
455 | } |
455 | } |
456 | else return 0; |
456 | else return 0; |
457 | } |
457 | } |
458 | 458 | ||
459 | /***************************************************/ |
459 | /***************************************************/ |
460 | /* Default Values for Mixer Table */ |
460 | /* Default Values for Mixer Table */ |
461 | /***************************************************/ |
461 | /***************************************************/ |
462 | void MixerTable_Default(void) // Quadro |
462 | void MixerTable_Default(void) // Quadro |
463 | { |
463 | { |
464 | uint8_t i; |
464 | uint8_t i; |
465 | 465 | ||
466 | Mixer.Revision = EEMIXER_REVISION; |
466 | Mixer.Revision = EEMIXER_REVISION; |
467 | // clear mixer table |
467 | // clear mixer table |
468 | for(i = 0; i < 16; i++) |
468 | for(i = 0; i < 16; i++) |
469 | { |
469 | { |
470 | Mixer.Motor[i][MIX_GAS] = 0; |
470 | Mixer.Motor[i][MIX_GAS] = 0; |
471 | Mixer.Motor[i][MIX_NICK] = 0; |
471 | Mixer.Motor[i][MIX_NICK] = 0; |
472 | Mixer.Motor[i][MIX_ROLL] = 0; |
472 | Mixer.Motor[i][MIX_ROLL] = 0; |
473 | Mixer.Motor[i][MIX_YAW] = 0; |
473 | Mixer.Motor[i][MIX_YAW] = 0; |
474 | } |
474 | } |
475 | // default = Quadro |
475 | // default = Quadro |
476 | Mixer.Motor[0][MIX_GAS] = 64; Mixer.Motor[0][MIX_NICK] = +64; Mixer.Motor[0][MIX_ROLL] = 0; Mixer.Motor[0][MIX_YAW] = +64; |
476 | Mixer.Motor[0][MIX_GAS] = 64; Mixer.Motor[0][MIX_NICK] = +64; Mixer.Motor[0][MIX_ROLL] = 0; Mixer.Motor[0][MIX_YAW] = +64; |
477 | Mixer.Motor[1][MIX_GAS] = 64; Mixer.Motor[1][MIX_NICK] = -64; Mixer.Motor[1][MIX_ROLL] = 0; Mixer.Motor[1][MIX_YAW] = +64; |
477 | Mixer.Motor[1][MIX_GAS] = 64; Mixer.Motor[1][MIX_NICK] = -64; Mixer.Motor[1][MIX_ROLL] = 0; Mixer.Motor[1][MIX_YAW] = +64; |
478 | Mixer.Motor[2][MIX_GAS] = 64; Mixer.Motor[2][MIX_NICK] = 0; Mixer.Motor[2][MIX_ROLL] = -64; Mixer.Motor[2][MIX_YAW] = -64; |
478 | Mixer.Motor[2][MIX_GAS] = 64; Mixer.Motor[2][MIX_NICK] = 0; Mixer.Motor[2][MIX_ROLL] = -64; Mixer.Motor[2][MIX_YAW] = -64; |
479 | Mixer.Motor[3][MIX_GAS] = 64; Mixer.Motor[3][MIX_NICK] = 0; Mixer.Motor[3][MIX_ROLL] = +64; Mixer.Motor[3][MIX_YAW] = -64; |
479 | Mixer.Motor[3][MIX_GAS] = 64; Mixer.Motor[3][MIX_NICK] = 0; Mixer.Motor[3][MIX_ROLL] = +64; Mixer.Motor[3][MIX_YAW] = -64; |
480 | memcpy(Mixer.Name, "Quadro\0", 7); |
480 | memcpy(Mixer.Name, "Quadro\0", 7); |
481 | Mixer.crc = RAM_Checksum((uint8_t*)(&Mixer), sizeof(Mixer) - 1); |
481 | Mixer.crc = RAM_Checksum((uint8_t*)(&Mixer), sizeof(Mixer) - 1); |
482 | } |
482 | } |
483 | 483 | ||
484 | /***************************************************/ |
484 | /***************************************************/ |
485 | /* Get active parameter set */ |
485 | /* Get active parameter set */ |
486 | /***************************************************/ |
486 | /***************************************************/ |
487 | uint8_t GetActiveParamSet(void) |
487 | uint8_t GetActiveParamSet(void) |
488 | { |
488 | { |
489 | uint8_t setnumber; |
489 | uint8_t setnumber; |
490 | setnumber = eeprom_read_byte((uint8_t*)(EEPROM_ADR_PARAM_BEGIN + PID_ACTIVE_SET)); |
490 | setnumber = eeprom_read_byte((uint8_t*)(EEPROM_ADR_PARAM_BEGIN + PID_ACTIVE_SET)); |
491 | if(setnumber > 5) |
491 | if(setnumber > 5) |
492 | { |
492 | { |
493 | setnumber = 3; |
493 | setnumber = 3; |
494 | eeprom_write_byte((void*)(EEPROM_ADR_PARAM_BEGIN+PID_ACTIVE_SET), setnumber); |
494 | eeprom_write_byte((void*)(EEPROM_ADR_PARAM_BEGIN+PID_ACTIVE_SET), setnumber); |
495 | } |
495 | } |
496 | return(setnumber); |
496 | return(setnumber); |
497 | } |
497 | } |
498 | 498 | ||
499 | /***************************************************/ |
499 | /***************************************************/ |
500 | /* Set active parameter set */ |
500 | /* Set active parameter set */ |
501 | /***************************************************/ |
501 | /***************************************************/ |
502 | void SetActiveParamSet(uint8_t setnumber) |
502 | void SetActiveParamSet(uint8_t setnumber) |
503 | { |
503 | { |
504 | if(setnumber > 5) setnumber = 5; |
504 | if(setnumber > 5) setnumber = 5; |
505 | if(setnumber < 1) setnumber = 1; |
505 | if(setnumber < 1) setnumber = 1; |
506 | eeprom_write_byte((uint8_t*)(EEPROM_ADR_PARAM_BEGIN + PID_ACTIVE_SET), setnumber); |
506 | eeprom_write_byte((uint8_t*)(EEPROM_ADR_PARAM_BEGIN + PID_ACTIVE_SET), setnumber); |
507 | } |
507 | } |
508 | 508 | ||
509 | /***************************************************/ |
509 | /***************************************************/ |
510 | /* Set default parameter set */ |
510 | /* Set default parameter set */ |
511 | /***************************************************/ |
511 | /***************************************************/ |
512 | void SetDefaultParameter(uint8_t set, uint8_t restore_channels) |
512 | void SetDefaultParameter(uint8_t set, uint8_t restore_channels) |
513 | { |
513 | { |
514 | 514 | ||
515 | if(set > 5) set = 5; |
515 | if(set > 5) set = 5; |
516 | else if(set < 1) set = 1; |
516 | else if(set < 1) set = 1; |
517 | 517 | ||
518 | switch(set) |
518 | switch(set) |
519 | { |
519 | { |
520 | case 1: |
520 | case 1: |
521 | ParamSet_DefaultSet1(); // Fill ParamSet Structure to default parameter set 1 (Sport) |
521 | ParamSet_DefaultSet1(); // Fill ParamSet Structure to default parameter set 1 (Sport) |
522 | break; |
522 | break; |
523 | case 2: |
523 | case 2: |
524 | ParamSet_DefaultSet2(); // Kamera |
524 | ParamSet_DefaultSet2(); // Kamera |
525 | break; |
525 | break; |
526 | case 3: |
526 | case 3: |
527 | ParamSet_DefaultSet3(); // Beginner |
527 | ParamSet_DefaultSet3(); // Beginner |
528 | break; |
528 | break; |
529 | default: |
529 | default: |
530 | ParamSet_DefaultSet3(); // Beginner |
530 | ParamSet_DefaultSet3(); // Beginner |
531 | break; |
531 | break; |
532 | } |
532 | } |
533 | if(restore_channels) |
533 | if(restore_channels) |
534 | { |
534 | { |
535 | uint8_t crc; |
535 | uint8_t crc; |
536 | // 1st check for a valid channel backup in eeprom |
536 | // 1st check for a valid channel backup in eeprom |
537 | crc = EEProm_Checksum(EEPROM_ADR_CHANNELS, sizeof(EE_Parameter.Kanalbelegung)); |
537 | crc = EEProm_Checksum(EEPROM_ADR_CHANNELS, sizeof(EE_Parameter.Kanalbelegung)); |
538 | if(crc == eeprom_read_byte((uint8_t*)(EEPROM_ADR_CHANNELS + sizeof(EE_Parameter.Kanalbelegung))) ) |
538 | if(crc == eeprom_read_byte((uint8_t*)(EEPROM_ADR_CHANNELS + sizeof(EE_Parameter.Kanalbelegung))) ) |
539 | { |
539 | { |
540 | eeprom_read_block((void *)EE_Parameter.Kanalbelegung, (void*)(EEPROM_ADR_CHANNELS), sizeof(EE_Parameter.Kanalbelegung)); |
540 | eeprom_read_block((void *)EE_Parameter.Kanalbelegung, (void*)(EEPROM_ADR_CHANNELS), sizeof(EE_Parameter.Kanalbelegung)); |
541 | } |
541 | } |
542 | else ParamSet_DefaultStickMapping(); |
542 | else ParamSet_DefaultStickMapping(); |
543 | } |
543 | } |
544 | else ParamSet_DefaultStickMapping(); |
544 | else ParamSet_DefaultStickMapping(); |
545 | ParamSet_WriteToEEProm(set); |
545 | ParamSet_WriteToEEProm(set); |
546 | } |
546 | } |
547 | 547 | ||
548 | /***************************************************/ |
548 | /***************************************************/ |
549 | /* Initialize EEPROM Parameter Sets */ |
549 | /* Initialize EEPROM Parameter Sets */ |
550 | /***************************************************/ |
550 | /***************************************************/ |
551 | void ParamSet_Init(void) |
551 | void ParamSet_Init(void) |
552 | { |
552 | { |
553 | uint8_t channel_backup = 0, bad_params = 0, ee_default = 0,i; |
553 | uint8_t channel_backup = 0, bad_params = 0, ee_default = 0,i; |
554 | 554 | ||
555 | 555 | ||
556 | if(EEPARAM_REVISION != GetParamByte(PID_EE_REVISION) ) |
556 | if(EEPARAM_REVISION != GetParamByte(PID_EE_REVISION) ) |
557 | { |
557 | { |
558 | ee_default = 1; // software update or forced by mktool |
558 | ee_default = 1; // software update or forced by mktool |
559 | } |
559 | } |
560 | 560 | ||
561 | 561 | ||
562 | // 1st check for a valid channel backup in eeprom |
562 | // 1st check for a valid channel backup in eeprom |
563 | i = EEProm_Checksum(EEPROM_ADR_CHANNELS, sizeof(EE_Parameter.Kanalbelegung)); |
563 | i = EEProm_Checksum(EEPROM_ADR_CHANNELS, sizeof(EE_Parameter.Kanalbelegung)); |
564 | if(i == eeprom_read_byte((uint8_t*)(EEPROM_ADR_CHANNELS + sizeof(EE_Parameter.Kanalbelegung))) ) channel_backup = 1; |
564 | if(i == eeprom_read_byte((uint8_t*)(EEPROM_ADR_CHANNELS + sizeof(EE_Parameter.Kanalbelegung))) ) channel_backup = 1; |
565 | 565 | ||
566 | 566 | ||
567 | // parameter check |
567 | // parameter check |
568 | 568 | ||
569 | // check all 5 parameter settings |
569 | // check all 5 parameter settings |
570 | for (i = 1;i < 6; i++) |
570 | for (i = 1;i < 6; i++) |
571 | { |
571 | { |
572 | if(ee_default || !ParamSet_ReadFromEEProm(i)) // could not read paramset from eeprom |
572 | if(ee_default || !ParamSet_ReadFromEEProm(i)) // could not read paramset from eeprom |
573 | { |
573 | { |
574 | bad_params = 1; |
574 | bad_params = 1; |
575 | printf("\n\rGenerating default Parameter Set %d",i); |
575 | printf("\n\rGenerating default Parm Set %d",i); |
576 | switch(i) |
576 | switch(i) |
577 | { |
577 | { |
578 | case 1: |
578 | case 1: |
579 | ParamSet_DefaultSet1(); // Fill ParamSet Structure to default parameter set 1 (Sport) |
579 | ParamSet_DefaultSet1(); // Fill ParamSet Structure to default parameter set 1 (Sport) |
580 | break; |
580 | break; |
581 | case 2: |
581 | case 2: |
582 | ParamSet_DefaultSet2(); // Kamera |
582 | ParamSet_DefaultSet2(); // Kamera |
583 | break; |
583 | break; |
584 | case 3: |
584 | case 3: |
585 | ParamSet_DefaultSet3(); // Beginner |
585 | ParamSet_DefaultSet3(); // Beginner |
586 | break; |
586 | break; |
587 | default: |
587 | default: |
588 | ParamSet_DefaultSet3(); // Kamera |
588 | ParamSet_DefaultSet3(); // Kamera |
589 | break; |
589 | break; |
590 | } |
590 | } |
591 | if(channel_backup) // if we have an channel mapping backup in eeprom |
591 | if(channel_backup) // if we have an channel mapping backup in eeprom |
592 | { // restore it from eeprom |
592 | { // restore it from eeprom |
593 | eeprom_read_block((void *)EE_Parameter.Kanalbelegung, (void*)(EEPROM_ADR_CHANNELS), sizeof(EE_Parameter.Kanalbelegung)); |
593 | eeprom_read_block((void *)EE_Parameter.Kanalbelegung, (void*)(EEPROM_ADR_CHANNELS), sizeof(EE_Parameter.Kanalbelegung)); |
594 | } |
594 | } |
595 | else |
595 | else |
596 | { // use default mapping |
596 | { // use default mapping |
597 | ParamSet_DefaultStickMapping(); |
597 | ParamSet_DefaultStickMapping(); |
598 | } |
598 | } |
599 | ParamSet_WriteToEEProm(i); |
599 | ParamSet_WriteToEEProm(i); |
600 | } |
600 | } |
601 | } |
601 | } |
602 | if(bad_params) // at least one of the parameter settings were invalid |
602 | if(bad_params) // at least one of the parameter settings were invalid |
603 | { |
603 | { |
604 | // default-Setting is parameter set 3 |
604 | // default-Setting is parameter set 3 |
605 | SetActiveParamSet(3); |
605 | SetActiveParamSet(3); |
606 | } |
606 | } |
607 | 607 | ||
608 | 608 | ||
609 | // read active parameter set to ParamSet stucture |
609 | // read active parameter set to ParamSet stucture |
610 | i = GetActiveParamSet(); |
610 | i = GetActiveParamSet(); |
611 | ParamSet_ReadFromEEProm(i); |
611 | ParamSet_ReadFromEEProm(i); |
612 | printf("\n\rUsing Parameter Set %d", i); |
612 | printf("\n\rUsing Parm Set %d", i); |
613 | 613 | ||
614 | // load mixer table |
614 | // load mixer table |
615 | if(GetParamByte(PID_EE_REVISION) == 0xff || !MixerTable_ReadFromEEProm() ) |
615 | if(GetParamByte(PID_EE_REVISION) == 0xff || !MixerTable_ReadFromEEProm() ) |
616 | { |
616 | { |
617 | printf("\n\rGenerating default Mixer Table"); |
617 | printf("\n\rGenerating default Mixer Table"); |
618 | MixerTable_Default(); // Quadro |
618 | MixerTable_Default(); // Quadro |
619 | MixerTable_WriteToEEProm(); |
619 | MixerTable_WriteToEEProm(); |
620 | } |
620 | } |
621 | if(ee_default) SetParamByte(PID_EE_REVISION, EEPARAM_REVISION); |
621 | if(ee_default) SetParamByte(PID_EE_REVISION, EEPARAM_REVISION); |
622 | // determine motornumber |
622 | // determine motornumber |
623 | RequiredMotors = 0; |
623 | RequiredMotors = 0; |
624 | for(i = 0; i < 16; i++) |
624 | for(i = 0; i < 16; i++) |
625 | { |
625 | { |
626 | if(Mixer.Motor[i][MIX_GAS] > 0) RequiredMotors++; |
626 | if(Mixer.Motor[i][MIX_GAS] > 0) RequiredMotors++; |
627 | } |
627 | } |
628 | 628 | ||
629 | printf("\n\rMixer-Config: '%s' (%u Motors)",Mixer.Name, RequiredMotors); |
629 | printf("\n\rMixer-Config: '%s' (%u Motors)",Mixer.Name, RequiredMotors); |
630 | PrintLine();// ("\n\r==================================="); |
630 | PrintLine();// ("\n\r==================================="); |
631 | 631 | ||
632 | } |
632 | } |
633 | 633 |