[adc] Check the adc is done before accessing values

should have already completed by this point anyhow
main-solar-only
Richard Meadows 2016-03-02 14:58:11 +00:00
rodzic 20dfc447a7
commit b5c1a0e347
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -93,8 +93,9 @@ struct tracker_datapoint* collect_data(void)
/**
* ---- Analogue ----
*/
datapoint.battery = get_battery(); /* Will return zero by default */
datapoint.solar = get_solar(); /* Will return zero by default */
while (is_adc_sequence_done() == 0); /* wait for adc */
datapoint.battery = get_battery(); /* will return zero by default */
datapoint.solar = get_solar(); /* will return zero by default */
datapoint.radio_die_temperature = telemetry_si_temperature();
datapoint.thermistor_temperature = thermistor_ratio_to_temperature(get_thermistor());