From 777cc888720906983b678a592547f6f665d5ea86 Mon Sep 17 00:00:00 2001 From: David Kopf Date: Sun, 8 Jan 2012 13:33:40 -0500 Subject: [PATCH] Add 921600 baud to slip options, fix compiler warnings --- examples/ipv6/native-border-router/border-router-rdc.c | 2 +- examples/ipv6/native-border-router/border-router.h | 1 + examples/ipv6/native-border-router/slip-config.c | 5 ++++- examples/ipv6/slip-radio/slip-radio.c | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/ipv6/native-border-router/border-router-rdc.c b/examples/ipv6/native-border-router/border-router-rdc.c index 273926b84..5e4540714 100644 --- a/examples/ipv6/native-border-router/border-router-rdc.c +++ b/examples/ipv6/native-border-router/border-router-rdc.c @@ -75,7 +75,7 @@ void packet_sent(uint8_t sessionid, uint8_t status, uint8_t tx) packetbuf_attr_copyfrom(callback->attrs, callback->addrs); mac_call_sent_callback(callback->cback, callback->ptr, status, tx); } else { - printf("*** ERROR: too high session id %d\n", sessionid); + PRINTF("*** ERROR: too high session id %d\n", sessionid); } } /*---------------------------------------------------------------------------*/ diff --git a/examples/ipv6/native-border-router/border-router.h b/examples/ipv6/native-border-router/border-router.h index d2e42769a..b6a2f2ab2 100644 --- a/examples/ipv6/native-border-router/border-router.h +++ b/examples/ipv6/native-border-router/border-router.h @@ -39,6 +39,7 @@ #include "contiki.h" #include "net/uip.h" +#include int border_router_cmd_handler(const uint8_t *data, int len); int slip_config_handle_arguments(int argc, char **argv); diff --git a/examples/ipv6/native-border-router/slip-config.c b/examples/ipv6/native-border-router/slip-config.c index 452d23d35..f36493eab 100644 --- a/examples/ipv6/native-border-router/slip-config.c +++ b/examples/ipv6/native-border-router/slip-config.c @@ -117,7 +117,7 @@ slip_config_handle_arguments(int argc, char **argv) fprintf(stderr,"usage: %s [options] ipaddress\n", prog); fprintf(stderr,"example: border-router.native -L -v2 -s ttyUSB1 aaaa::1/64\n"); fprintf(stderr,"Options are:\n"); -fprintf(stderr," -B baudrate 9600,19200,38400,57600,115200 (default)\n"); +fprintf(stderr," -B baudrate 9600,19200,38400,57600,115200,921600 (default 115200)\n"); fprintf(stderr," -H Hardware CTS/RTS flow control (default disabled)\n"); fprintf(stderr," -L Log output format (adds time stamps)\n"); fprintf(stderr," -s siodev Serial device (default /dev/ttyUSB0)\n"); @@ -163,6 +163,9 @@ exit(1); case 115200: slip_config_b_rate = B115200; break; + case 921600: + slip_config_b_rate = B921600; + break; default: err(1, "unknown baudrate %d", baudrate); break; diff --git a/examples/ipv6/slip-radio/slip-radio.c b/examples/ipv6/slip-radio/slip-radio.c index 7013c434b..c034d8964 100644 --- a/examples/ipv6/slip-radio/slip-radio.c +++ b/examples/ipv6/slip-radio/slip-radio.c @@ -156,6 +156,9 @@ slip_input_callback(void) static void init(void) { +#ifndef BAUD2UBR +#define BAUD2UBR(baud) baud +#endif slip_arch_init(BAUD2UBR(115200)); process_start(&slip_process, NULL); slip_set_input_callback(slip_input_callback);