diff --git a/platform/osd-er-lp24/Makefile.osd-er-lp24 b/platform/osd-er-lp24/Makefile.osd-er-lp24 index dc7bdce5d..ded157f14 100644 --- a/platform/osd-er-lp24/Makefile.osd-er-lp24 +++ b/platform/osd-er-lp24/Makefile.osd-er-lp24 @@ -4,13 +4,17 @@ CONTIKI_CORE=contiki-main CONTIKI_TARGET_MAIN = ${CONTIKI_CORE}.o CONTIKI_TARGET_SOURCEFILES += contiki-main.c params.c node-id.c #Needed for slip -CONTIKI_TARGET_SOURCEFILES += temperature-sensor.c adc.c button-sensor.c sensors.c slip_uart0.c slip.c +CONTIKI_TARGET_SOURCEFILES += temperature-sensor.c adc.c led.c sensors.c slip_uart0.c slip.c +#Needed for Button +CONTIKI_TARGET_SOURCEFILES += button-sensor.c #Needed for DHT11 humidity sensor CONTIKI_TARGET_SOURCEFILES += dht11.c #Needed for DS18S20 temperature sensor CONTIKI_TARGET_SOURCEFILES += ds1820.c #Needed for Battery test CONTIKI_TARGET_SOURCEFILES += battery-sensor.c +#Needed for PIR +CONTIKI_TARGET_SOURCEFILES += pir-sensor.c CONTIKIAVR=$(CONTIKI)/cpu/avr CONTIKIBOARD=. BOOTLOADER_START = 0x1F000 diff --git a/platform/osd-er-lp24/contiki-conf.h b/platform/osd-er-lp24/contiki-conf.h index 8a4d0efa6..d99a965e2 100644 --- a/platform/osd-er-lp24/contiki-conf.h +++ b/platform/osd-er-lp24/contiki-conf.h @@ -146,7 +146,7 @@ typedef unsigned short uip_stats_t; #define RIMEADDR_CONF_SIZE 8 #define UIP_CONF_ICMP6 1 #define UIP_CONF_UDP 1 -#define UIP_CONF_TCP 1 +#define UIP_CONF_TCP 0 #define NETSTACK_CONF_NETWORK sicslowpan_driver #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06 #else diff --git a/platform/osd-er-lp24/contiki-main.c b/platform/osd-er-lp24/contiki-main.c index bdc494b80..cfc83a0f0 100644 --- a/platform/osd-er-lp24/contiki-main.c +++ b/platform/osd-er-lp24/contiki-main.c @@ -144,6 +144,11 @@ FUSES ={.low = 0xF6, .high = 0x98, .extended = 0xfd,}; FUSES ={.low = 0xC2, .high = 0x99, .extended = 0xfe,}; #endif +#include "lib/sensors.h" +#include "dev/button-sensor.h" +#include "dev/pir-sensor.h" +SENSORS(&button_sensor, &pir_sensor); + uint8_t rng_get_uint8(void) { #if 1 @@ -314,6 +319,8 @@ uint8_t i; #ifdef RAVEN_LCD_INTERFACE process_start(&raven_lcd_process, NULL); #endif + + process_start(&sensors_process, NULL); /* Autostart other processes */ autostart_start(autostart_processes); diff --git a/platform/osd-er-lp24/dev/button-sensor.c b/platform/osd-er-lp24/dev/button-sensor.c index 98339ab28..505eda9c9 100644 --- a/platform/osd-er-lp24/dev/button-sensor.c +++ b/platform/osd-er-lp24/dev/button-sensor.c @@ -14,12 +14,12 @@ static int enabled = 0; struct sensors_sensor *sensors[1]; unsigned char sensors_flags[1]; -#define BUTTON_BIT INTF6 +#define BUTTON_BIT INTF5 #define BUTTON_CHECK_IRQ() (EIFR & BUTTON_BIT) ? 0 : 1 #define PRINTF(...) printf(__VA_ARGS__) /*---------------------------------------------------------------------------*/ -ISR(INT6_vect) +ISR(INT5_vect) { // leds_toggle(LEDS_YELLOW); @@ -39,7 +39,7 @@ ISR(INT6_vect) static int value(int type) { - return (PORTE & _BV(PE6) ? 0 : 1) || !timer_expired(&debouncetimer); + return (PORTE & _BV(PE5) ? 0 : 1) || !timer_expired(&debouncetimer); //return 0; } @@ -54,10 +54,10 @@ configure(int type, int c) led1_on(); timer_set(&debouncetimer, 0); PRINTF("Setup sensor started\n"); - DDRE |= (0<