From fa6c52633fcbca7467fe6b38e61a23bad3a60fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Sj=C3=B6din?= Date: Fri, 28 Oct 2016 01:04:05 +0200 Subject: [PATCH] Use RS232_BAUDRATE to define baudrate from projekt config file. Removed serial initialization from contiki-main.c. It seems to be too soon. --- platform/avr-rss2/contiki-conf.h | 5 +++++ platform/avr-rss2/contiki-main.c | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/platform/avr-rss2/contiki-conf.h b/platform/avr-rss2/contiki-conf.h index e69a0a637..2d3ee1031 100644 --- a/platform/avr-rss2/contiki-conf.h +++ b/platform/avr-rss2/contiki-conf.h @@ -106,6 +106,11 @@ void clock_adjust_ticks(clock_time_t howmany); #define AVR_CONF_USE32KCRYSTAL 1 #define SLIP_PORT RS232_PORT_0 +/* Default baud rare on RS232 port */ +#ifndef RS232_BAUDRATE +#define RS232_BAUDRATE USART_BAUD_38400 +#endif + /* Pre-allocated memory for loadable modules heap space (in bytes)*/ /* Default is 4096. Currently used only when elfloader is present. Not tested on Raven */ /* #define MMEM_CONF_SIZE 256 */ diff --git a/platform/avr-rss2/contiki-main.c b/platform/avr-rss2/contiki-main.c index a872d0cd5..907576d43 100644 --- a/platform/avr-rss2/contiki-main.c +++ b/platform/avr-rss2/contiki-main.c @@ -71,7 +71,6 @@ #include "contiki-lib.h" #include "dev/rs232.h" -#include "dev/serial-line.h" #include "dev/slip.h" #if AVR_WEBSERVER @@ -186,9 +185,8 @@ initialize(void) watchdog_init(); watchdog_start(); leds_init(); - serial_line_init(); - rs232_init(RS232_PORT_0, USART_BAUD_38400, USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8); + rs232_init(RS232_PORT_0, RS232_BAUDRATE, USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8); rs232_redirect_stdout(RS232_PORT_0); #if 0 @@ -198,8 +196,6 @@ initialize(void) //UBRR0L = 3; UBRR0H = 0; UCSR0A = (1 << U2X0); // 500k 0% #endif - rs232_set_input(RS232_PORT_0, serial_line_input_byte); - clock_init(); if(MCUSR & (1 << PORF)) {