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); |
} |
} |