[Top][All Lists]

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

Re: [avr-gcc-list] simple program

From: Ian Caddy
Subject: Re: [avr-gcc-list] simple program
Date: Thu, 25 Aug 2005 16:07:06 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041206 Thunderbird/1.0 Mnenhy/

hi Timothy,

You need to deifine the processor you are using when you call the compiler using the -m field, example we use the Mega128


on the compiler line. Replace atmega128 with the processor that you are trying to build.

I hope this helps,

Ian Caddy

Timothy Smith wrote:
hi there i'm new to gcc and avr development and i've tried to make a
very simple program to turn on an LED connected to one of the pins.
cat led.c
#include <inttypes.h>
#include <avr/io.h>

int main(void)
   sbi(DDRD, 1);

and below you can see the error. i also tried i simple test program i
downloaded and i got similar errors, so i'm not sure what i'm doing wrong?

titan# avr-gcc led.c

In file included from led.c:2:
warning: #warning "device type not defined"
led.c: In function `main':
led.c:6: error: `DDRD' undeclared (first use in this function)
led.c:6: error: (Each undeclared identifier is reported only once
led.c:6: error: for each function it appears in.)
led.c:7: error: `PORTD' undeclared (first use in this function)

AVR-GCC-list mailing list

Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9221 1860

reply via email to

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