adc: fix sanity test
Sanity test is disabling the ADC controller before doing a read. Change-Id: I275a94244a13e80c12e6b39267c4a25dd5479002 Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit is contained in:
parent
69b124dab9
commit
dfbf2bfc44
1 changed files with 3 additions and 4 deletions
|
@ -87,24 +87,23 @@ void main(void)
|
||||||
adc = device_get_binding(ADC_DEVICE_NAME);
|
adc = device_get_binding(ADC_DEVICE_NAME);
|
||||||
if (!adc) {
|
if (!adc) {
|
||||||
DBG("Cannot get adc controller\n");
|
DBG("Cannot get adc controller\n");
|
||||||
goto done;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
adc_set_callback(adc, callback);
|
adc_set_callback(adc, callback);
|
||||||
|
|
||||||
adc_enable(adc);
|
adc_enable(adc);
|
||||||
|
|
||||||
adc_disable(adc);
|
|
||||||
|
|
||||||
if (adc_read(adc, &table) != DEV_OK) {
|
if (adc_read(adc, &table) != DEV_OK) {
|
||||||
DBG("Could not call adc_read\n");
|
DBG("Could not call adc_read\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
|
||||||
while (1) {
|
while (1) {
|
||||||
DBG("Waiting...");
|
DBG("Waiting...");
|
||||||
|
|
||||||
nano_task_timer_start(&timer, SLEEPTICKS);
|
nano_task_timer_start(&timer, SLEEPTICKS);
|
||||||
nano_task_timer_wait(&timer);
|
nano_task_timer_wait(&timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
adc_disable(adc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue