Subversion Repositories FlightCtrl

Rev

Rev 1980 | Rev 1988 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1980 Rev 1986
Line 76... Line 76...
76
 * Replacing this code by the code below saved almost 1 kbyte.
76
 * Replacing this code by the code below saved almost 1 kbyte.
77
 ************************************************************************/
77
 ************************************************************************/
Line 78... Line 78...
78
 
78
 
79
void configuration_applyVariablesToParams(void) {
79
void configuration_applyVariablesToParams(void) {
-
 
80
  uint8_t i;
-
 
81
 
-
 
82
  debugOut.analog[20] = variables[0];
80
  uint8_t i;
83
 
81
#define SET_POT_MM(b,a,min,max) {if (a<255) {if (a>=255-VARIABLE_COUNT) b=variables[a+VARIABLE_COUNT-255]; else b=a;} if(b<=min) b=min; else if(b>=max) b=max;}
84
#define SET_POT_MM(b,a,min,max) {if (a>=255-VARIABLE_COUNT) b=variables[a+VARIABLE_COUNT-255]; else b=a; if(b<=min) b=min; else if(b>=max) b=max;}
82
#define SET_POT(b,a) { if (a<255) {if (a>=255-VARIABLE_COUNT) b=variables[a+VARIABLE_COUNT-255]; else b=a;}}
85
#define SET_POT(b,a) {if (a>=255-VARIABLE_COUNT) b=variables[a+VARIABLE_COUNT-255]; else b=a;}
83
  SET_POT_MM(dynamicParams.gyroP, staticParams.gyroP, 5, 200);
86
  SET_POT_MM(dynamicParams.gyroP, staticParams.gyroP, 5, 200);
84
  SET_POT(dynamicParams.gyroI, staticParams.gyroI);
87
  SET_POT(dynamicParams.gyroI, staticParams.gyroI);
85
  SET_POT(dynamicParams.gyroD, staticParams.gyroD);
88
  SET_POT(dynamicParams.gyroD, staticParams.gyroD);
86
  SET_POT(dynamicParams.IFactor, staticParams.IFactor);
89
  SET_POT(dynamicParams.IFactor, staticParams.IFactor);
Line 238... Line 241...
238
 
241
 
239
  staticParams.axisCoupling1 = 90;
242
  staticParams.axisCoupling1 = 90;
240
  staticParams.axisCoupling2 = 67;
243
  staticParams.axisCoupling2 = 67;
241
  staticParams.axisCouplingYawCorrection = 0;
244
  staticParams.axisCouplingYawCorrection = 0;
-
 
245
  staticParams.dynamicStability = 50;
242
  staticParams.dynamicStability = 50;
246
  staticParams.maxAccVector = 10;
243
  staticParams.IFactor = 32;
247
  staticParams.IFactor = 32;
244
  staticParams.yawIFactor = 100;  
248
  staticParams.yawIFactor = 100;  
Line 245... Line 249...
245
  staticParams.compassYawEffect = 128;
249
  staticParams.compassYawEffect = 128;
Line 264... Line 268...
264
  staticParams.outputFlash[0].bitmask = 1; //0b01011111;
268
  staticParams.outputFlash[0].bitmask = 1; //0b01011111;
265
  staticParams.outputFlash[0].timing = 15;
269
  staticParams.outputFlash[0].timing = 15;
266
  staticParams.outputFlash[1].bitmask = 3; //0b11110011;
270
  staticParams.outputFlash[1].bitmask = 3; //0b11110011;
267
  staticParams.outputFlash[1].timing = 15;
271
  staticParams.outputFlash[1].timing = 15;
Line 268... Line 272...
268
 
272
 
269
  staticParams.outputDebugMask = 0;
273
  staticParams.outputDebugMask = 8;
270
  staticParams.outputOptions   = 8;
274
  staticParams.outputFlags   = 16|8|4;
Line 271... Line 275...
271
}
275
}
272
 
276
 
273
/***************************************************/
277
/***************************************************/
Line 323... Line 327...
323
  channelMap.channels[CH_POTS + 0] = 4;
327
  channelMap.channels[CH_POTS + 0] = 4;
324
  channelMap.channels[CH_POTS + 1] = 5;
328
  channelMap.channels[CH_POTS + 1] = 5;
325
  channelMap.channels[CH_POTS + 2] = 6;
329
  channelMap.channels[CH_POTS + 2] = 6;
326
  channelMap.channels[CH_POTS + 3] = 7;
330
  channelMap.channels[CH_POTS + 3] = 7;
327
}
331
}
328
 
-