|
From: | Andreas Höschler |
Subject: | Re: [avr-gcc-list] Programming ATMega2560 |
Date: | Wed, 26 Nov 2014 23:25:06 +0100 |
Hi Tom, #define F_CPU 16000000UL /* 16 MHz CPU clock */#include <util/delay.h>#define OUTPUTPORT PORTB#define OUTPUTPIN PB7int main (void){DDRB = 0xff; // all outputswhile (1) /* loop forever */{if ((PORTB & _BV(PB7)) > 0) PORTB &= ~_BV(PB7);else PORTB |= _BV(PB7);delay_ms(500);}return (0);} I tried with and without. With I get -bash-3.2$ make avr-gcc -mmcu=atmega2560 -Wall -O2 -I /usr/local/avr/include -I./ -o toggle_led.out main.c unknown MCU 'atmega2560' specified Known MCU names: avr2 at90s2313 ... attiny15 attiny28 main.c:1: error: MCU 'atmega2560' supported for assembler only In file included from main.c:4: /usr/local/avr/include/avr/io.h:530:6: warning: #warning "device type not defined" main.c: In function 'toggleOutput': main.c:19: error: 'PORTB' undeclared (first use in this function) main.c:19: error: (Each undeclared identifier is reported only once main.c:19: error: for each function it appears in.) main.c:19: error: 'PB7' undeclared (first use in this function) main.c: In function 'main': main.c:34: error: 'DDRB' undeclared (first use in this function) main.c:45: error: 'PORTB' undeclared (first use in this function) main.c:45: error: 'PB7' undeclared (first use in this function) make: *** [toggle_led.out] Error 1 :-( Thanks, Andreas |
[Prev in Thread] | Current Thread | [Next in Thread] |