remove unneeded code

This commit is contained in:
Harald Pichler 2016-10-28 11:43:55 +02:00
parent 17520dc4e0
commit 0556557d8b

View file

@ -56,7 +56,6 @@
#include "adc.h" #include "adc.h"
#include "hw-arduino.h" #include "hw-arduino.h"
#include "contiki.h" #include "contiki.h"
#include "net/netstack.h"
#define DEBUG 0 #define DEBUG 0
#if DEBUG #if DEBUG
@ -111,26 +110,21 @@ PROCESS(arduino_sketch, "Arduino Sketch Wrapper");
#define LOOP_INTERVAL (1 * CLOCK_SECOND) #define LOOP_INTERVAL (1 * CLOCK_SECOND)
#endif #endif
#ifndef SLEEP_NETWORK_INTERVAL
#define SLEEP_NETWORK_INTERVAL (60 * CLOCK_SECOND)
#endif
PROCESS_THREAD(arduino_sketch, ev, data) PROCESS_THREAD(arduino_sketch, ev, data)
{ {
static struct etimer loop_periodic_timer; static struct etimer loop_periodic_timer;
static struct etimer network_off_periodic_timer;
PROCESS_BEGIN(); PROCESS_BEGIN();
adc_init (); adc_init ();
mcu_sleep_init (); mcu_sleep_init ();
setup (); setup ();
/* Define application-specific events here. */ /* Define application-specific events here. */
etimer_set(&loop_periodic_timer, LOOP_INTERVAL); etimer_set(&loop_periodic_timer, LOOP_INTERVAL);
etimer_set(&network_off_periodic_timer, SLEEP_NETWORK_INTERVAL);
while (1) { while (1) {
PROCESS_WAIT_EVENT(); PROCESS_WAIT_EVENT();
#if PLATFORM_HAS_BUTTON #if PLATFORM_HAS_BUTTON
if(ev == sensors_event && data == &button_sensor) { if(ev == sensors_event && data == &button_sensor) {
NETSTACK_MAC.off(1);
mcu_sleep_off(); mcu_sleep_off();
PRINTF("*******BUTTON*******\n"); PRINTF("*******BUTTON*******\n");
@ -143,11 +137,6 @@ PROCESS_THREAD(arduino_sketch, ev, data)
} }
#endif /* PLATFORM_HAS_BUTTON */ #endif /* PLATFORM_HAS_BUTTON */
if(etimer_expired(&network_off_periodic_timer)) {
// NETSTACK_MAC.off(0);
NETSTACK_MAC.on();
etimer_reset(&network_off_periodic_timer);
}
if(etimer_expired(&loop_periodic_timer)) { if(etimer_expired(&loop_periodic_timer)) {
mcu_sleep_off(); mcu_sleep_off();
loop (); loop ();
@ -158,7 +147,6 @@ PROCESS_THREAD(arduino_sketch, ev, data)
PROCESS_END(); PROCESS_END();
} }
/* /*
* VI settings, see coding style * VI settings, see coding style
* ex:ts=8:et:sw=2 * ex:ts=8:et:sw=2