Use RS232_BAUDRATE to define baudrate from projekt config file.

Removed serial initialization from contiki-main.c. It seems to be
too soon.
This commit is contained in:
Peter Sjödin 2016-10-28 01:04:05 +02:00 committed by Robert Olsson
parent 9e5aed5df6
commit fa6c52633f
2 changed files with 6 additions and 5 deletions

View File

@ -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 */

View File

@ -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)) {