fix and enhance example

This commit is contained in:
lilian 2016-12-29 12:00:31 +01:00
parent 70e2158102
commit d537d85879

View file

@ -72,12 +72,13 @@ void ina_measure(void *pvParameters)
#if !MODE
if (ina3221_trigger(&dev)) // Start a measure
goto error_loop;
printf("trig done, wait: ");
do
{
printf("measure not ready");
printf("X");
if (ina3221_getStatus(&dev)) // get mask
goto error_loop;
vTaskDelay(100/portTICK_PERIOD_MS);
vTaskDelay(20/portTICK_PERIOD_MS);
if(dev.mask.wf&(1<<(3-WARNING_CHANNEL)))
warning = true ;
} while(!(dev.mask.cvrf)); // check if measure done