Download AVR GCC Tutorial (WinAVR)
Transcript
/* $Id: iom8.h,v 1.13 2005/10/30 22:11:23 joerg_wunsch Exp $ */
/* avr/iom8.h - definitions for ATmega8 */
//...
/* Interrupt vectors */
/* External Interrupt Request 0 */
#define INT0_vect
#define SIG_INTERRUPT0
_VECTOR(1)
_VECTOR(1)
/* External Interrupt Request 1 */
#define INT1_vect
#define SIG_INTERRUPT1
_VECTOR(2)
_VECTOR(2)
/* Timer/Counter2 Compare Match */
#define TIMER2_COMP_vect
#define SIG_OUTPUT_COMPARE2
_VECTOR(3)
_VECTOR(3)
/* Timer/Counter2 Overflow */
#define TIMER2_OVF_vect
#define SIG_OVERFLOW2
_VECTOR(4)
_VECTOR(4)
/* Timer/Counter1 Capture Event */
#define TIMER1_CAPT_vect
#define SIG_INPUT_CAPTURE1
_VECTOR(5)
_VECTOR(5)
/* Timer/Counter1 Compare Match A */
#define TIMER1_COMPA_vect
#define SIG_OUTPUT_COMPARE1A
_VECTOR(6)
_VECTOR(6)
/* Timer/Counter1 Compare Match B */
#define TIMER1_COMPB_vect
#define SIG_OUTPUT_COMPARE1B
//...
_VECTOR(7)
_VECTOR(7)
Possible ones of function trunks for interrupt functions are for example:
#include <avr/interrupt.h>
/* becomes outdated: #include <avr/signal.h> */
ISR(INT0_vect)
/* becomes outdated: SIGNAL(SIG_INTERRUPT0) */
{
/* Interrupt Code */
}
ISR(TIMER0_OVF_vect) /* becomes outdated: SIGNAL(SIG_OVERFLOW0) */
{
/* Interrupt Code */
}
ISR(USART_RXC_vect) /* becomes outdated: SIGNAL(SIG_UART_RECV) */
{
/* Interrupt Code */
}
// and so on and so on…
To the correct way of writing of the vector designation is to be paid attention. The GCC compiler examines only
starting from version 4.x whether a signal/an interrupt of the indicated designation is defined in the Inc. loading
file actually and spends otherwise a warning. With WinAVR (starting from 2/2005) the examination was