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 */
#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
#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 */
@ -94,12 +102,11 @@ unsigned long clock_seconds(void);
/* More extensive stats */
#define ENERGEST_CONF_ON 1
/* Debugflow macro, useful for tracing path through mac and radio interrupts */
#define DEBUGFLOWSIZE 128
/* Possible watchdog timeouts depend on mcu. Default is WDTO_2S. -1 Disables the watchdog. */
//#define WATCHDOG_CONF_TIMEOUT -1
/* 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
/* Debugflow macro, useful for tracing path through mac and radio interrupts */
//#define DEBUGFLOWSIZE 128
/* Network setup. The new NETSTACK interface requires RF230BB (as does ip4) */
#if RF230BB
@ -272,6 +279,8 @@ unsigned long clock_seconds(void);
#undef UIP_CONF_UDP_CONNS
#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
#define UIP_CONF_FWCACHE_SIZE 30
#define UIP_CONF_BROADCAST 1

View file

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

View file

@ -76,7 +76,7 @@ static FILE slip_stdout = FDEV_SETUP_STREAM(slip_putchar, NULL,
void
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;
}
/*---------------------------------------------------------------------------*/