mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-21 19:29:18 +00:00
Updated to match the new sensors API
This commit is contained in:
parent
758710cadd
commit
c557f23bf4
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)$Id: contiki-sky-main.c,v 1.9 2009/11/20 10:45:07 nifi Exp $
|
||||
* @(#)$Id: contiki-sky-main.c,v 1.10 2010/01/15 11:02:18 nifi Exp $
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
@ -37,7 +37,10 @@
|
||||
|
||||
#include "contiki.h"
|
||||
|
||||
#include "dev/battery-sensor.h"
|
||||
#include "dev/button-sensor.h"
|
||||
#include "dev/light-sensor.h"
|
||||
#include "dev/sht11-sensor.h"
|
||||
#include "dev/ds2411.h"
|
||||
#include "dev/sht11.h"
|
||||
#include "dev/leds.h"
|
||||
@ -59,7 +62,7 @@
|
||||
|
||||
/*#include "codeprop/codeprop.h"*/
|
||||
|
||||
SENSORS(&button_sensor);
|
||||
SENSORS(&button_sensor, &light_sensor, &battery_sensor, &sht11_sensor);
|
||||
|
||||
extern int lpm_en;
|
||||
|
||||
@ -138,10 +141,9 @@ main(int argc, char **argv)
|
||||
#endif /* WITH_UIP */
|
||||
|
||||
printf("Starting %s "
|
||||
"($Id: contiki-sky-main.c,v 1.9 2009/11/20 10:45:07 nifi Exp $)\n", __FILE__);
|
||||
"($Id: contiki-sky-main.c,v 1.10 2010/01/15 11:02:18 nifi Exp $)\n", __FILE__);
|
||||
ds2411_init();
|
||||
sensors_light_init();
|
||||
sht11_init();
|
||||
|
||||
xmem_init();
|
||||
leds_toggle(LEDS_RED | LEDS_GREEN | LEDS_BLUE);
|
||||
|
||||
@ -172,6 +174,14 @@ main(int argc, char **argv)
|
||||
process_init();
|
||||
process_start(&etimer_process, NULL);
|
||||
process_start(&sensors_process, NULL);
|
||||
|
||||
/*
|
||||
* Initialize light and humidity/temp sensors.
|
||||
*/
|
||||
|
||||
SENSORS_ACTIVATE(light_sensor);
|
||||
SENSORS_ACTIVATE(sht11_sensor);
|
||||
|
||||
ctimer_init();
|
||||
|
||||
set_rime_addr();
|
||||
@ -193,7 +203,7 @@ main(int argc, char **argv)
|
||||
process_start(&slip_process, NULL);
|
||||
#endif /* WITH_UIP */
|
||||
|
||||
button_sensor.activate();
|
||||
SENSORS_ACTIVATE(button_sensor);
|
||||
|
||||
print_processes(autostart_processes);
|
||||
autostart_start(autostart_processes);
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: energest-demo.c,v 1.8 2009/03/12 21:58:21 adamdunkels Exp $
|
||||
* $Id: energest-demo.c,v 1.9 2010/01/15 11:02:18 nifi Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -340,7 +340,7 @@ PROCESS_THREAD(user_process, ev, data)
|
||||
|
||||
printf("Node id %d\n", node_id);
|
||||
|
||||
button_sensor.activate();
|
||||
SENSORS_ACTIVATE(button_sensor);
|
||||
state = RADIO_OFF;
|
||||
|
||||
while(1) {
|
||||
|
Loading…
Reference in New Issue
Block a user