Move LEDONPORTE1 define to contiki-conf.h, fixing typo.

This commit is contained in:
David Kopf 2011-08-24 11:35:58 -04:00
parent 7eff518d8f
commit 94fc40f736
4 changed files with 16 additions and 7 deletions

View file

@ -502,7 +502,9 @@ on(void)
#if defined(__AVR_ATmega128RFA1__)
rf230_interruptwait=1;
ENERGEST_ON(ENERGEST_TYPE_LED_RED);
#if RF230BB_CONF_LEDONPORTE1
// PORTE|=(1<<PE1); //ledon
#endif
hal_set_slptr_low();
while (rf230_interruptwait) {}
}
@ -550,7 +552,9 @@ off(void)
/* Sleep Radio */
hal_set_slptr_high();
ENERGEST_OFF(ENERGEST_TYPE_LED_RED);
#if RF230BB_CONF_LEDONPORTE1
// PORTE&=~(1<<PE1); //ledoff
#endif
// DEBUGFLOW('d');
#else
// DEBUGFLOW('e');
@ -834,7 +838,9 @@ rf230_transmit(unsigned short payload_len)
radiowason=0;
// DEBUGFLOW('j');
ENERGEST_ON(ENERGEST_TYPE_LED_RED);
#if RF230BB_CONF_LEDONPORTE1
// PORTE|=(1<<PE1); //ledon
#endif
rf230_interruptwait=1;
hal_set_slptr_low();
while (rf230_interruptwait) {}

View file

@ -291,7 +291,9 @@ raven_gui_loop(process_event_t ev, process_data_t data)
case ICMP6_ECHO_REQUEST:
/* We have received a ping request over the air. Tell the 3290 */
// send_frame(REPORT_PING_BEEP, 0, 0);
#if RF230BB_CONF_LEDONPORTE1
PORTE|=(1<<PE1);ledtimer=1000; //turn on led, set counter for turnoff
#endif
break;
case ICMP6_ECHO_REPLY:
/* We have received a ping reply over the air. Send frame back to 3290 */

View file

@ -97,6 +97,10 @@ unsigned long clock_seconds(void);
/* Debugflow macro, useful for tracing path through mac and radio interrupts */
#define DEBUGFLOWSIZE 128
/* 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
/* Network setup. The new NETSTACK interface requires RF230BB (as does ip4) */
#if RF230BB
#undef PACKETBUF_CONF_HDR_SIZE //Use the packetbuf default for header size

View file

@ -29,9 +29,6 @@
* This file is part of the Contiki operating system.
*
*/
#ifndef LED_ON_PORT1E
#define LED_ON_PORTE1 0 //for Michael Hartman's prototype board
#endif
#define ANNOUNCE_BOOT 1 //adds about 600 bytes to program size
#define DEBUG DEBUG_PRINT
@ -190,7 +187,7 @@ extern uint8_t osccal_calibrated;
/*------Done in a subroutine to keep main routine stack usage small--------*/
void initialize(void)
{
#if !LED_ON_PORTE1 //Conflicts with USART0
#if !RF230BB_CONF_LEDONPORTE1 //Conflicts with USART0
#if RAVEN_LCD_INTERFACE
/* First rs232 port for Raven 3290 port */
rs232_init(RS232_PORT_0, USART_BAUD_38400,USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8);
@ -443,7 +440,7 @@ main(void)
initialize();
#if LED_ON_PORTE1
#if RF230BB_CONF_LEDONPORTE1
/* NB: PORTE1 conflicts with UART0 */
DDRE|=(1<<DDE1); //set led pin to output (Micheal Hatrtman board)
PORTE&=~(1<<PE1); //and low to turn led off
@ -460,7 +457,7 @@ main(void)
}
#endif
#if LED_ON_PORTE1
#if RF230BB_CONF_LEDONPORTE1
/* Turn off LED after a while */
if (ledtimer) {
if (--ledtimer==0) {
@ -517,7 +514,7 @@ if ((clocktime%STAMPS)==0) {
print_stats();
#elif RADIOSTATS
extern volatile unsigned long radioontime;
PRINTA("%u(%u)s",clocktime,radioontime);
PRINTA("%u(%u)s ",clocktime,radioontime);
#else
PRINTA("%us ",clocktime);
#endif