mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 17:31:13 +03:00
pulsensor: updated example and fixed variable in new API
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
@ -28,7 +28,6 @@
|
||||
#include <signal.h>
|
||||
|
||||
int doWork = 0;
|
||||
pulsensor_context sensor_ctx;
|
||||
|
||||
void
|
||||
sig_handler(int signo)
|
||||
@ -49,13 +48,13 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
//! [Interesting]
|
||||
init_pulsensor (&sensor_ctx, handler);
|
||||
Pulsensor *sensor = new Pulsensor(handler);
|
||||
|
||||
start_sampler (&sensor_ctx);
|
||||
sensor->start_sampler();
|
||||
while (!doWork) {
|
||||
usleep (5);
|
||||
}
|
||||
stop_sampler (&sensor_ctx);
|
||||
sensor->stop_sampler();
|
||||
//! [Interesting]
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user