The button sensor must be initialized before it is used

This commit is contained in:
adamdunkels 2010-02-03 21:11:33 +00:00
parent 815468b442
commit 5be78ce843

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: example-collect.c,v 1.9 2009/10/18 17:52:08 adamdunkels Exp $
* $Id: example-collect.c,v 1.10 2010/02/03 21:11:33 adamdunkels Exp $
*/
/**
@ -71,11 +71,12 @@ PROCESS_THREAD(example_collect_process, ev, data)
{
PROCESS_BEGIN();
SENSORS_ACTIVATE(button_sensor);
collect_open(&tc, 130, &callbacks);
while(1) {
static struct etimer et;
uint16_t tmp;
/* Send a packet every 16 seconds; first wait 8 seconds, than a
random time between 0 and 8 seconds. */