stefan pushed a commit to branch master.

commit 2613394b66d1188139cfdefe3be86202a96bd201
Author: Stefan Schmidt <[email protected]>
Date:   Wed Mar 27 12:03:32 2013 +0000

    eeze/sensor: Create a new sensor object for the async test.
    
    Its a demo so we should do all the steps and create a new object
    instead of re-using the other one.
---
 src/bin/eeze/eeze_sensor_test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bin/eeze/eeze_sensor_test.c b/src/bin/eeze/eeze_sensor_test.c
index 0a1fc94..67dca6c 100644
--- a/src/bin/eeze/eeze_sensor_test.c
+++ b/src/bin/eeze/eeze_sensor_test.c
@@ -136,6 +136,7 @@ main(void)
          if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get 
accuracy\n");
          if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get 
timestamp\n");
          printf("Light output: accuracy %i, lux %f at time: %lli\n", acc, x, 
timestamp);
+         eeze_sensor_free(sens);
      }
    else
      printf("Could not find a light sensor!\n");
@@ -144,6 +145,7 @@ main(void)
     * can force a read out of the physical sensor instead of using the cached
     * values. Depending on the hardware this can take a long time. If you 
don't have special
     * requirements the cached values should be used. */
+   sens = eeze_sensor_new(EEZE_SENSOR_TYPE_LIGHT);
    eeze_sensor_read(sens);
    if (!sens) printf("can't find an light sensor!\n");
    if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n");

-- 

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d

Reply via email to