#include <avrdef.h>
#include"iom32v.h"
#pragma interrupt_handler int0:2
#pragma interrupt_handler int1:3
void int0(void)
{
PORTC=1;
SEI();
while(1);
}
void int1(void)
{
PORTC=0x80;
SEI();
while(1);
}
void main(void)
{
PORTC = 0x00; //m103 output only
DDRC = 0xff;
PORTD=0xff;
DDRD=0X00;
CLI(); //disable all interrupts
MCUCR = 0x00;
GICR = 0xC0;
tiMSK = 0x00; //timer interrupt sources
SEI(); //re-enable interrupts
while(1);
}
一周热门 更多>