avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Two interrupts with same handlers


From: Carsten Beth
Subject: [avr-gcc-list] Two interrupts with same handlers
Date: Tue, 04 Dec 2001 22:51:57 +0100

Hi there,

I have  written an application with avr-gcc which uses two interrupt
sources (analog compare match and timer0 overflow). Both interrupts have
the same handler. So I wrote something like this:

#include <sig-avr.h>

void interrupt_handler( void )
{
...
}

// Timer0Overflow Interrupt Function
SIGNAL( SIG_OVERFLOW0 )
{
  interrupt_handler();
}

// Analog Comparator Interrupt Function
SIGNAL( SIG_COMPARATOR )
{
  interrupt_handler();
}

All is working very fine, but the compiler wastes a lot of programm
memory. He generates two interrupt vectors which point to different
functions and both functions make a lot of push and pop with a rcall
interrupt_handler in between. Actualy both function do the same thing,
so the interrupt vectors could point to the same function.

Is there any way to manipulate the code, so no or less memory is wasted?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]