Allow selection of slip port

This commit is contained in:
David Kopf 2011-08-25 14:43:18 -04:00
parent 6852c0cb03
commit 9fec648b3e
3 changed files with 22 additions and 11 deletions

View File

@ -78,8 +78,16 @@ unsigned long clock_seconds(void);
/* This has not been tested yet */ /* This has not been tested yet */
#define AVR_CONF_USE32KCRYSTAL 0 #define AVR_CONF_USE32KCRYSTAL 0
/* COM port to be used for SLIP connection. Not tested on Raven */ /* Michael Hartman's protobyte board has LED on PORTE1, can be used for pings and radio on indication */
/* However it requires disabling UART0. */
#define RF230BB_CONF_LEDONPORTE1 1
/* COM port to be used for SLIP connection. This is usually UART0, but see above */
#if RF230BB_CONF_LEDONPORTE1
#define SLIP_PORT RS232_PORT_1
#else
#define SLIP_PORT RS232_PORT_0 #define SLIP_PORT RS232_PORT_0
#endif
/* Pre-allocated memory for loadable modules heap space (in bytes)*/ /* Pre-allocated memory for loadable modules heap space (in bytes)*/
/* Default is 4096. Currently used only when elfloader is present. Not tested on Raven */ /* Default is 4096. Currently used only when elfloader is present. Not tested on Raven */
@ -94,12 +102,11 @@ unsigned long clock_seconds(void);
/* More extensive stats */ /* More extensive stats */
#define ENERGEST_CONF_ON 1 #define ENERGEST_CONF_ON 1
/* Debugflow macro, useful for tracing path through mac and radio interrupts */ /* Possible watchdog timeouts depend on mcu. Default is WDTO_2S. -1 Disables the watchdog. */
#define DEBUGFLOWSIZE 128 //#define WATCHDOG_CONF_TIMEOUT -1
/* Michael Hartman's protobyte board has LED on PORTE1, can be used for pings and radio on indication */ /* Debugflow macro, useful for tracing path through mac and radio interrupts */
/* However it requires disabling UART0. */ //#define DEBUGFLOWSIZE 128
#define RF230BB_CONF_LEDONPORTE1 1
/* Network setup. The new NETSTACK interface requires RF230BB (as does ip4) */ /* Network setup. The new NETSTACK interface requires RF230BB (as does ip4) */
#if RF230BB #if RF230BB
@ -272,6 +279,8 @@ unsigned long clock_seconds(void);
#undef UIP_CONF_UDP_CONNS #undef UIP_CONF_UDP_CONNS
#define UIP_CONF_UDP_CONNS 12 #define UIP_CONF_UDP_CONNS 12
/* For slow slip connections, to prevent buffer overruns */
//#define UIP_CONF_RECEIVE_WINDOW 300
#undef UIP_CONF_FWCACHE_SIZE #undef UIP_CONF_FWCACHE_SIZE
#define UIP_CONF_FWCACHE_SIZE 30 #define UIP_CONF_FWCACHE_SIZE 30
#define UIP_CONF_BROADCAST 1 #define UIP_CONF_BROADCAST 1

View File

@ -103,7 +103,7 @@ uint8_t debugflowsize,debugflow[DEBUGFLOWSIZE];
#define ROUTES 128 #define ROUTES 128
#define STAMPS 30 #define STAMPS 30
#define STACKMONITOR 1024 #define STACKMONITOR 1024
uint16_t clocktime; uint32_t clocktime;
#define TESTRTIMER 0 #define TESTRTIMER 0
#if TESTRTIMER #if TESTRTIMER
uint8_t rtimerflag=1; uint8_t rtimerflag=1;
@ -199,8 +199,10 @@ void initialize(void)
#endif #endif
#endif #endif
/* Second rs232 port for debugging */ /* Second rs232 port for debugging or slip alternative */
rs232_init(RS232_PORT_1, USART_BAUD_57600,USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8); rs232_init(RS232_PORT_1, USART_BAUD_57600,USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8);
// rs232_init(RS232_PORT_1, USART_BAUD_115200,USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8);
/* Redirect stdout to second port */ /* Redirect stdout to second port */
rs232_redirect_stdout(RS232_PORT_1); rs232_redirect_stdout(RS232_PORT_1);
clock_init(); clock_init();
@ -514,9 +516,9 @@ if ((clocktime%STAMPS)==0) {
print_stats(); print_stats();
#elif RADIOSTATS #elif RADIOSTATS
extern volatile unsigned long radioontime; extern volatile unsigned long radioontime;
PRINTA("%u(%u)s ",clocktime,radioontime); PRINTA("%u(%u)s\n",clocktime,radioontime);
#else #else
PRINTA("%us ",clocktime); PRINTA("%us\n",clocktime);
#endif #endif
} }

View File

@ -76,7 +76,7 @@ static FILE slip_stdout = FDEV_SETUP_STREAM(slip_putchar, NULL,
void void
slip_arch_init(unsigned long ubr) slip_arch_init(unsigned long ubr)
{ {
rs232_set_input(RS232_PORT_0, slip_input_byte); rs232_set_input(SLIP_PORT, slip_input_byte);
stdout = &slip_stdout; stdout = &slip_stdout;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/