Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
395 | hbuss | 1 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
886 | killagreg | 2 | // + Konstanten |
395 | hbuss | 3 | // + 0-250 -> normale Werte |
4 | // + 251 -> Poti1 |
||
5 | // + 252 -> Poti2 |
||
6 | // + 253 -> Poti3 |
||
7 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
886 | killagreg | 8 | |
9 | #ifndef EEMEM |
||
10 | #define EEMEM __attribute__ ((section (".eeprom"))) |
||
11 | #endif |
||
12 | |||
13 | |||
14 | #include <avr/eeprom.h> |
||
15 | #include <string.h> |
||
16 | #include "eeprom.h" |
||
17 | #include "printf_P.h" |
||
936 | killagreg | 18 | #include "led.h" |
886 | killagreg | 19 | |
20 | |||
21 | // byte array in eeprom |
||
22 | uint8_t EEPromArray[E2END+1] EEMEM; |
||
23 | |||
24 | paramset_t ParamSet; |
||
25 | |||
26 | |||
27 | |||
28 | /***************************************************/ |
||
29 | /* Default Values for parameter set 1 */ |
||
30 | /***************************************************/ |
||
31 | void ParamSet_DefaultSet1(void) // sport |
||
395 | hbuss | 32 | { |
1078 | killagreg | 33 | ParamSet.ChannelAssignment[CH_NICK] = 1; |
34 | ParamSet.ChannelAssignment[CH_ROLL] = 2; |
||
35 | ParamSet.ChannelAssignment[CH_GAS] = 3; |
||
36 | ParamSet.ChannelAssignment[CH_YAW] = 4; |
||
37 | ParamSet.ChannelAssignment[CH_POTI1] = 5; |
||
38 | ParamSet.ChannelAssignment[CH_POTI2] = 6; |
||
39 | ParamSet.ChannelAssignment[CH_POTI3] = 7; |
||
40 | ParamSet.ChannelAssignment[CH_POTI4] = 8; |
||
41 | ParamSet.GlobalConfig = CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX; |
||
42 | ParamSet.Height_MinGas = 30; |
||
43 | ParamSet.MaxHeight = 251; // Wert : 0-250 251 -> Poti1 |
||
44 | ParamSet.Height_P = 10; // Wert : 0-32 |
||
45 | ParamSet.Height_D = 30; // Wert : 0-250 |
||
46 | ParamSet.Height_ACC_Effect = 30; // Wert : 0-250 |
||
47 | ParamSet.Height_Gain = 4; // Wert : 0-50 |
||
48 | ParamSet.Stick_P = 15; // Wert : 1-24 |
||
49 | ParamSet.Stick_D = 30; // Wert : 0-250 |
||
50 | ParamSet.Yaw_P = 12; // Wert : 1-20 |
||
51 | ParamSet.Gas_Min = 8; // Wert : 0-32 |
||
52 | ParamSet.Gas_Max = 230; // Wert : 33-250 |
||
53 | ParamSet.GyroAccFactor = 30; // Wert : 1-64 |
||
54 | ParamSet.CompassYawEffect = 128; // Wert : 0-250 |
||
55 | ParamSet.Gyro_P = 80; // Wert : 0-250 |
||
56 | ParamSet.Gyro_I = 150; // Wert : 0-250 |
||
57 | ParamSet.LowVoltageWarning = 94; // Wert : 0-250 |
||
58 | ParamSet.EmergencyGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
||
59 | ParamSet.EmergencyGasDuration = 30; // Wert : 0-250 // Zeit bis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
||
60 | ParamSet.UfoArrangement = 0; // X oder + Formation |
||
61 | ParamSet.I_Factor = 32; |
||
62 | ParamSet.UserParam1 = 0; //zur freien Verwendung |
||
63 | ParamSet.UserParam2 = 0; //zur freien Verwendung |
||
64 | ParamSet.UserParam3 = 0; //zur freien Verwendung |
||
65 | ParamSet.UserParam4 = 0; //zur freien Verwendung |
||
66 | ParamSet.UserParam5 = 0; // zur freien Verwendung |
||
67 | ParamSet.UserParam6 = 0; // zur freien Verwendung |
||
68 | ParamSet.UserParam7 = 0; // zur freien Verwendung |
||
69 | ParamSet.UserParam8 = 0; // zur freien Verwendung |
||
70 | ParamSet.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
||
71 | ParamSet.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
||
72 | ParamSet.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
||
73 | ParamSet.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
||
74 | ParamSet.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
||
75 | ParamSet.ServoNickRefresh = 5; |
||
76 | ParamSet.LoopGasLimit = 50; |
||
77 | ParamSet.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
||
78 | ParamSet.LoopHysteresis = 50; |
||
79 | ParamSet.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
||
80 | ParamSet.Yaw_PosFeedback = 90; |
||
81 | ParamSet.Yaw_NegFeedback = 5; |
||
82 | ParamSet.AngleTurnOverNick = 85; |
||
83 | ParamSet.AngleTurnOverRoll = 85; |
||
84 | ParamSet.GyroAccTrim = 16; // 1/k |
||
85 | ParamSet.DriftComp = 4; |
||
86 | ParamSet.DynamicStability = 100; |
||
87 | ParamSet.J16Bitmask = 95; |
||
88 | ParamSet.J17Bitmask = 243; |
||
89 | ParamSet.J16Timing = 15; |
||
90 | ParamSet.J17Timing = 15; |
||
91 | ParamSet.NaviGpsModeControl = 253; |
||
92 | ParamSet.NaviGpsGain = 100; |
||
93 | ParamSet.NaviGpsP = 90; |
||
94 | ParamSet.NaviGpsI = 90; |
||
95 | ParamSet.NaviGpsD = 90; |
||
96 | ParamSet.NaviGpsACC = 0; |
||
97 | ParamSet.NaviGpsMinSat = 6; |
||
98 | ParamSet.NaviStickThreshold = 8; |
||
99 | ParamSet.NaviWindCorrection = 90; |
||
100 | ParamSet.NaviSpeedCompensation = 30; |
||
101 | ParamSet.NaviOperatingRadius = 100; |
||
102 | ParamSet.NaviAngleLimitation = 60; |
||
103 | memcpy(ParamSet.Name, "Sport\0",6); |
||
395 | hbuss | 104 | } |
886 | killagreg | 105 | |
106 | |||
107 | /***************************************************/ |
||
108 | /* Default Values for parameter set 2 */ |
||
109 | /***************************************************/ |
||
110 | void ParamSet_DefaultSet2(void) // normal |
||
395 | hbuss | 111 | { |
1078 | killagreg | 112 | ParamSet.ChannelAssignment[CH_NICK] = 1; |
113 | ParamSet.ChannelAssignment[CH_ROLL] = 2; |
||
114 | ParamSet.ChannelAssignment[CH_GAS] = 3; |
||
115 | ParamSet.ChannelAssignment[CH_YAW] = 4; |
||
116 | ParamSet.ChannelAssignment[CH_POTI1] = 5; |
||
117 | ParamSet.ChannelAssignment[CH_POTI2] = 6; |
||
118 | ParamSet.ChannelAssignment[CH_POTI3] = 7; |
||
119 | ParamSet.ChannelAssignment[CH_POTI4] = 8; |
||
120 | ParamSet.GlobalConfig = CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX; |
||
121 | ParamSet.Height_MinGas = 30; |
||
122 | ParamSet.MaxHeight = 251; // Wert : 0-250 251 -> Poti1 |
||
123 | ParamSet.Height_P = 10; // Wert : 0-32 |
||
124 | ParamSet.Height_D = 30; // Wert : 0-250 |
||
125 | ParamSet.Height_ACC_Effect = 30; // Wert : 0-250 |
||
126 | ParamSet.Height_Gain = 3; // Wert : 0-50 |
||
127 | ParamSet.Stick_P = 12; // Wert : 1-24 |
||
128 | ParamSet.Stick_D = 16; // Wert : 0-250 |
||
129 | ParamSet.Yaw_P = 6; // Wert : 1-20 |
||
130 | ParamSet.Gas_Min = 8; // Wert : 0-32 |
||
131 | ParamSet.Gas_Max = 230; // Wert : 33-250 |
||
132 | ParamSet.GyroAccFactor = 30; // Wert : 1-64 |
||
133 | ParamSet.CompassYawEffect = 128; // Wert : 0-250 |
||
134 | ParamSet.Gyro_P = 80; // Wert : 0-250 |
||
135 | ParamSet.Gyro_I = 120; // Wert : 0-250 |
||
136 | ParamSet.LowVoltageWarning = 94; // Wert : 0-250 |
||
137 | ParamSet.EmergencyGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
||
138 | ParamSet.EmergencyGasDuration = 30; // Wert : 0-250 // Zeit bis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
||
139 | ParamSet.UfoArrangement = 0; // X oder + Formation |
||
140 | ParamSet.I_Factor = 32; |
||
141 | ParamSet.UserParam1 = 0; // zur freien Verwendung |
||
142 | ParamSet.UserParam2 = 0; // zur freien Verwendung |
||
143 | ParamSet.UserParam3 = 0; // zur freien Verwendung |
||
144 | ParamSet.UserParam4 = 0; // zur freien Verwendung |
||
145 | ParamSet.UserParam5 = 0; // zur freien Verwendung |
||
146 | ParamSet.UserParam6 = 0; // zur freien Verwendung |
||
147 | ParamSet.UserParam7 = 0; // zur freien Verwendung |
||
148 | ParamSet.UserParam8 = 0; // zur freien Verwendung |
||
149 | ParamSet.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
||
150 | ParamSet.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
||
151 | ParamSet.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
||
152 | ParamSet.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
||
153 | ParamSet.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
||
154 | ParamSet.ServoNickRefresh = 5; |
||
155 | ParamSet.LoopGasLimit = 50; |
||
156 | ParamSet.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
||
157 | ParamSet.LoopHysteresis = 50; |
||
158 | ParamSet.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
||
159 | ParamSet.Yaw_PosFeedback = 90; // Faktor, mit dem Yaw die Achsen Roll und Nick verkoppelt |
||
160 | ParamSet.Yaw_NegFeedback = 5; |
||
161 | ParamSet.AngleTurnOverNick = 85; |
||
162 | ParamSet.AngleTurnOverRoll = 85; |
||
163 | ParamSet.GyroAccTrim = 32; // 1/k |
||
164 | ParamSet.DriftComp = 4; |
||
165 | ParamSet.DynamicStability = 75; |
||
166 | ParamSet.J16Bitmask = 95; |
||
167 | ParamSet.J17Bitmask = 243; |
||
168 | ParamSet.J16Timing = 20; |
||
169 | ParamSet.J17Timing = 20; |
||
170 | ParamSet.NaviGpsModeControl = 253; |
||
171 | ParamSet.NaviGpsGain = 100; |
||
172 | ParamSet.NaviGpsP = 90; |
||
173 | ParamSet.NaviGpsI = 90; |
||
174 | ParamSet.NaviGpsD = 90; |
||
175 | ParamSet.NaviGpsACC = 0; |
||
176 | ParamSet.NaviGpsMinSat = 6; |
||
177 | ParamSet.NaviStickThreshold = 8; |
||
178 | ParamSet.NaviWindCorrection = 90; |
||
179 | ParamSet.NaviSpeedCompensation = 30; |
||
180 | ParamSet.NaviOperatingRadius = 100; |
||
181 | ParamSet.NaviAngleLimitation = 60; |
||
182 | memcpy(ParamSet.Name, "Normal\0", 7); |
||
395 | hbuss | 183 | } |
184 | |||
886 | killagreg | 185 | |
186 | /***************************************************/ |
||
187 | /* Default Values for parameter set 3 */ |
||
188 | /***************************************************/ |
||
189 | void ParamSet_DefaultSet3(void) // beginner |
||
395 | hbuss | 190 | { |
1078 | killagreg | 191 | ParamSet.ChannelAssignment[CH_NICK] = 1; |
192 | ParamSet.ChannelAssignment[CH_ROLL] = 2; |
||
193 | ParamSet.ChannelAssignment[CH_GAS] = 3; |
||
194 | ParamSet.ChannelAssignment[CH_YAW] = 4; |
||
195 | ParamSet.ChannelAssignment[CH_POTI1] = 5; |
||
196 | ParamSet.ChannelAssignment[CH_POTI2] = 6; |
||
197 | ParamSet.ChannelAssignment[CH_POTI3] = 7; |
||
198 | ParamSet.ChannelAssignment[CH_POTI4] = 8; |
||
199 | ParamSet.GlobalConfig = CFG_ROTARY_RATE_LIMITER | CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX; |
||
200 | ParamSet.Height_MinGas = 30; |
||
201 | ParamSet.MaxHeight = 251; // Wert : 0-250 251 -> Poti1 |
||
202 | ParamSet.Height_P = 10; // Wert : 0-32 |
||
203 | ParamSet.Height_D = 30; // Wert : 0-250 |
||
204 | ParamSet.Height_ACC_Effect = 30; // Wert : 0-250 |
||
205 | ParamSet.Height_Gain = 3; // Wert : 0-50 |
||
206 | ParamSet.Stick_P = 8; // Wert : 1-24 |
||
207 | ParamSet.Stick_D = 16; // Wert : 0-250 |
||
208 | ParamSet.Yaw_P = 6; // Wert : 1-20 |
||
209 | ParamSet.Gas_Min = 8; // Wert : 0-32 |
||
210 | ParamSet.Gas_Max = 230; // Wert : 33-250 |
||
211 | ParamSet.GyroAccFactor = 30; // Wert : 1-64 |
||
212 | ParamSet.CompassYawEffect = 128; // Wert : 0-250 |
||
213 | ParamSet.Gyro_P = 100; // Wert : 0-250 |
||
214 | ParamSet.Gyro_I = 120; // Wert : 0-250 |
||
215 | ParamSet.LowVoltageWarning = 94; // Wert : 0-250 |
||
216 | ParamSet.EmergencyGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
||
217 | ParamSet.EmergencyGasDuration = 20; // Wert : 0-250 // Zeit bis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
||
218 | ParamSet.UfoArrangement = 0; // X oder + Formation |
||
219 | ParamSet.I_Factor = 16; |
||
220 | ParamSet.UserParam1 = 0; // zur freien Verwendung |
||
221 | ParamSet.UserParam2 = 0; // zur freien Verwendung |
||
222 | ParamSet.UserParam3 = 0; // zur freien Verwendung |
||
223 | ParamSet.UserParam4 = 0; // zur freien Verwendung |
||
224 | ParamSet.UserParam5 = 0; // zur freien Verwendung |
||
225 | ParamSet.UserParam6 = 0; // zur freien Verwendung |
||
226 | ParamSet.UserParam7 = 0; // zur freien Verwendung |
||
227 | ParamSet.UserParam8 = 0; // zur freien Verwendung |
||
228 | ParamSet.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
||
229 | ParamSet.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
||
230 | ParamSet.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
||
231 | ParamSet.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
||
232 | ParamSet.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
||
233 | ParamSet.ServoNickRefresh = 5; |
||
234 | ParamSet.LoopGasLimit = 50; |
||
235 | ParamSet.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
||
236 | ParamSet.LoopHysteresis = 50; |
||
237 | ParamSet.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
||
238 | ParamSet.Yaw_PosFeedback = 90; // Faktor, mit dem Yaw die Achsen Roll und Nick verkoppelt |
||
239 | ParamSet.Yaw_NegFeedback = 5; |
||
240 | ParamSet.AngleTurnOverNick = 85; |
||
241 | ParamSet.AngleTurnOverRoll = 85; |
||
242 | ParamSet.GyroAccTrim = 32; // 1/k |
||
243 | ParamSet.DriftComp = 4; |
||
244 | ParamSet.DynamicStability = 50; |
||
245 | ParamSet.J16Bitmask = 95; |
||
246 | ParamSet.J17Bitmask = 243; |
||
247 | ParamSet.J16Timing = 30; |
||
248 | ParamSet.J17Timing = 30; |
||
249 | ParamSet.NaviGpsModeControl = 253; |
||
250 | ParamSet.NaviGpsGain = 100; |
||
251 | ParamSet.NaviGpsP = 90; |
||
252 | ParamSet.NaviGpsI = 90; |
||
253 | ParamSet.NaviGpsD = 90; |
||
254 | ParamSet.NaviGpsACC = 0; |
||
255 | ParamSet.NaviGpsMinSat = 6; |
||
256 | ParamSet.NaviStickThreshold = 8; |
||
257 | ParamSet.NaviWindCorrection = 90; |
||
258 | ParamSet.NaviSpeedCompensation = 30; |
||
259 | ParamSet.NaviOperatingRadius = 100; |
||
260 | ParamSet.NaviAngleLimitation = 60; |
||
261 | memcpy(ParamSet.Name, "Beginner\0", 9); |
||
395 | hbuss | 262 | } |
886 | killagreg | 263 | |
264 | /***************************************************/ |
||
265 | /* Read Parameter from EEPROM as byte */ |
||
266 | /***************************************************/ |
||
267 | uint8_t GetParamByte(uint8_t param_id) |
||
268 | { |
||
269 | return eeprom_read_byte(&EEPromArray[EEPROM_ADR_PARAM_BEGIN + param_id]); |
||
270 | } |
||
271 | |||
272 | /***************************************************/ |
||
273 | /* Write Parameter to EEPROM as byte */ |
||
274 | /***************************************************/ |
||
275 | void SetParamByte(uint8_t param_id, uint8_t value) |
||
276 | { |
||
277 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_PARAM_BEGIN + param_id], value); |
||
278 | } |
||
279 | |||
280 | /***************************************************/ |
||
281 | /* Read Parameter from EEPROM as word */ |
||
282 | /***************************************************/ |
||
283 | uint16_t GetParamWord(uint8_t param_id) |
||
284 | { |
||
285 | return eeprom_read_word((uint16_t *) &EEPromArray[EEPROM_ADR_PARAM_BEGIN + param_id]); |
||
286 | } |
||
287 | |||
288 | /***************************************************/ |
||
289 | /* Write Parameter to EEPROM as word */ |
||
290 | /***************************************************/ |
||
291 | void SetParamWord(uint8_t param_id, uint16_t value) |
||
292 | { |
||
293 | eeprom_write_word((uint16_t *) &EEPromArray[EEPROM_ADR_PARAM_BEGIN + param_id], value); |
||
294 | } |
||
295 | |||
296 | |||
297 | /***************************************************/ |
||
298 | /* Read Parameter Set from EEPROM */ |
||
299 | /***************************************************/ |
||
1078 | killagreg | 300 | // number [1..5] |
886 | killagreg | 301 | void ParamSet_ReadFromEEProm(uint8_t setnumber) |
302 | { |
||
1078 | killagreg | 303 | if((1 > setnumber) || (setnumber > 5)) setnumber = 3; |
304 | eeprom_read_block((uint8_t *) &ParamSet.ChannelAssignment[0], &EEPromArray[EEPROM_ADR_PARAMSET_BEGIN + PARAMSET_STRUCT_LEN * (setnumber - 1)], PARAMSET_STRUCT_LEN); |
||
305 | LED_Init(); |
||
886 | killagreg | 306 | } |
307 | |||
308 | /***************************************************/ |
||
309 | /* Write Parameter Set to EEPROM */ |
||
310 | /***************************************************/ |
||
1078 | killagreg | 311 | // number [1..5] |
886 | killagreg | 312 | void ParamSet_WriteToEEProm(uint8_t setnumber) |
313 | { |
||
1078 | killagreg | 314 | if(setnumber > 5) setnumber = 5; |
315 | if(setnumber < 1) return; |
||
316 | eeprom_write_block((uint8_t *) &ParamSet.ChannelAssignment[0], &EEPromArray[EEPROM_ADR_PARAMSET_BEGIN + PARAMSET_STRUCT_LEN * (setnumber - 1)], PARAMSET_STRUCT_LEN); |
||
317 | // set this parameter set to active set |
||
318 | SetActiveParamSet(setnumber); |
||
319 | LED_Init(); |
||
886 | killagreg | 320 | } |
321 | |||
322 | /***************************************************/ |
||
323 | /* Get active parameter set */ |
||
324 | /***************************************************/ |
||
325 | uint8_t GetActiveParamSet(void) |
||
326 | { |
||
327 | uint8_t setnumber; |
||
328 | setnumber = eeprom_read_byte(&EEPromArray[PID_ACTIVE_SET]); |
||
329 | if(setnumber > 5) |
||
330 | { |
||
1078 | killagreg | 331 | setnumber = 3; |
332 | eeprom_write_byte(&EEPromArray[PID_ACTIVE_SET], setnumber); |
||
886 | killagreg | 333 | } |
334 | return(setnumber); |
||
335 | } |
||
336 | |||
337 | /***************************************************/ |
||
338 | /* Set active parameter set */ |
||
339 | /***************************************************/ |
||
340 | void SetActiveParamSet(uint8_t setnumber) |
||
341 | { |
||
342 | if(setnumber > 5) setnumber = 5; |
||
1078 | killagreg | 343 | if(setnumber < 1) setnumber = 1; |
886 | killagreg | 344 | eeprom_write_byte(&EEPromArray[PID_ACTIVE_SET], setnumber); |
345 | } |
||
346 | |||
347 | /***************************************************/ |
||
348 | /* Initialize EEPROM Parameter Sets */ |
||
349 | /***************************************************/ |
||
350 | void ParamSet_Init(void) |
||
351 | { |
||
352 | // version check |
||
353 | if(eeprom_read_byte(&EEPromArray[PID_VERSION]) != EEPARAM_VERSION) |
||
354 | { |
||
355 | // if version check faild |
||
356 | printf("\n\rInit. EEPROM: Generating Default-Parameter..."); |
||
357 | ParamSet_DefaultSet1(); // Fill ParamSet Structure to default parameter set 1 (Sport) |
||
358 | // fill all 5 parameter settings with set 1 except otherwise defined |
||
1078 | killagreg | 359 | for (uint8_t i = 1;i < 6; i++) |
886 | killagreg | 360 | { |
1078 | killagreg | 361 | if(i==2) ParamSet_DefaultSet2(); // Kamera |
362 | if(i==3) ParamSet_DefaultSet3(); // Beginner |
||
363 | if(i>3) ParamSet_DefaultSet2(); // Kamera |
||
364 | ParamSet_WriteToEEProm(i); |
||
886 | killagreg | 365 | } |
366 | // default-Setting is parameter set 3 |
||
1078 | killagreg | 367 | SetActiveParamSet(3); |
886 | killagreg | 368 | // update version info |
369 | SetParamByte(PID_VERSION, EEPARAM_VERSION); |
||
370 | } |
||
371 | // read active parameter set to ParamSet stucture |
||
1078 | killagreg | 372 | ParamSet_ReadFromEEProm(GetActiveParamSet()); |
373 | printf("\n\rUsing Parameter Set %d", GetActiveParamSet()); |
||
886 | killagreg | 374 | } |