Subversion Repositories FlightCtrl

Rev

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

Rev 1987 Rev 1991
Line 282... Line 282...
282
 
282
 
283
void analog_updateGyros(void) {
283
void analog_updateGyros(void) {
284
  // for various filters...
284
  // for various filters...
Line -... Line 285...
-
 
285
  int16_t tempOffsetGyro, tempGyro;
285
  int16_t tempOffsetGyro, tempGyro;
286
 
286
 
287
  debugOut.digital[0] &= ~DEBUG_SENSORLIMIT;
Line 287... Line 288...
287
  for (uint8_t axis=0; axis<2; axis++) {
288
  for (uint8_t axis=0; axis<2; axis++) {
288
    tempGyro = rawGyroSum[axis] = sensorInputs[AD_GYRO_PITCH-axis];
289
    tempGyro = rawGyroSum[axis] = sensorInputs[AD_GYRO_PITCH-axis];
Line 299... Line 300...
299
        tempGyro = tempGyro * EXTRAPOLATION_SLOPE - EXTRAPOLATION_LIMIT;
300
        tempGyro = tempGyro * EXTRAPOLATION_SLOPE - EXTRAPOLATION_LIMIT;
300
      } else if (tempGyro > SENSOR_MAX_PITCHROLL) {
301
      } else if (tempGyro > SENSOR_MAX_PITCHROLL) {
301
        debugOut.digital[0] |= DEBUG_SENSORLIMIT;
302
        debugOut.digital[0] |= DEBUG_SENSORLIMIT;
302
        tempGyro = (tempGyro - SENSOR_MAX_PITCHROLL) * EXTRAPOLATION_SLOPE
303
        tempGyro = (tempGyro - SENSOR_MAX_PITCHROLL) * EXTRAPOLATION_SLOPE
303
          + SENSOR_MAX_PITCHROLL;
304
          + SENSOR_MAX_PITCHROLL;
304
      } else {
-
 
305
        debugOut.digital[0] &= ~DEBUG_SENSORLIMIT;
-
 
306
      }
305
      }
307
    }
306
    }
Line 308... Line 307...
308
   
307
   
309
    // 2) Apply sign and offset, scale before filtering.
308
    // 2) Apply sign and offset, scale before filtering.