37 #include "dev/rs232.h"
41 #include <dev/watchdog.h>
42 #include <avr/pgmspace.h>
44 #define PRINTA(FORMAT,args...) printf_P(PSTR(FORMAT),##args)
56 #define STACKMONITOR 128
61 void rtimercycle(
void) {rtimerflag=1;}
64 #if defined (__AVR_ATmega8__)
70 #elif defined (__AVR_ATmega16__)
76 #elif defined (__AVR_ATmega644__)
90 PROCESS(led_process,
"LED process");
111 PROCESS(led2_process,
"LED process");
134 DDRB |= (1<<PB1)|(1<<PB0);
135 PORTB &= ~((1<<PB1)|(1<<PB0));
136 DDRD |= (1<<PD2)|(1<<PD3);
137 PORTD &= ~((1<<PD2)|(1<<PD3));
141 PROCINIT(&etimer_process, &led_process, &led2_process);
155 extern uint16_t __bss_end;
156 uint16_t p=(uint16_t)&__bss_end;
158 *(uint16_t *)p = 0x4242;
167 rs232_init(RS232_PORT_0, BAUD_RATE(38400), USART_DATA_BITS_8 | USART_PARITY_NONE | USART_STOP_BITS_1);
168 rs232_redirect_stdout(RS232_PORT_0);
186 PRINTA(CONTIKI_VERSION_STRING
" started\r\n");
190 autostart_start(autostart_processes);
211 if ((rtime%STAMPS)==0) {
212 PRINTA(
"%us ",rtime);
218 if ((rtime%STACKMONITOR)==3) {
219 extern uint16_t __bss_end;
220 uint16_t p=(uint16_t)&__bss_end;
222 if (*(uint16_t *)p != 0x4242) {
223 PRINTA(
"Never-used stack > %d bytes\n",p-(uint16_t)&__bss_end);
227 }
while (p<RAMEND-4);