Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2014 → Rev 2015

/branches/dongfang_FC_rewrite/timer0.c
213,13 → 213,18
}
 
// -----------------------------------------------------------------------
void delay_ms_with_adc_measurement(uint16_t w) {
void delay_ms_with_adc_measurement(uint16_t w, uint8_t stop) {
uint16_t t_stop;
t_stop = setDelay(w);
while (!checkDelay(t_stop)) {
if (analogDataReady) {
analog_update();
startAnalogConversionCycle();
}
if (analogDataReady) {
analog_update();
startAnalogConversionCycle();
}
}
if (stop) {
// Wait for new samples to get prepared but do not restart AD conversion after that!
// Caller MUST to that.
while (!analogDataReady);
}
}