Subversion Repositories FlightCtrl

Rev

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

Rev 2095 Rev 2097
Line 153... Line 153...
153
int16_t UBat = 100;
153
int16_t UBat = 100;
Line 154... Line 154...
154
 
154
 
155
/*
155
/*
156
 * Control and status.
156
 * Control and status.
157
 */
-
 
158
volatile uint16_t ADCycleCount = 0;
157
 */
Line 159... Line 158...
159
volatile uint8_t analogDataReady = 1;
158
volatile uint8_t analogDataReady = 1;
160
 
159
 
161
/*
160
/*
Line 299... Line 298...
299
    // set adc muxer to next adChannel
298
    // set adc muxer to next adChannel
300
    ADMUX = (ADMUX & 0xE0) | adChannel;
299
    ADMUX = (ADMUX & 0xE0) | adChannel;
301
    // after full cycle stop further interrupts
300
    // after full cycle stop further interrupts
302
    startADC();
301
    startADC();
303
  } else {
302
  } else {
304
    ADCycleCount++;
-
 
305
    analogDataReady = 1;
303
    analogDataReady = 1;
306
    // do not restart ADC converter. 
304
    // do not restart ADC converter. 
307
  }
305
  }
308
}
306
}
Line 318... Line 316...
318
    cnt = 0;
316
    cnt = 0;
319
    gyroActivity *= (uint32_t)((1L<<GADAMPING)-1);
317
    gyroActivity *= (uint32_t)((1L<<GADAMPING)-1);
320
    gyroActivity >>= GADAMPING;
318
    gyroActivity >>= GADAMPING;
321
  }
319
  }
322
}
320
}
323
/*
-
 
324
void dampenGyroActivity(void) {
-
 
325
  if (gyroActivity >= 2000) {
-
 
326
    gyroActivity -= 2000;
-
 
327
  }
-
 
328
}
-
 
329
*/
-
 
Line 330... Line 321...
330
 
321
 
331
void analog_updateGyros(void) {
322
void analog_updateGyros(void) {
332
  // for various filters...
323
  // for various filters...