34 #include <avr/pgmspace.h>
36 #include <avr/eeprom.h>
41 #include "loader/symbols-def.h"
42 #include "loader/symtab.h"
44 #define ANNOUNCE_BOOT 0 //adds about 600 bytes to program size
47 #define PRINTF(FORMAT,args...) printf_P(PSTR(FORMAT),##args)
48 #define PRINTSHORT(FORMAT,args...) printf_P(PSTR(FORMAT),##args)
51 #define PRINTSHORT(...)
54 #if RF230BB //radio driver using contiki core mac
59 #else //radio driver using Atmel/Cisco 802.15.4'ish MAC
62 #include "sicslowmac.h"
68 #include "contiki-net.h"
69 #include "contiki-lib.h"
71 #include "dev/rs232.h"
75 #include "sicslowmac.h"
79 .low = (FUSE_CKSEL0 & FUSE_CKSEL2 & FUSE_CKSEL3 & FUSE_SUT0),
80 .high = (FUSE_BOOTSZ0 & FUSE_SPIEN & FUSE_JTAGEN),
87 PROCINIT(&etimer_process, &mac_process, &tcpip_process );
90 uint8_t mac_address[8] EEMEM = {0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x55};
99 USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8);
102 rs232_redirect_stdout(RS232_PORT_1);
119 NETSTACK_RADIO.init();
124 memset(&addr, 0,
sizeof(rimeaddr_t));
125 eeprom_read_block ((
void *)&addr.u8, &mac_address, 8);
130 rf230_set_pan_addr(IEEE802154_PANID, 0, (uint8_t *)&addr.u8);
131 #ifdef CHANNEL_802_15_4
132 rf230_set_channel(CHANNEL_802_15_4);
134 rf230_set_channel(26);
139 PRINTF(
"MAC address %x:%x:%x:%x:%x:%x:%x:%x\n",addr.u8[0],addr.u8[1],addr.u8[2],addr.u8[3],addr.u8[4],addr.u8[5],addr.u8[6],addr.u8[7]);
145 NETSTACK_NETWORK.init();
148 printf_P(PSTR(
"%s %s, channel %u"),NETSTACK_MAC.name, NETSTACK_RDC.name,rf230_get_channel());
149 if (NETSTACK_RDC.channel_check_interval) {
151 tmp=
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval == 0 ? 1:\
152 NETSTACK_RDC.channel_check_interval());
153 if (tmp<65535) printf_P(PSTR(
", check rate %u Hz"),tmp);
155 printf_P(PSTR(
"\n"));
160 printf_P(PSTR(
"Routing Enabled\n"));
163 uip_router_register(&rimeroute);
189 autostart_start(autostart_processes);
191 printf_P(PSTR(
"\n********BOOTING CONTIKI*********\n"));
193 printf_P(PSTR(
"System online.\n"));