5 #include <avr/interrupt.h>
7 #include "sys/sprofiling.h"
11 #if defined (__AVR_ATmega1284P__) && AVR_CONF_USE32KCRYSTAL
12 ISR(TIMER2_COMPB_vect)
__attribute__ ((no_instrument_function));
14 ISR(TIMER2_COMPB_vect)
21 OCR2B = (OCR2B + 29)%(32768/8/CLOCK_CONF_SECOND);
24 TCCR2B &= ~(_BV(CS20)|_BV(CS21)|_BV(CS22));
25 for (i=0;i<OCR2B%7;i++)
29 pc = __builtin_return_address(0);
33 sprofiling_add_sample(pc);
36 inline void sprofiling_arch_start(
void)
40 TIMSK2 |= _BV(OCIE2B);
43 inline void sprofiling_arch_stop(
void)
45 TIMSK2 &= ~_BV(OCIE2B);
48 void sprofiling_arch_init(
void)
51 OCR2B = 32768/8/CLOCK_CONF_SECOND - 1;
55 #error "Please define your own arch specific profiling functions."