From 2613394b66d1188139cfdefe3be86202a96bd201 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Wed, 27 Mar 2013 12:03:32 +0000 Subject: [PATCH] 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 0a1fc949ed..67dca6c236 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, ×tamp)) 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");