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