/* Interrupt Vector Definitions*/ #define INT0 __vector_1 #define T1OVF __vector_6 #define SIGNAL __attribute__ ((signal)) /* AVR IO Registers Definitions */ #define PORTB (*(volatile unsigned char *)(0x18 + 0x20)) /* Data register, Port B */ #define DDRB (*(volatile unsigned char *)(0x17 + 0x20)) /* Data Direction Register, Port B */ #define DDRD (*(volatile unsigned char *)(0x11 + 0x20)) /* Data Direction Register, Port D */ #define PIND (*(volatile unsigned char *)(0x10 + 0x20)) /* Input Pins, Port D */ #define SREG (*(volatile unsigned char *)(0x3F + 0x20)) /* Status Register */ #define GIMSK (*(volatile unsigned char *)(0x3B + 0x20)) /* General Interrupt Mask Register */ #define TIMSK (*(volatile unsigned char *)(0x39 + 0x20)) /* Timer/Counter Interrupt Mask Register */ #define MCUCR (*(volatile unsigned char *)(0x35 + 0x20)) /* MCU General Control Register */ #define TCCR1B (*(volatile unsigned char *)(0x2E + 0x20)) /* Timer/Counter1 Control Register B */ //******************************* Aus dem Internet, soll funktionieren ***************** void INT0 (void) SIGNAL; void T1OVF () SIGNAL; int main(void) { DDRB = 0xff; // Set PORTB to output PORTB = 0xff; // Turn off LEDs SREG = 0x80; // Enable Interrupts GIMSK = 0x40; // Enable External Interrupt 0 TIMSK |= 0x80; // Enable Timer1 Overflow Interrupt MCUCR = 0x02; // Interrupt 0 generated by falling edge while(1); return 0; } /* IRQ 0 Interrupt Handler */ void INT0 (void) { if(MCUCR == 0x03) { // If IRQ0 is rising edge (button released) MCUCR = 0x02; // Set IRQ0 to falling edge PORTB = 0xff; TCCR1B = 0x00; // Disable TIMER1 } else { // IRQ1 is falling edge (button pressed) MCUCR = 0x03; TCCR1B = 0x04; // Start TIMER1 @ CLK/256 } } /* Timer1 Interrupt Handler */ void T1OVF () { PORTB = 0xaa; } //****************************************************** Mein Code mit den Fehlermeldungen: #define GATEWAY_PTR (*(volatile unsigned char *)(I2CHIP_BASE + 0x80)) #define SUBNET_MASK_PTR (*(volatile unsigned char *)(I2CHIP_BASE + 0x84)) #define SRC_HA_PTR (*(volatile unsigned char *)(I2CHIP_BASE + 0x88)) #define SRC_IP_PTR (*(volatile unsigned char *)(I2CHIP_BASE + 0x8E)) unsigned char mac[6]= {0x22,0xa0,0xb1,0xc2,0xd3,0xe4} ; unsigned char ip[4]= {192,168,0,3}; unsigned char gw[4]= {192,168,1,1}; unsigned char sn[4]= {255,255,255,0}; char i; //setMACAddr(ip); // Setup MAC for (i=0; i<6; i++) (SRC_HA_PTR +i) = mac[i]; //warning: array subscript has type `char', error: invalid lvalue in assignment printf("\nMAC fertig!"); //setIP(ip); // Setup source IP for (i=0; i<4; i++) (SRC_IP_PTR + i) = ip[i]; //warning: array subscript has type `char', error: invalid lvalue in assignment printf("\nIP fertig!"); //setgateway(ip); // Setup gateway address for (i=0; i<4; i++) (GATEWAY_PTR + i) = gw[i]; //warning: array subscript has type `char', error: invalid lvalue in assignment printf("\nGW fertig!"); //setsubmask(ip); // Setup subnet mask for (i=0; i<4; i++) (SUBNET_MASK_PTR + i) = sn[i]; //warning: array subscript has type `char', error: invalid lvalue in assignment printf("\nSN fertig!");