diff --git a/cpu/pic32/clock.c b/cpu/pic32/clock.c index b0f63df4d..1704467ba 100644 --- a/cpu/pic32/clock.c +++ b/cpu/pic32/clock.c @@ -67,7 +67,7 @@ clock_callback(void) ++ticks; if(etimer_pending()) { - etimer_request_poll(); + etimer_request_poll(); } #if (CLOCK_CONF_SECOND & (CLOCK_CONF_SECOND - 1)) != 0 @@ -98,15 +98,29 @@ clock_set_seconds(unsigned long sec) seconds = sec; } /*---------------------------------------------------------------------------*/ -void -clock_init(void) -{ - ticks = 0; - seconds = 0; - pic32_timer1_init(CLOCK_SECOND); - pic32_timer1_enable_irq(); - pic32_timer1_start(); +#define CLOCK_INIT(XX) \ +void \ +clock_init(void) \ +{ \ + ticks = 0; \ + seconds = 0; \ + pic32_timer##XX##_init(CLOCK_SECOND);\ + pic32_timer##XX##_enable_irq(); \ + pic32_timer##XX##_start(); \ } + +#if PIC32_TIMER_CLOCK == 1 +CLOCK_INIT(1) +#elif PIC32_TIMER_CLOCK == 2 +CLOCK_INIT(2) +#elif PIC32_TIMER_CLOCK == 3 +CLOCK_INIT(3) +#elif PIC32_TIMER_CLOCK == 4 +CLOCK_INIT(4) +#elif PIC32_TIMER_CLOCK == 5 +CLOCK_INIT(5) +#endif + /*---------------------------------------------------------------------------*/ void clock_delay_usec(uint16_t dt) @@ -139,6 +153,16 @@ clock_delay(unsigned int delay) } /*---------------------------------------------------------------------------*/ +#if PIC32_TIMER_CLOCK == 1 TIMER_INTERRUPT(1, clock_callback); +#elif PIC32_TIMER_CLOCK == 2 +TIMER_INTERRUPT(2, clock_callback); +#elif PIC32_TIMER_CLOCK == 3 +TIMER_INTERRUPT(3, clock_callback); +#elif PIC32_TIMER_CLOCK == 4 +TIMER_INTERRUPT(4, clock_callback); +#elif PIC32_TIMER_CLOCK == 5 +TIMER_INTERRUPT(5, clock_callback); +#endif /** @} */ diff --git a/cpu/pic32/debug-uart.c b/cpu/pic32/debug-uart.c index 16c9e03cd..c2784e119 100644 --- a/cpu/pic32/debug-uart.c +++ b/cpu/pic32/debug-uart.c @@ -54,7 +54,7 @@ #include -#define DEBUG 1 +#define DEBUG 0 #if DEBUG #include #define PRINTF(...) printf(__VA_ARGS__) @@ -62,7 +62,7 @@ #define PRINTF(...) #endif -#define DEBUG_UART(XX) \ +#define DEBUG_UART(XX, YY) \ void \ _mon_putc(char c) \ { \ @@ -77,20 +77,20 @@ PRINTF("Initializing debug uart: %lubps\n", ubr); \ } \ \ - UART_INTERRUPT(XX, 2, pic32_uart##XX##_write); + UART_INTERRUPT(XX, YY, pic32_uart##XX##_write); #ifdef __USE_UART_PORT1A_FOR_DEBUG__ -DEBUG_UART(1A); +DEBUG_UART(1A, 0); #elif defined __USE_UART_PORT1B_FOR_DEBUG__ -DEBUG_UART(1B); +DEBUG_UART(1B, 2); #elif defined __USE_UART_PORT2A_FOR_DEBUG__ -DEBUG_UART(2A); +DEBUG_UART(2A, 1); #elif defined __USE_UART_PORT2B_FOR_DEBUG__ -DEBUG_UART(2B); +DEBUG_UART(2B, 2); #elif defined __USE_UART_PORT3A_FOR_DEBUG__ -DEBUG_UART(3A); +DEBUG_UART(3A, 1); #elif defined __USE_UART_PORT3B_FOR_DEBUG__ -DEBUG_UART(3B); +DEBUG_UART(3B, 2); #else DEBUG_UART(1A); #endif diff --git a/cpu/pic32/lib/pic32_timer.h b/cpu/pic32/lib/pic32_timer.h index bdb0f9b4f..7e44140ef 100644 --- a/cpu/pic32/lib/pic32_timer.h +++ b/cpu/pic32/lib/pic32_timer.h @@ -99,13 +99,13 @@ void pic32_timer##XY##_stop(void); \ uint32_t pic32_timer##XY##_get_val(void); -#define TIMER_INTERRUPT(XX, CALLBACK) \ - TIMER_ISR(_TIMER_##XX##_VECTOR) \ - { \ - ENERGEST_ON(ENERGEST_TYPE_IRQ); \ - CALLBACK(); \ - ENERGEST_OFF(ENERGEST_TYPE_IRQ); \ - IFS0CLR = _IFS0_T##XX##IF_MASK; \ +#define TIMER_INTERRUPT(XX, CALLBACK) \ + TIMER_ISR(_TIMER_##XX##_VECTOR) \ + { \ + ENERGEST_ON(ENERGEST_TYPE_IRQ); \ + CALLBACK(); \ + ENERGEST_OFF(ENERGEST_TYPE_IRQ); \ + IFS0CLR = _IFS0_T##XX##IF_MASK; \ } #ifdef __USE_TIMER_1__ diff --git a/cpu/pic32/lib/pic32_uart.c b/cpu/pic32/lib/pic32_uart.c index c011b4251..5e34f07f7 100644 --- a/cpu/pic32/lib/pic32_uart.c +++ b/cpu/pic32/lib/pic32_uart.c @@ -76,7 +76,8 @@ #include #include "contiki.h" -#include "lib/ringbuf.h" + +#include "dev/leds.h" /*---------------------------------------------------------------------------*/ #define UART_PORT_INIT_XA(XX, YY, ZZ) \ @@ -84,7 +85,7 @@ pic32_uart##XX##A_init(uint32_t baudrate, uint16_t byte_format) \ { \ /* Disable Interrupts: RX, TX, ERR */ \ - IEC##ZZ##CLR = _IEC##ZZ##_U##XX##ARXIE_MASK; \ + IEC##ZZ##CLR = _IEC##ZZ##_U##XX##AEIE_MASK | _IEC##ZZ##_U##XX##ATXIE_MASK | _IEC##ZZ##_U##XX##ARXIE_MASK; \ IFS##ZZ##CLR = _IFS##ZZ##_U##XX##AEIF_MASK | _IFS##ZZ##_U##XX##ATXIF_MASK | _IFS##ZZ##_U##XX##ARXIF_MASK; \ \ /* Clear thant Set Pri and Sub priority */ \ @@ -101,8 +102,8 @@ U##XX##AMODESET = byte_format & 0x07; /* Number of bit, Parity and Stop bits */ \ \ /* Status bits */ \ - U##XX##ASTA = 0; /* TX & RX interrupt modes */ \ - U##XX##ASTASET = _U##XX##ASTA_UTXEN_MASK | _U##XX##ASTA_URXEN_MASK; /* Enable TX, RX */ \ + U##XX##ASTA = 0; \ + U##XX##ASTASET = _U##XX##ASTA_URXEN_MASK | _U##XX##ASTA_UTXEN_MASK; /* Enable RX and TX */ \ \ IEC##ZZ##SET = _IEC##ZZ##_U##XX##ARXIE_MASK; \ \ @@ -117,7 +118,7 @@ pic32_uart##XX##B_init(uint32_t baudrate, uint16_t byte_format) \ { \ /* Disable Interrupts: RX, TX, ERR */ \ - IEC##ZZ##CLR = _IEC##ZZ##_U##XX##BRXIE_MASK; \ + IEC##ZZ##CLR = _IEC##ZZ##_U##XX##BEIE_MASK | _IEC##ZZ##_U##XX##BTXIE_MASK | _IEC##ZZ##_U##XX##BRXIE_MASK; \ IFS##ZZ##CLR = _IFS##ZZ##_U##XX##BEIF_MASK | _IFS##ZZ##_U##XX##BTXIF_MASK | _IFS##ZZ##_U##XX##BRXIF_MASK; \ \ /* Clear thant Set Pri and Sub priority */ \ @@ -134,8 +135,8 @@ U##XX##BMODESET = byte_format & 0x07; /* Number of bit, Parity and Stop bits */ \ \ /* Status bits */ \ - U##XX##BSTA = 0; /* TX & RX interrupt modes */ \ - U##XX##BSTASET = _U##XX##BSTA_UTXEN_MASK | _U##XX##BSTA_URXEN_MASK; /* Enable TX, RX */ \ + U##XX##BSTA = 0; \ + U##XX##BSTASET = _U##XX##BSTA_URXEN_MASK | _U##XX##BSTA_UTXEN_MASK; /* Enable RX and TX */ \ \ IEC##ZZ##SET = _IEC##ZZ##_U##XX##BRXIE_MASK; \ \ @@ -150,9 +151,13 @@ int8_t \ pic32_uart##XX##_write(uint8_t data) \ { \ - while(U##XX##STAbits.UTXBF); \ + volatile uint8_t wait; \ + \ + do { \ + wait = U##XX##STAbits.UTXBF; \ + } while(wait); \ + \ U##XX##TXREG = data; \ - while(!U##XX##STAbits.TRMT); \ \ return UART_NO_ERROR; \ } diff --git a/cpu/pic32/lib/pic32_uart.h b/cpu/pic32/lib/pic32_uart.h index a6f495a68..ec062c138 100644 --- a/cpu/pic32/lib/pic32_uart.h +++ b/cpu/pic32/lib/pic32_uart.h @@ -66,6 +66,8 @@ #include +#include "dev/leds.h" + #define BAUD2UBR(x) x /* Returned Messages */ @@ -77,21 +79,21 @@ int8_t pic32_uart##XX##_init(uint32_t baudrate, uint16_t byte_format); \ int8_t pic32_uart##XX##_write(uint8_t data); -#define UART_INTERRUPT(XX, Y, CALLBACK) \ - ISR(_UART_##XX##_VECTOR) \ - { \ - volatile uint8_t byte; \ - if(IFS##Y##bits.U##XX##RXIF) { \ - if((U##XX##STAbits.PERR == 0) && (U##XX##STAbits.FERR == 0)) { \ - CALLBACK(U##XX##RXREG); \ - } else { \ - byte = U##XX##RXREG; /* NULL READ */ \ - } \ - IFS##Y##CLR = _IFS##Y##_U##XX##RXIF_MASK; \ - } \ - if(U##XX##STAbits.OERR) { \ - U##XX##STACLR = _U##XX##STA_OERR_MASK; \ - } \ +#define UART_INTERRUPT(XX, YY, CALLBACK) \ + ISR(_UART_##XX##_VECTOR) \ + { \ + volatile uint8_t byte; \ + if(IFS##YY##bits.U##XX##RXIF) { \ + if((U##XX##STAbits.PERR == 0) && (U##XX##STAbits.FERR == 0)) { \ + CALLBACK(U##XX##RXREG); \ + } else { \ + byte = U##XX##RXREG; /* NULL READ */ \ + } \ + IFS##YY##CLR = _IFS##YY##_U##XX##RXIF_MASK; \ + } \ + if(U##XX##STAbits.OERR) { \ + U##XX##STACLR = _U##XX##STA_OERR_MASK; \ + } \ } #ifdef __USE_UART_PORT1A__ diff --git a/cpu/pic32/slip-uart.c b/cpu/pic32/slip-uart.c index 3354c0905..65a18dbe8 100644 --- a/cpu/pic32/slip-uart.c +++ b/cpu/pic32/slip-uart.c @@ -60,7 +60,7 @@ #define PRINTF(...) #endif -#define SLIP_UART(XX) \ +#define SLIP_UART(XX, YY) \ void \ slip_arch_writeb(unsigned char c) \ { \ @@ -75,20 +75,20 @@ PRINTF("Initializing slip uart: %lubps\n", ubr); \ } \ \ - UART_INTERRUPT(XX, 0, slip_input_byte); + UART_INTERRUPT(XX, YY, slip_input_byte); #ifdef __USE_UART_PORT1A_FOR_SLIP__ -SLIP_UART(1A); +SLIP_UART(1A, 0); #elif defined __USE_UART_PORT1B_FOR_SLIP__ -SLIP_UART(1B); +SLIP_UART(1B, 2); #elif defined __USE_UART_PORT2A_FOR_SLIP__ -SLIP_UART(2A); +SLIP_UART(2A, 1); #elif defined __USE_UART_PORT2B_FOR_SLIP__ -SLIP_UART(2B); +SLIP_UART(2B, 2); #elif defined __USE_UART_PORT3A_FOR_SLIP__ -SLIP_UART(3A); +SLIP_UART(3A, 1); #elif defined __USE_UART_PORT3B_FOR_SLIP__ -SLIP_UART(3B); +SLIP_UART(3B, 2); #else SLIP_UART(1A); #endif diff --git a/examples/seedeye/powerswitch/Makefile b/examples/seedeye/powerswitch/Makefile new file mode 100644 index 000000000..da5e2d82f --- /dev/null +++ b/examples/seedeye/powerswitch/Makefile @@ -0,0 +1,54 @@ +ifndef TARGET +TARGET=seedeye +endif + +all: remotepowerswitch + +CONTIKI=../../../ +CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" + +# variable for root Makefile.include +WITH_UIP6=1 +# for some platforms +UIP_CONF_IPV6=1 + +WITH_COAP=13 + +UIP_CONF_RPL=1 + +# REST framework, requires WITH_COAP +ifeq ($(WITH_COAP), 13) +${info INFO: compiling with CoAP-13} +CFLAGS += -DWITH_COAP=13 +CFLAGS += -DREST=coap_rest_implementation +CFLAGS += -DUIP_CONF_TCP=0 +APPS += er-coap-13 +else ifeq ($(WITH_COAP), 12) +${info INFO: compiling with CoAP-12} +CFLAGS += -DWITH_COAP=12 +CFLAGS += -DREST=coap_rest_implementation +CFLAGS += -DUIP_CONF_TCP=0 +APPS += er-coap-12 +else ifeq ($(WITH_COAP), 7) +${info INFO: compiling with CoAP-08} +CFLAGS += -DWITH_COAP=7 +CFLAGS += -DREST=coap_rest_implementation +CFLAGS += -DUIP_CONF_TCP=0 +APPS += er-coap-07 +else ifeq ($(WITH_COAP), 3) +${info INFO: compiling with CoAP-03} +CFLAGS += -DWITH_COAP=3 +CFLAGS += -DREST=coap_rest_implementation +CFLAGS += -DUIP_CONF_TCP=0 +APPS += er-coap-03 +else +${info INFO: compiling with HTTP} +CFLAGS += -DWITH_HTTP +CFLAGS += -DREST=http_rest_implementation +CFLAGS += -DUIP_CONF_TCP=1 +APPS += er-http-engine +endif + +APPS += erbium + +include $(CONTIKI)/Makefile.include diff --git a/examples/seedeye/powerswitch/project-conf.h b/examples/seedeye/powerswitch/project-conf.h new file mode 100644 index 000000000..0d0b87eb5 --- /dev/null +++ b/examples/seedeye/powerswitch/project-conf.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * + */ + +#ifndef __PROJECT_RPL_WEB_CONF_H__ +#define __PROJECT_RPL_WEB_CONF_H__ + +#define SICSLOWPAN_CONF_FRAG 1 + +/* Increase rpl-border-router IP-buffer when using 128. */ +#ifndef REST_MAX_CHUNK_SIZE +#define REST_MAX_CHUNK_SIZE 64 +#endif + +/* Multiplies with chunk size, be aware of memory constraints. */ +#ifndef COAP_MAX_OPEN_TRANSACTIONS +#define COAP_MAX_OPEN_TRANSACTIONS 2 +#endif + +/* Must be <= open transaction number. */ +#ifndef COAP_MAX_OBSERVERS +#define COAP_MAX_OBSERVERS COAP_MAX_OPEN_TRANSACTIONS-1 +#endif + +#endif /* __PROJECT_RPL_WEB_CONF_H__ */ diff --git a/examples/seedeye/powerswitch/remotepowerswitch.c b/examples/seedeye/powerswitch/remotepowerswitch.c new file mode 100644 index 000000000..3bcfb10f3 --- /dev/null +++ b/examples/seedeye/powerswitch/remotepowerswitch.c @@ -0,0 +1,95 @@ +/* + * Remote Power Switch Example for the Seed-Eye Board + * Copyright (c) 2013, Giovanni Pellerano + * + * Ownership: Scuola Superiore Sant'Anna (http://www.sssup.it) and + * Consorzio Nazionale Interuniversitario per le Telecomunicazioni + * (http://www.cnit.it). + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/** + * \addtogroup Remote Power Switch Example for the Seed-Eye Board + * + * @{ + */ + +/** + * \file remotepowerswitch.c + * \brief Remote Power Switch Example for the Seed-Eye Board + * \author Giovanni Pellerano + * \date 2013-01-24 + */ + + +#include +#include +#include + +#include "contiki.h" +#include "contiki-net.h" + +#include "erbium.h" + +#include "dev/leds.h" + +#include + +RESOURCE(toggle, METHOD_GET | METHOD_PUT | METHOD_POST, "actuators/powerswitch", "title=\"Red LED\";rt=\"Control\""); +void +toggle_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset) +{ + leds_toggle(LEDS_RED); + + PORTEbits.RE0 = !PORTEbits.RE0; +} + +PROCESS(remote_power_switch, "Remote Power Switch"); + +AUTOSTART_PROCESSES(&remote_power_switch); + +PROCESS_THREAD(remote_power_switch, ev, data) +{ + PROCESS_BEGIN(); + + rest_init_engine(); + + TRISEbits.TRISE0 = 0; + PORTEbits.RE0 = 0; + + rest_activate_resource(&resource_toggle); + + while(1) { + PROCESS_WAIT_EVENT(); + } + + PROCESS_END(); +} + +/** @} */ diff --git a/platform/seedeye/Makefile.seedeye b/platform/seedeye/Makefile.seedeye index 988e54a07..8b6a3f732 100644 --- a/platform/seedeye/Makefile.seedeye +++ b/platform/seedeye/Makefile.seedeye @@ -14,8 +14,36 @@ CONTIKI_TARGET_DIRS = . dev dev/mrf24j40 apps net CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o} CONTIKI_PLAT_DEFS += -D __USE_TIMER__ -CONTIKI_PLAT_DEFS += -D __USE_TIMER_1__ -CONTIKI_PLAT_DEFS += -D __USE_TIMER_23__ + +ifndef PIC32_TIMER_CLOCK +CONTIKI_PLAT_DEFS += -D __USE_TIMER_1__ -D PIC32_TIMER_CLOCK=1 +endif +ifeq ($(PIC32_TIMER_CLOCK),1) +CONTIKI_PLAT_DEFS += -D __USE_TIMER_1__ -D PIC32_TIMER_CLOCK=1 +endif +ifeq ($(PIC32_TIMER_CLOCK),2) +CONTIKI_PLAT_DEFS += -D __USE_TIMER_2__ -D PIC32_TIMER_CLOCK=2 +endif +ifeq ($(PIC32_TIMER_CLOCK),3) +CONTIKI_PLAT_DEFS += -D __USE_TIMER_3__ -D PIC32_TIMER_CLOCK=3 +endif +ifeq ($(PIC32_TIMER_CLOCK),4) +CONTIKI_PLAT_DEFS += -D __USE_TIMER_4__ -D PIC32_TIMER_CLOCK=4 +endif +ifeq ($(PIC32_TIMER_CLOCK),5) +CONTIKI_PLAT_DEFS += -D __USE_TIMER_5__ -D PIC32_TIMER_CLOCK=5 +endif + +ifndef PIC32_TIMER_RTIMER +CONTIKI_PLAT_DEFS += -D __USE_TIMER_23__ -D PIC32_TIMER_RTIMER=23 +endif +ifeq ($(PIC32_TIMER_RTIMER),23) +CONTIKI_PLAT_DEFS += -D __USE_TIMER_23__ -D PIC32_TIMER_RTIMER=23 +endif +ifeq ($(PIC32_TIMER_RTIMER),45) +CONTIKI_PLAT_DEFS += -D __USE_TIMER_45__ -D PIC32_TIMER_RTIMER=45 +endif + CONTIKI_PLAT_DEFS += -D __USE_UART__ CONTIKI_PLAT_DEFS += -D __USE_UART_PORT1A__ CONTIKI_PLAT_DEFS += -D __USE_UART_PORT1B__ diff --git a/platform/seedeye/contiki-conf.h b/platform/seedeye/contiki-conf.h index ceaff1cd6..80ca80947 100644 --- a/platform/seedeye/contiki-conf.h +++ b/platform/seedeye/contiki-conf.h @@ -104,6 +104,8 @@ typedef uint32_t rtimer_clock_t; #define UIP_CONF_ND6_RETRANS_TIMER 10000 +#define UIP_CONF_BUFFER_SIZE 240 + #ifndef QUEUEBUF_CONF_NUM #define QUEUEBUF_CONF_NUM 16 #endif /* QUEUEBUF_CONF_NUM */ diff --git a/platform/seedeye/contiki-seedeye-main.c b/platform/seedeye/contiki-seedeye-main.c index e1ec4c220..04e55a335 100644 --- a/platform/seedeye/contiki-seedeye-main.c +++ b/platform/seedeye/contiki-seedeye-main.c @@ -115,10 +115,10 @@ main(int argc, char **argv) dbg_setup_uart(UART_DEBUG_BAUDRATE); PRINTF("Initialising Node: %d\n", SEEDEYE_ID); - - printf("CPU Clock: %uMhz\n", pic32_clock_get_system_clock() / 1000000); - printf("Peripheral Clock: %uMhz\n", pic32_clock_get_peripheral_clock() / 1000000); - + + PRINTF("CPU Clock: %uMhz\n", pic32_clock_get_system_clock() / 1000000); + PRINTF("Peripheral Clock: %uMhz\n", pic32_clock_get_peripheral_clock() / 1000000); + random_init(SEEDEYE_ID); process_init(); diff --git a/platform/seedeye/platform-conf.h b/platform/seedeye/platform-conf.h index 37a3b90d1..d78fc51e1 100644 --- a/platform/seedeye/platform-conf.h +++ b/platform/seedeye/platform-conf.h @@ -7,7 +7,7 @@ * (http://www.cnit.it). * * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -51,8 +51,8 @@ #define MRF24J40_PAN_COORDINATOR #endif /* SEEDEYE_ID == 1 */ -#define UART_DEBUG_BAUDRATE 230400 -#define UART_SLIP_BAUDRATE 230400 +#define UART_DEBUG_BAUDRATE 115200 +#define UART_SLIP_BAUDRATE 115200 #define PLATFORM_HAS_BATTERY 1 #define PLATFORM_HAS_BUTTON 1